[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: How to cope with the complexity of an XSLT program

Subject: Re: How to cope with the complexity of an XSLT program with thousands of template rules?
From: "John Lumley john@xxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 2 Jun 2022 14:31:35 -0000
Re:  How to cope with the complexity of an XSLT program
On 02/06/2022 12:45, Roger L Costello costello@xxxxxxxxx wrote:
Question: what techniques do you use to control the complexity of a large XSLT program?

I've been shot down in flames for this on previous occasion, but sometimes there has developed a notion that you should ALWAYS use application of template rules to declare choice and alternatives, mostly on the grounds of future extensibility.


But often your problem locally is defined by a very clear and finite set of ordered (and possibly mutually exclusive alteratives). In such cases I've seen code which goes to inordinate lengths to describe these exclusive choices through separate templates by repeating predicates and their negations or working hard to control or define template priorities. In such cases 'unintended overlap' with templates off in the far reaches of your code universe becomes a distinct risk, certainly if you don't use modes or have include/importation arms and debugging such can be a nightmare.

In some of these cases a much simpler, more controllable. and much more clearly readable, local solution might be to use an xsl:choose which gives you a clearly defined order of conditions, with complete local previous context and which will NOT be interfered with from externally defined sections of code.

--
*John Lumley* MA PhD CEng FIEE
john@xxxxxxxxxxxx

Current Thread

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
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.