You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by "Sergei S. Ivanov" <iv...@aha.ru> on 2000/07/06 12:24:08 UTC

Number localization in XPath 'string()' function

Hello, all

It seems that when converting floating point numbers to strings, the
'string' function applies current locale settings. I.e. evaluating the
following rule in my environment (with Russian regional settings)
   <xsl:value-of select="string(number('10.21332'))"/>
I got:
  10,21332 <!-- note the comma instead of period! -->
Looking at org.apache.xalan.xpath.XNumber.str() function it proves that the
implementation uses the default DecimalFormat, dependent on the current
system locale.
After the careful examination of W3C XPath recommendation I tend to think
that XPath string() function behaves erroneously.

Looking forward for your comments,
--
Sergei S. Ivanov  sergei_ivanov@object-tools.com
Object Tools, Moscow  http://www.object-tools.com