[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: childnum of node


Subject: Re: childnum of node
From: "Nikolai Grigoriev" <grig@xxxxxxx>
Date: Sat, 11 Dec 1999 01:38:50 +0300

Jeremy Richman wrote:


>Is there a way to get the childnum of a node into a variable, besides
using:
>1+count(preceding-sibling::*)


In most cases, when the current node list is just a list of siblings, you
can use
position(). In a general case, <xsl:number count="*"/> gives you the
childnum
as a result tree fragment, regardless of the current node list; to use it in
an
expression context, you have to paste it into an xsl:variable (and it grows
more
verbose than your initial solution ;-( - sorry).

Nikolai



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



Current Thread