xsl-list
[Top] [All Lists]

Re: [xsl] Using xsl:sort to sort negative values

2007-02-20 15:49:08
On 2/20/07, Sola Awe <sodana(_at_)hotmail(_dot_)com> wrote:
Hi,
   Can anyone tell why the code below will not work?

<xsl:sort select="data" data-type="number"/>

I am trying to sort numeric data that contains negative values but the order
seems to be wrong

<xml>
<data>22</data>
<data>2</data>
<data>-5</data>
<data>42</data>
<data>0</data>
<data>-1</data>
<data>0</data>
</xml>


This is the output

0
-1
0
-5
2
22
42

I want
-5
-1
0
0
2
22
42

There's no error in the code you've shown, so it's likely to be one of these:

- you made an error in the code you haven't shown us
- your real xml doesn't match your example xml
- the processor you're using has a bug

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--