RE: [xsl] how to get new position() of a node in a sorted result tree?

Subject: RE: [xsl] how to get new position() of a node in a sorted result tree?
From: "Michael Kay" <mhkay@xxxxxxxxxxxx>
Date: Thu, 2 Aug 2001 10:19:28 +0100
>     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


Current Thread