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]
Other format: [Raw text]

Re: Can I find out the names of elements in a tree?


Hi Khalid,

Jeni, Michael & Co. are so deepened in their discussions about the 2.0
working drafts, that they forget to answer the easy questions ;-) I think
name() is the thing that you have been searching for.

<xsl:template match="root">
    <xsl:apply-templates select="*"/>
</xsl:template>

<xsl:template match="*">
    <xsl:value-of select="name()"/>
    <xsl:text>&#10;</xsl:text>
    <xsl:apply-templates select="*"/>
</xsl:template>

Regards,

Joerg

----- Original Message -----
From: "Khalid" <k_ali@telusplanet.net>


> If yes then can some on help me find out how?
> suppose the exml doc looks like the following
> <root>
>  <first>
>   <second>
>     <third>
>       <and-so-on>
>       </and-so-on>
>     </third>
>   </second>
>  </first>
> </root>
>
> <xsl:template match = "root">
>  and in here I want to find out the names of all the nodes in a display
able
> manner i.e one name on each line or something
>
> </xsl:template
>
> Thanks


 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]