This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: [XSL] How to order numeric data containing commas?



>Date: Mon, 7 May 2001 10:35:05 -0400 
>From: Peter Tsantes <PTsantes@Tradescape.com>
>Subject: [xsl] [XSL] How to order numeric data containing commas?
>
>I am having a problem ordering numbers that contain commas. I'm using XSL;
>so I can't define the data type in <sort>.
>I tried to use the namespace 
>
>xmlns:dt="urn:schemas-microsoft-com:datatypes" 
>xmlns="urn:schemas-microsoft-com:xml-data"
>
>and choose datatypes that allow punctuation, but no luck.
>
>Does anyone know how to get a numbers that contain commas to order properly
>in XSL.

Hi,
sort them as if they would contain points:

<xsl:apply-templates select= .. the nodes containing the numbers ..>
   <xsl:sort select="translate(., ',', '.')" data-type="number"/>
</xsl:apply-templates>

Ciao, Ingo

Ingo Schildmann                                  ingoschi@web.de

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]