File: Data.xml
<?xml version="1.0" encoding="utf-8"?>
<data>
<car id="11"/>
<car id="6"/>
<car id="105"/>
<car id="28"/>
<car id="9"/>
</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="//car">
<xsl:sort data-type="number" select="@id"/>
<TR>
<TH>
<xsl:text>Car-</xsl:text>
<xsl:value-of select="@id"/>
</TH>
</TR>
</xsl:for-each>
</TABLE>
</xsl:template>
</xsl:stylesheet>
Output:
<?xml version="1.0" encoding="UTF-8"?><TABLE><TR><TH>Car-6</TH></TR><TR><TH>Car-9</TH></TR><TR><TH>Car-11</TH></TR><TR><TH>Car-28</TH></TR><TR><TH>Car-105</TH></TR></TABLE>
|