This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

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


>     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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]