File: Data.xml
<?xml version="1.0" encoding="utf-8"?>
<data>
<n>one</n>
<n>two</n>
<n>three</n>
<n>four</n>
</data>
File: Transform.xslt
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<TABLE>
<xsl:for-each select="//n">
<TR>
<TD>
<xsl:number value="position()" format="a# "/>
<xsl:value-of select="."/>
</TD>
</TR>
</xsl:for-each>
</TABLE>
</xsl:template>
</xsl:stylesheet>
Output:
<?xml version="1.0" encoding="UTF-8"?><TABLE><TR><TD>a# one</TD></TR><TR><TD>b# two</TD></TR><TR><TD>c# three</TD></TR><TR><TD>d# four</TD></TR></TABLE>
|