Re: Eliminating leading zeros
Mark Wilson wrote: > Without the <xsl:otherwise>, a NaN was returned. Thus my third set of > problems, yet unsolved. > If <xsl:value-of select="number(.)" /> renders properly when only > digits > are present, what would the code look like to render > <sortedItem> 05 (supl.)</sortedItem> > as > <renderedItem> 5 (supl.)</renderedItem> > That is, removing the leading zero in this case. So maybe my first response wasn't so stupid :-). You can use a choose where you test if the string starts with " 00" or " 0". If you don't know how many leading zeros there may be (but I guess you know, because you add them yourself), you can use substrings to get the first token surrounded by withespaces, then try number() on that, and concatenate the string with the number (or keep the original string if NaN). Regards, --drkm p4.vert.ukl.yahoo.com uncompressed/chunked Mon Aug 21 13:13:44 GMT 2006 ___________________________________________________________________________ Dicouvrez un nouveau moyen de poser toutes vos questions quelque soit le sujet ! Yahoo! Questions/Riponses pour partager vos connaissances, vos opinions et vos expiriences. http://fr.answers.yahoo.com
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format