wood burning stoves 2.0*
The moose likes XML and Related Technologies and the fly likes xsl sorting problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "xsl sorting problem" Watch "xsl sorting problem" New topic
Author

xsl sorting problem

Sarran Vidyakumar
Greenhorn

Joined: Mar 26, 2003
Posts: 28
<xsl aram name="sortorder" select="'descending'"/>
<xsl aram name="sortfield" select="'com_device'"/>

<xsl:template match="ROOT">
<ROOT>
<xsl:apply-templates/>
</ROOT>
</xsl:template>

<xsl:template match="read">
<read>
<xsl:apply-templates>
<xsl:comment><xsl:sort select="*[name()=$sortfield]" order="{$sortorder}" /></xsl:comment>
<xsl:sort select="com_device" order="ascending"/>
</xsl:apply-templates>
</read>
</xsl:template>

<xsl:template match="read/*">
<xsl:element name="{name()}">
<xsl:value-of select="." />
</xsl:element>
</xsl:template>

</xsl:stylesheet>


Hey Guys:
am using the above xsl to sort xml file below
<ROOT>
<read><oneCol>data</oneCol><twoCol>data</twoCol><read>
<read><oneCol>data</oneCol><twoCol>data</twoCol><read>
<read><oneCol>data</oneCol><twoCol>data</twoCol><read>
<read><oneCol>data</oneCol><twoCol>data</twoCol><read>
<read><oneCol>data</oneCol><twoCol>data</twoCol><read>
<read><oneCol>data</oneCol><twoCol>data</twoCol><read>
......
</ROOT>

Problem iz the output produces the same xml file.. The sorting does not occur ?? Any Suggestions ?? Thanks..
 
wood burning stoves
 
subject: xsl sorting problem
 
Similar Threads
xml to xml transform
sort child elements based on its attribute value which is expected to alphanumeric - XSLT
including .htc / .css files
xsl getNext to sort output
XSLT problem.