Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: XSL and internationalisation

From: "Joe Fawcett" <joefawcett@---------.------>
To: NULL
Date: 4/4/2007 8:20:00 AM

I think the solution is to use the decimal point in your XML and in an XSLT 
you can use xsl:decimal-format element and the format-number function.

-- 

Joe Fawcett (MVP - XML)

http://joe.fawcett.name

"Mike May" <mikemay@b...> wrote in message 
news:clyQh.30985$_Q.4600@f......
>I am attempting some XSLT processing on a machine with German regional 
>settings.  The attached test case illustrates the problem.  German has 
>commas as decimal separators.  Excel and other applications respect comma 
>as the decimal separator.
>
> xml data-------------
> <?xml version="1.0" encoding="utf-8" ?>
>     <data>
>      <item>103,3</item>
>      <item>104,4</item>
> </data>
>
> xsl script---------------
> <?xml version="1.0" encoding="utf-8" ?>
>    <xsl:stylesheet version="1.0" 
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
>  <xsl:output encoding="utf-8" />
>      <xsl:template match="/">
>      <xsl:value-of select="sum(data/item)" />
>  </xsl:template>
> </xsl:stylesheet>
>
> msxsl outputs NaN for the above.
>
> It behaves correctly outputting 207.7 when I change the decimal separators 
> to '.'.
>
> Do I need to stipulate the decimal separator?
>
> Please help if you can?
>
> Regards
> Mike May
> 




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