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

Re: Get parent's node position - Urgent

Subject: Re: Get parent's node position - Urgent
From: "Paulo Henrique S. Bermejo" <bermejo@xxxxxxxxxxx>
Date: Tue, 25 Sep 2001 13:11:26 -0300
xslt get parent
Ok Mike, thanks a lot. Excellent!!!
And what I would make to get a position of grand-parent??

XML (part)




XSL (part)

<xsl:template match="DIRECAO-E-ADMINISTRACAO">
     <!-- I would like to get a position of <ATUACAO-PROFISSIONAL> element
that call this template -->
     <!-- Example:
     <xsl:value-of select="count(parent::*/preceding-sibling::*)"/>
     Get a position of <ATIVIDADES-DE-DIRECAO-E-ADMINISTRACAO> element. -->

Thanks a lot.


----- Original Message -----
From: Michael Kay
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Sent: Wednesday, September 26, 2001 12:37 PM
Subject: RE:  Get parent's node position - Urgent

> To get the name of parent node I know:
> <xsl:value-of select="name(parent::*)"/>
> But I need the position.

What do you mean by "position"?
If you mean the number of preceding sibling elements, use


or use xsl:number

The position() function is about the position of the context node in the
sequence of nodes currently being processed, it has nothing to do with the
position of a node in the source tree.

Mike Kay

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

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

Current Thread


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.
First Name
Last Name
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.