posted 23 years ago
Hi,
U should use <xsl:sort> inside <xsl:for-each>..
For example take this sample code.
// xml file
<?xml�version="1.0"?>
<xslTutorial�>
<name>John</name>
<name>Josua</name>
<name>Charles</name>
<name>Alice</name>
<name>Martha</name>
<name>George</name>
</xslTutorial>
//xsl file
<xsl:stylesheet xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
<xsl:template match="/">
<TABLE>
<xsl:for-each select="//name">
<xsl:sort order="ascending" select="."/>
<TR><TH><xsl:value-of select="."/></TH></TR>
</xsl:for-each>
</TABLE>
</xsl:template>
</xsl:stylesheet>
It gives result in ascending order like the following structure
Alice
George
Charles
John
Josua
Martha
Best Regards,
Paramaguru