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="1. "/>
<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>1. one</TD></TR><TR><TD>2. two</TD></TR><TR><TD>3. three</TD></TR><TR><TD>4. four</TD></TR></TABLE>
|