[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Position() of parent node

Subject: Re: Position() of parent node
From: Joe English <jenglish@xxxxxxxxxxxxx>
Date: Tue, 06 Feb 2001 13:41:59 -0800
parent node position
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@xxxxxxxxxxxxx

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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.