<xslTutorial creator="nicmila@idoox.com">
<index keywords='name() xsl:call-template '/>
<description>An example of use of function name() </description>
<xmlSource id="id1">
<date year='1999' month='11' day='23'/>
<weight kg='24' g='314'/>
</xmlSource>
<attValues>
<value match='//*[@*]'>Selects all elements containing attributes</value>
</attValues>
<xslStylesheet id="id2">
<xsl:template match="/">
<TABLE>
<xsl:for-each select="//*[@*]">
<xsl:call-template name="elementTemplate"/>
</xsl:for-each>
</TABLE>
</xsl:template>
<xsl:template name="elementTemplate">
<TR><TH><xsl:value-of select="name(.)"/></TH>
<TD><xsl:call-template name="attributeTemplate"/></TD></TR>
</xsl:template>
<xsl:template name="attributeTemplate">
<xsl:for-each select="@*">
<xsl:value-of select="name()"/>
<xsl:text>=</xsl:text>
<xsl:value-of select="."/>
<xsl:text> </xsl:text>
</xsl:for-each>
</xsl:template>
</xslStylesheet>
</xslTutorial>