File: Data.xml
<names>
<name>John</name>
<name>Josua</name>
<name>Charles</name>
<name>Alice</name>
<name>Martha</name>
<name>George</name>
</names>
File: Transform.xslt
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<TABLE>
<xsl:apply-templates select="//name">
<xsl:sort order="descending" select="."/>
</xsl:apply-templates>
</TABLE>
</xsl:template>
<xsl:template match="name">
<TR>
<td>
<xsl:value-of select="."/>
</TH>
</TR>
</xsl:template>
</xsl:stylesheet>
Output:
<?xml version="1.0" encoding="UTF-8"?><TABLE><TR><td>Martha</TH></TR><TR><td>Josua</TH></TR><TR><td>John</TH></TR><TR><td>George</TH></TR><TR><td>Charles</TH></TR><TR><td>Alice</TH></TR></TABLE>
|