Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries >Thread Prev - Sort money field with msxml >Thread Next - Re: Sort money field with msxml Re: Sort money field with msxmlTo: 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/ | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
