Re: [xsl] Eliminating leading zeros

Subject: Re: [xsl] Eliminating leading zeros
From: David Carlisle <davidc@xxxxxxxxx>
Date: Mon, 21 Aug 2006 14:57:58 +0100
>   If you don't know how many leading zeros there may be (but I guess
> you know, because you add them yourself), 

oh I missed that. If the input is under your control then you can make
it look like

<stuff><padding>000</padding>5 (foo)</stuff>
<stuff><padding>00</padding>15 (bar)</stuff>
...

sorting on "stuff" will work the same way (as the string value of stuff
is unaffected by adding the padding markup, and then to render the
contents you use apply-templates together with
<xsl:template match="padding"/>

David

Current Thread