[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Eliminating leading zeros

Subject: Eliminating leading zeros
From: "Mark Wilson" <drmark@xxxxxxxxxxxxxxx>
Date: Mon, 21 Aug 2006 07:45:00 -0400
xml prevent leading zeros
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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.