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

Re: Eliminating leading zeros

Subject: Re: Eliminating leading zeros
From: Florent Georges <darkman_spam@xxxxxxxx>
Date: Mon, 21 Aug 2006 15:50:40 +0200 (CEST)
concatenate leading zero
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 

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-2011 All Rights Reserved.