[Bug 29435] New: [ser3.1] JSON Serialization of numerics

https://www.w3.org/Bugs/Public/show_bug.cgi?id=29435

            Bug ID: 29435
           Summary: [ser3.1] JSON Serialization of numerics
           Product: XPath / XQuery / XSLT
           Version: Candidate Recommendation
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Serialization 3.1
          Assignee: cmsmcq@blackmesatech.com
          Reporter: mike@saxonica.com
        QA Contact: public-qt-comments@w3.org
  Target Milestone: ---

I parsed and then reserialized a JSON file containing records of the form:

{"_id":5285039,"name":"Black Bear
Spring","country":"US","coord":{"lon":-110.288139,"lat":31.386209}}

The serialized form of the record (well, a similar record...) looks like this:

{"name":"Gray
County","coord":{"lon":-100.802002,"lat":35.416698},"country":"US","_id":5.52243E6},

Turning a 7-digit ID value into exponential notation seems unfortunate, but it
appears to be what our spec requires.

I wonder if we could change the rules so that a numeric value that is exactly
equal to some integer Z is serialized by casting to xs:integer and then
applying the string() function to the integer? At the very least we should
permit such a serialization.

(Perhaps only if the integer is within some implementation-defined range not
smaller than -10^15 to +10^15).

-- 
You are receiving this mail because:
You are the QA Contact for the bug.

Received on Monday, 8 February 2016 17:28:56 UTC