This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: sorting problem
- To: xsl-list at lists dot mulberrytech dot com
- Subject: RE: [xsl] sorting problem
- From: bryan dot s dot schnabel at exgate dot tek dot com
- Date: Wed, 14 Feb 2001 14:02:59 -0800
- Reply-To: xsl-list at lists dot mulberrytech dot com
The example in the spec uses two templates. This works on your sample
input:
<xsl:template match="AAA">
<xsl:apply-templates select="BBB">
<xsl:sort data-type="number" order="descending" select="."/>
</xsl:apply-templates>
</xsl:template>
<xsl:template match="BBB">
<xsl:text> </xsl:text>
<xsl:value-of select="."/>
</xsl:template>
-----Original Message-----
From: Awasthi, Anand [mailto:Anand_Awasthi@bmc.com]
Sent: Wednesday, February 14, 2001 10:24 AM
To: 'xsl-list@lists.mulberrytech.com'
Subject: [xsl] sorting problem
hi i am trying to sort following xml :
<AAA>
<BBB>1</BBB>
<BBB>22</BBB>
<BBB>11</BBB>
<BBB>2222</BBB>
<BBB>1111</BBB>
<BBB>10</BBB>
<BBB>444444</BBB>
</AAA>
in desecnding order using following xsl:
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="AAA">
<xsl:apply-templates select="BBB">
<xsl:sort data-type="number" order="descending"
select="."/>
</xsl:apply-templates>
</xsl:template>
</xsl:stylesheet>
but everytime i am getting following output :
1 10 11 1111 22 2222 44344444
but acrually it should be :
1 10 11 22 1111 2222 44344444
i am not sure what the problem is ??
could somoene pls look into above xsl piece and le t me know the problem ??
thanks
Anand
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list