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: Position() of parent node



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

  jenglish@flightlab.com

[*] 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:  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]