XML.orgXML.org
FOCUS AREAS |XML-DEV |XML.org DAILY NEWSLINK |REGISTRY |RESOURCES |ABOUT
OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
Re: [xml-dev] Basic program structures in XSLT (was: Re: [xml-dev]Data-driven application --> the data is essentially "machine code" to theapplication, right?)

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]


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 1993-2007 XML.org. This site is hosted by OASIS