[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

  • From: "Liam R. E. Quin" <liam@fromoldbooks.org>
  • To: "C. M. Sperberg-McQueen" <cmsmcq@blackmesatech.com>, Michael Kay <mike@s...>
  • Date: Thu, 08 Dec 2022 14:20:25 -0500

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!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.