[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Basic program structures in XSLT (was: Re: Data-d
On Thu, 2022-12-08 at 10:52 -0700, C. M. Sperberg-McQueen wrote: > > What would you say are the basic control structures for programming > in XSLT? Primary tools include - * Implicit dispatch of templates using apply-templates; this is central. * Changing the context with for-each * Closures and visibility After that, it's a case of a few main constructs such as xsl:iterate, xsl:for-each-group (and emphasizing for-each is not a looping construct), and of course xsl:choose, although that's less important than it used to be in 1.0 days. > > 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? I use a couple of principles here - Input-completeness: is everything in the input explicitly matched (and should it be?) Schema-completeness: is everything that _could_ appear in the input explicitly matched (and should it be?) I've written tools to help with both of these questions. But they don't answer your question completely. So beyond that, it's interesting (perhaps) to ask at what point, if any, the difference in input and output structures means apply-templates isn't useful, and why. -- Liam Quin, https://www.delightfulcomputing.com/ Available for XML/Document/Information Architecture/XSLT/ XSL/XQuery/Web/Text Processing/A11Y training, work & consulting. Barefoot Web-slave, antique illustrations: http://www.fromoldbooks.org
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] |
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|