xsl-list
[Top] [All Lists]

Re: [xsl] Eliminating leading zeros

2006-08-21 06:50:59
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 
        
                
___________________________________________________________________________ 
Découvrez un nouveau moyen de poser toutes vos questions quelque soit le sujet 
! 
Yahoo! Questions/Réponses pour partager vos connaissances, vos opinions et vos 
expériences. 
http://fr.answers.yahoo.com 


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>