xsl-list
[Top] [All Lists]

Re: [xsl] Numbering new nodes using consecutive integers

2009-03-28 05:51:31
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

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--