This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: sorting numbers


Hi Frederic,

> In my xml string i get numbers, now if i do a usual sort i'll get
> something like 0- 1 - 2 - 21 - 29 - 3
>
> etc... nog i'd like to get that sorted as 0 - 1 - 3 - 21 - 29 ...

By default with xsl:sort you get alphabetical sort; you want a
numerical sort. You can make the XSLT processor sort numerically by
setting the data-type attribute on xsl:sort to "number" rather than
the default "text". For example:

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

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]