[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: "Mark Wilson" <drmark@xxxxxxxxxxxxxxx>
Date: Mon, 21 Aug 2006 09:25:16 -0400
mark wilson
Thanks,
98% of my problem was solved by your suggestion. Actually, the full senerio required some additional statements.


I put in a <xsl:if> test to determine whether the optional element <sortedItem> was present or not present (this solved my first set of problems), and if it was, I used an <xsl:choose> for <xsl:when> <sortedItem> contained only digits (this solved my second set of problems) and <xsl:otherwise> when it contained digits together with addition characters, as in

<sortedItem>05 (supl.)</sortedItem>

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.


The actual additional text in <sortedItem> may vary, but the digits always come first and there is always a space after them. The text is usually,but may not always be, (supl.).

Again, thanks for the first bit of help.
Mark


----- Original Message ----- From: "David Carlisle" <davidc@xxxxxxxxx>
To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Monday, August 21, 2006 7:56 AM
Subject: Re: Eliminating leading zeros




number(.)


David

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