Re: [xsl] How to mark every 5th output record.

Subject: Re: [xsl] How to mark every 5th output record.
From: "Andrew Welch" <andrew.j.welch@xxxxxxxxx>
Date: Tue, 11 Mar 2008 14:20:59 +0000
On 11/03/2008, Patrick Bergeron <pbergeron@xxxxxxxxxxx> wrote:
>  As I said the rules under which I process my list are quite complex. So much
>  so that my XSLT stylesheet is over 2900 lines of code (and yes, that's just
>  nuts).

That's actually quite normal with XSLT.  Someone once suggested 1
template per file in an attempt to make a large stylesheet of mine
more "managable"... which is of course nonsense.

Modularize your stylesheets when its appropriate, but don't do it just
because 2900 lines seems large.

>  Is my only option to create another tree that contains all of my output
>  record results, and then iterate over that tree once again, and putput the
>  same data verbatim, only this time insert a marker every 5th?
>  Gheesh, talk about using a tank to shoot a bird.

Again that's really common technique, is good practice and good
architecture for a transform - separate out your problem into steps
and do one step at a time.  Once it's producing the correct output
then think about whether it really is a problem - you might find that
actually the separation of the steps helps you solve most of problems
you come across in the future as the requirements change.

Andrew Welch

Current Thread