Re: [xsl] Numbering new nodes using consecutive integers

Subject: Re: [xsl] Numbering new nodes using consecutive integers
From: Michael Ludwig <milu71@xxxxxx>
Date: Sat, 28 Mar 2009 10:50:53 +0100
Wendell Piez schrieb am 27.03.2009 um 15:59:24 (-0400):
> >
> > Yes, but how would you *ever* generate numbers relative to
> > the result ?!
> 
> In one pass? By doing it the way David tried and Ken (may
> have) succeeded: reflecting the grouping/ordering logic
> directly in XPath (or XSLT functions and/or, ouch, template
> calls).
> 
> In other words, not by counting anything in the result, but
> rather by expressing algorithmically the number that will be
> correct for the thing when it is made for you, in the usual
> in-XSLT-everything-happens-at-once way of thinking.

Thanks, Wendell - your words make a lot of sense. "Expressing
algorithmically the number that will be correct" - and this can
be as simple as position(), once you get the context right,
which I didn't, thus misleading everyone ... :-)

David's second try is a nice demonstration of how easy this
actually is once you step back and frame the problem correctly.

Michael Ludwig

Current Thread