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 spec for json-to-xml() does not make it clear whether the JSON input 23e0 should generate <number>23</number> or <number>23e0</number> or something else. Two options that one could use are: (a) retain the JSON lexical form (b) convert the JSON lexical form to xs:double using string-to-double conversion, and then convert the xs:double to string The advantage of (a) is that there is never any loss of precision (there's nothing in JSON that limits the number of digits in a number). But the spec hints that (b) was intended, in that it mentions the rules for string-to-double conversion. Note however that in the reverse mapping, xml-to-json(), retaining the lexical form is not an option, because the lexical space of xs:double is a superset of the JSON number format (for example, JSON does not allow 015, or .12).
This was accepted by the WG on 10 Mar 2015, and has been applied to the spec. Specifically: json-to-xml() retains the lexical form of the number in the string value of the generated node (except when the XDM implementation reconstructs the string value from the typed value). xml-to-json()starts with the typed value of the node, or converts the string value to xs:double, and then outputs the result of casting this xs:double to xs:string.