File: Data.xml
<?xml version="1.0"?>
<us>
<state>South Carolina</state>
<state>South Dakota</state>
<state>Tennessee</state>
<state>Texas</state>
<state>Utah</state>
<state>Vermont</state>
<state>Virginia</state>
<state>Washington</state>
<state>West Virginia</state>
<state>Wisconsin</state>
<state>Wyoming</state>
</us>
File: Transform.xslt
<?xml version="1.0" encoding="US-ASCII"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text" />
<xsl:template match="us">
<xsl:apply-templates select="state" />
</xsl:template>
<xsl:template match="state">
<xsl:number format="I	" />
<xsl:value-of select="." />
<xsl:text> </xsl:text>
</xsl:template>
</xsl:stylesheet>
Output:
I South Carolina
II South Dakota
III Tennessee
IV Texas
V Utah
VI Vermont
VII Virginia
VIII Washington
IX West Virginia
X Wisconsin
XI Wyoming
|