xsl-list
[Top] [All Lists]

[xsl] Eliminating leading zeros

2006-08-21 04:53:34
In order to sort item numbers with <xsl:sort> properly and prevent the sorted ouptput order of 1, 10, 100, 2, 3 and so on, I left pad the numbers with leading zeros: 001,002, 003, 010, 100 .... so that I get 001, 002, 003, 010, 100 ... when I run a ascii sort [other elements are also sorted, so I cannot drop the ascii sort].

I have been trying to figure out how to kill the leading zero after the sort and before printing the output to either an xml or xhtml document. That is, after the sort, when I output the sorted

<item>001</item>
... ... ...
<item>100</item>

I would like it to be rendered as

<sortedItem>1</sortedItem>
... ... ...
<sortedItem>100</sortedItem>

I asume this is a common problem but have not a clue where to look in the archives.Can someone give me a hint?
Thanks,
Mark

--~------------------------------------------------------------------
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>
--~--