<xslTutorial creator="nicmila@idoox.com">
<index keywords='name() xsl:call-template '/>

<description> You can get the name of currently selected element with name function. <stylesheet id='id2'/> prints names of all elements used in the document.  <stylesheet id='id3'/> selects only elements which occurs first in each level. 
  </description>

<xmlSource id="id1">
<contact>
<name>John Smith</name>
<street>Long street </street>
<number>7</number>
<tel>
<home>25252511</home>
<work>14598752</work>
</tel>
</contact>

<contact>
<name>Joe Rye</name>
<street>Short avenue </street>
<number>75</number>
<tel>
<home>21111111</home>
<work>258987412</work>
</tel>
</contact> 
</xmlSource>

<attValues>
</value>
</attValues>


 <xslStylesheet id="id2">
 <xsl:template match="/">
 <TABLE>
 <xsl:for-each select="//*">
 <xsl:call-template name="generalTemplate"/>
</xsl:for-each>
</TABLE>
</xsl:template>

<xsl:template name="generalTemplate">
<TR><TD><xsl:value-of select="name(.)"/></TD></TR>
</xsl:template>
</xslStylesheet>

<xslStylesheet id="id3">
 <xsl:template match="/">
 <TABLE>
 <xsl:for-each select="//*[1]">
 <xsl:call-template name="generalTemplate"/>
</xsl:for-each>
</TABLE>
</xsl:template>

<xsl:template name="generalTemplate">
<TR><TD><xsl:value-of select="name(.)"/></TD></TR>
</xsl:template>
</xslStylesheet>

</xslTutorial>