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

Subject: Re:[xsl] [XSL] How to order numeric data containing commas?
From: ingoschi@xxxxxx
Date: Mon, 7 May 2001 20:57:01 +0200
>Date: Mon, 7 May 2001 10:35:05 -0400 
>From: Peter Tsantes <PTsantes@xxxxxxxxxxxxxx>
>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@xxxxxx

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


Current Thread