Subject: Re: [xsl] Eliminating leading zeros From: "andrew welch" <andrew.j.welch@xxxxxxxxx> Date: Mon, 21 Aug 2006 15:21:12 +0100 |
Yes I am using XSLT2 (albeit very poorly understood). Will try your suggestion.
Padding leading zero's to sort and then removing them seems like a bad idea when you can just sort twice, once using data-type number and then again using text, extracting the relevant part of the value each time, eg:
<xsl:sort select="replace(., '\s\D*', '')" data-type="number"/> <xsl:sort select="replace(., '\d*\s', '')" data-type="text"/>
Otherwise you will need to pick a suitably large number of zeros to pad and hope a longer number never appears, or find the maximum length for all the numbers up front...
cheers andrew
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Eliminating leading zeros, David Carlisle | Thread | Re: [xsl] Eliminating leading zeros, Florent Georges |
Re: [xsl] Concatenation of the same, David Carlisle | Date | Re: [xsl] Eliminating leading zeros, Mark Wilson |
Month |