Altova Mailing List Archives

RE: [xsl] Incremental Numbering

From: "Michael Kay" <mike@------------>
Date: 5/9/2006 7:39:00 PM
> >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


These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.