Re: [xsl] Position() of parent node

Subject: Re: [xsl] Position() of parent node
From: Joe English <jenglish@xxxxxxxxxxxxx>
Date: Tue, 06 Feb 2001 13:41:59 -0800
Simon Cansick wrote:

> Can anyone provide me with the syntax for getting the position() value of
> the current nodes' parent node (and the parent parent etc. position()
> value).  I seem only able to return the current position().

The position() is not an intrinsic property of a node --
it only makes sense to ask for the position() of a node
_in the context of some node list_ [*].

Most likely you want the position of the parent node with
respect to its siblings, in document order; you can compute
this with:

	1 + count(parent::*/preceding-sibling::*)

--Joe English


[*] I'm using the term "node list" to mean "a node set with
    an associated order", e.g., proximity position order,
    document order, an <xsl:sort...>-defined order, etc.

 XSL-List info and archive:

Current Thread