Basic program structures in XSLT (was: Re: [xml-dev] Data-driven application --> the data is essentially "machine code" to the application, right?)
"C. M. Sperberg-McQueen" <[email protected]>
| Newsgroups | gmane.text.xml.devel |
|---|---|
| Message-ID | <[email protected]> |
Michael Kay <[email protected]> writes: > I think what you're doing here is re-discovering the isomorphism > between data and program structures, an idea which was elegantly > explored in Jackson Structured Programming. The essence of the idea > (which dates back to sequential processing of hierarchical data files > on magnetic tape) is that the structure of the code should generally > follow the structure of the input data, and that a schema for the data > (in terms of a tree with sequence, choice, and repetition nodes) > translates into a program design with instruction sequences, > conditionals, and loops. > ... Excellent point, and as a beginner I found it very helpful to be taught sequences, conditionals, and loops and be told that they were essentially all there was to programming and that everything else in the manual could be reduced to them. This raises an important question. When I try to teach novices about XSLT, I always think about that two-hour "Introduction to programming" that just taught flowchart notation for those three constructs and showed us how to perform stepwise refinement of a task. I wish I had an equally compelling list of basic control structures for programming in XSLT (and for that matter in XQuery), but I have not come up with anything plausible. So, a question for the xml-dev list: What would you say are the basic control structures for programming in XSLT? > Where it gets interesting is when the hierarchic structure of the > output doesn't match the hierarchic structure of the input, and > Jackson goes into great detail analysing the different types of > structure clash and the techniques for dealing with them. This provokes a similar but broader question: are there analogous basic principles for program design which can be used to guide construction of a transformation in XSLT? Michael Sperberg-McQueen -- C. M. Sperberg-McQueen Black Mesa Technologies LLC http://blackmesatech.com _______________________________________________________________________ XML-DEV is a publicly archived, unmoderated list hosted by OASIS to support XML implementation and development. To minimize spam in the archives, you must subscribe before posting. [Un]Subscribe/change address: http://www.oasis-open.org/mlmanage/ Or unsubscribe: [email protected] subscribe: [email protected] List archive: http://lists.xml.org/archives/xml-dev/ List Guidelines: http://www.oasis-open.org/maillists/guidelines.php