RE: [xsl] Incremental Numbering

Subject: RE: [xsl] Incremental Numbering
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Tue, 9 May 2006 20:38:25 +0100
> >Is there any way I can store and increment a value in this way?
> No, but I'm sure from your earlier comment that you've 
> already determined from the archives that this is not possible.

Well, there is an alternative solution to Ken's: in fact two. Ken computes
the number for each item as a function of information in the source, which
is a perfectly reasonable approach in this case but doesn't work for all
such problems. 

Plan B is to process the source records using recursion: write a
function/template that processes one input record, then calls itself to
process the remainder. On the recursive call, you can pass parameters that
represent the current state, for example a number which increments on each

Plan C is a two-phase transformation: first generate the output table, then
in a second pass, number its cells.

Michael Kay

Current Thread