Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Sort money field with msxml

From: Martin Honnen <mahotrash@-----.-->
To: NULL
Date: 6/5/2007 1:30:00 PM

hugo.calzada@g... wrote:
> I have the next xsl. This xsl try to sort a xml by a number
> field(impbas). But this number has spanish format, so it use comma
> instead of point (Ej.: 999,05 € not 999.05 €).
> When I use the msxml parser, the sorting doesn't works, but if I use
> the XMLSpy own parser, it works.


>                        <xsl:for-each select="/
> DisponibilidadHotelRespuesta/infhot">
>                                <xsl:sort data-type="number"
> select="impbas" order="ascending"/>


>        <infhot>
>                <nomser>HOTEL ROYAL PLAZA</nomser>
>                <impbas>777,6</impbas>
>        </infhot>

If you want to store numeric data in an XML document then you I strongly 
suggest to use the 777.6 floating point notation. Later, when you want 
to output the numbers you can always transform them to the desired 
format. But for computations or sorting you need the floating point 
notation.

If you really have 777,6 in your XML data then you need e.g.
   <xsl:sort data-type="number"
      select="number(translate(impbas, ',', '.'))" order="ascending"/>



-- 

	Martin Honnen --- MVP XML
	http://JavaScript.FAQTs.com/


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent