xsl-list
[Top] [All Lists]

Re: [xsl] How to cope with the complexity of an XSLT program with thousands of template rules?

2022-06-02 10:11:35


That solved the problem and avoided problematic template interactions, but it 
made me feel defeated because I resorted to a linear way of solving the 
problem.


Pipelines are a great way to reduce complexity - doing multiple passes over the 
data, each pass doing one well-defined thing, is a great way to keep things 
simple. That's after all the great strength of the bag-of-tricks in UNIX - 
compose complex tasks as a pipeline of simple tasks.

It also gives you a lot of reuse potential: the same modules can be reused in 
different pipelines.

If you ever see a stylesheet that's complex because it's trying to handle 
multiple variants of input formats, or to produce multiple variants of output 
formats, that's a code smell: the input variety or output variety should have 
been handled through preprocessing or postprocessing transformations in a 
pipeline.

Michael Kay
Saxonica
--~----------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
EasyUnsubscribe: http://lists.mulberrytech.com/unsub/xsl-list/1167547
or by email: xsl-list-unsub(_at_)lists(_dot_)mulberrytech(_dot_)com
--~--


<Prev in Thread] Current Thread [Next in Thread>