Re: [xml] xpath number()/string() and locale



On Fri, Aug 06, 2004 at 04:11:36PM +0200, Lars Oppermann wrote:
With the string() function ultimately using snprintf() in order to 
format it's outoput it does not fullfill the requirement of representing 
a number in a language neutral form.
Also the scientific notation that might be generated from 
xmlXPathFormatNumber() is not allowed by the specification since it does 
not conform to 3.7[30]

I would rewrite the xmlXPathFormatNumber() in a way where it just dumps 
out the numbers according to xpath 3.7 and leave the rest to 
xslt:format-number. What do you think?

  That the XPath format-number() is one of the areas where I had
to trade conformance upon pressure from my user base which considered
the XPath limitation excessive. There have been a lot of discussions on
this topic:
  http://xmlsoft.org/search.php?query=format-number&scope=LISTS

  So there might be bugs, some are on-purpose, some may not be :-)
However I totally agree with you that the behaviour should not depend on
locales at all (this has been a problem in the past already), so yes
if you can make a clean patch implementing this that would be great, 
first make sure that with the patch applied all libxml2 and libxslt 
regression tests still pass. It would be great to still allow the
scientific notation because that limitation was really considered
excessive, but it makes your implementation harder.

Daniel

-- 
Daniel Veillard      | Red Hat Desktop team http://redhat.com/
veillard redhat com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]