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

Subject: Re: [xsl] How to cope with the complexity of an XSLT program with thousands of template rules?
From: "Michael Kay mike@xxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 2 Jun 2022 15:11:23 -0000
> 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

Current Thread