This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
The XPath/XQuery grammar allows numeric literals to have a leading or trailing decimal point, for example 2. + .5 is a valid query that returns 2.5 XPath/XQuery defines the semantics of a numeric literal by reference to the rules for casting from string to number. The rules for casting from string to number are defined in terms of the XSD-defined mapping from lexical space to value space. But in XSD, the lexical space for xs:decimal, xs:double, and xs:float does not allow a leading or trailing decimal point. For example, XPath defines decimal-literal with the pattern ("." [0-9]+) | ([0-9]+ "." [0-9]*) while XSD 1.1 defines the lexical space of xs:decimal as (\+|-)?([0-9]+(\.[0-9]*)?|\.[0-9]+)
Bug withdrawn. I drew the wrong conclusions from an error I was seeing. JSON does not allow a leading or trailing "." in a number, but XSD does. The xml-to-json() function therefore should accept <j:number>.1</j:number> and must convert it to the JSON output "0.1".