The xsl:number
element has a variety of attributes to determine
number style, exactly what's counted, where numbering starts, and so forth
The position()
function returns the position of the current
node in the context node list
<xsl:template match="PERIODIC_TABLE">
<body>
<xsl:for-each select="ATOM">
<xsl:sort select="NAME"/>
<xsl:number value="position()"/>. <a href="#{SYMBOL}">
<xsl:value-of select="NAME"/></a><br />
</xsl:for-each>
<xsl:apply-templates select="ATOM">
<xsl:sort select="ATOMIC_NUMBER" data-type="number"/>
</xsl:apply-templates>
</body>
</xsl:template>