|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] How to find out the level of an element
Hi,
Is it possible to find out fat what level a particular element is appearing from the root level? For example:- <a>
<b>
<c>
</c>
</b>
</a><a>
<b>
<c>
</c>
</b>
</a>I tried the following code but it isn't working. <xsl:variable name="LastLevel">
<xsl:for-each test="//c[1]">
<xsl:value-of select="count(ancestor::a | ancestor::b)" />
</xsl:for-each>
</xsl:variable>I need to find out the level of element <c>. In the above example it should be 2. Thanks in advance. Arun
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








