This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: how to get new position() of a node in a sorted result tree?
- To: <xsl-list at lists dot mulberrytech dot com>
- Subject: RE: [xsl] how to get new position() of a node in a sorted result tree?
- From: "Michael Kay" <mhkay at iclway dot co dot uk>
- Date: Thu, 2 Aug 2001 10:19:28 +0100
- Reply-To: xsl-list at lists dot mulberrytech dot com
> Anyone knows how to get the new node position() of a
> sorted result tree?
>
> When I call the position() function, it returns the
> position ID in the original
> tree not the position ID in the new sorted tree.
No, position() returns the position of the context node within the sequence
of nodes that the most recent call of xsl:for-each or xsl:apply-templates is
processing, in their order after sorting.
Try setting a variable to the value of position() immediately after your
<xsl:sort> element, and passing the value down into any subsidiary
templates.
Mike Kay
Software AG
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list