xsl-list
[Top] [All Lists]

RE: [xsl] Eliminating leading zeros

2006-08-21 07:50:56
You may be interested that Saxon has a sort option

collation="http://saxon.sf.net/collation?alphanumeric=yes

which sorts "5 (supl.)" before "10 (supl.)"

Further info at
http://www.saxonica.com/documentation/extensibility/collation.html

Michael Kay
http://www.saxonica.com/





-----Original Message-----
From: Mark Wilson [mailto:drmark(_at_)TLCdelivers(_dot_)com] 
Sent: 21 August 2006 14:25
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: Re: [xsl] Eliminating leading zeros

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(_at_)nag(_dot_)co(_dot_)uk>
To: <xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com>
Sent: Monday, August 21, 2006 7:56 AM
Subject: Re: [xsl] Eliminating leading zeros



number(.)

David


--~------------------------------------------------------------------
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>
--~-- 


--~------------------------------------------------------------------
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>
--~--



--~------------------------------------------------------------------
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>