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

Re: position in the tree

Subject: Re: position in the tree
From: "Joerg Heinicke" <joerg.heinicke@xxxxxx>
Date: Tue, 12 Mar 2002 20:15:11 +0100
xsl tree position
<xsl:template match="pregunta">
    <xsl:for-each select="ancestor::pregunta">
        <xsl:text>  </xsl:text>
    </xsl:for-each>
    <xsl:value-of select="normalize-space(text())"/>
    <xsl:text>&#10;</xsl:text>
    <xsl:apply-templates select="pregunta"/>
</xsl:template>

output:

1
  1.1
    1.1.1
    1.1.2

For HTML you can replace '  ' with '&#160;&#160;' and
'<xsl:text>&#10;</xsl:text>' with '<br/>'.

Regards,

Joerg

> if i have the next xml how can i determine where i am?
>
> <foro>
> <pregunta>1
> <pregunta>1.1
> <pregunta>1.1.1</pregunta>
> <pregunta>1.1.2</pregunta>
> </pregunta>
> </pregunta>
> <foro>
>
> how can i determine the number of child?
> the numbor of indentation?
> thanks


 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.