[xquery-talk] BumbleBee XQuery Test Harness

Jason Hunter jhunter at servlets.com
Wed Oct 15 22:52:19 PDT 2003


Michael Kay wrote:

>>Yes, some vendors serialize an xs:double without the .0 but 
>>http://www.w3.org/TR/xmlschema-2/#double says this is 
>>incorrect and the 
>>.0 is necessary.  In the 1.0.1 release we updated a few test results 
>>accordingly.
> 
> We've had great difficulty getting everyone to agree on the rules for
> converting doubles to strings, partly because it's hard to get people to
> focus their attention on something so trivial. In Saxon, I have stuck to
> the XPath 1.0 rules until now, partly because I didn't feel that the 2.0
> rules were stable yet and partly because they are unusable (e.g. in
> XSLT, chapters numbered 2.0e0). The WGs have now agreed the rules and
> they will appear in the next versions of the specs. In rough terms, the
> output will follow the XPath 1.0 rules for numbers in the range 1e-6 to
> 1e+6, but will use exponential notation outside that range.

Thanks for the clarification!  Here's the pertinent section from 
http://www.w3.org/TR/xpath:

"otherwise, the number is represented in decimal form as a Number 
including a decimal point with at least one digit before the decimal 
point and at least one digit after the decimal point, preceded by a 
minus sign (-) if the number is negative; there must be no leading zeros 
before the decimal point apart possibly from the one required digit 
immediately before the decimal point; beyond the one required digit 
after the decimal point there must be as many, but only as many, more 
digits as are needed to uniquely distinguish the number from all other 
IEEE 754 numeric values."

-jh-




More information about the talk mailing list