<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>29435</bug_id>
          
          <creation_ts>2016-02-08 17:28:53 +0000</creation_ts>
          <short_desc>[ser3.1] JSON Serialization of numerics</short_desc>
          <delta_ts>2016-03-01 11:15:57 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>XPath / XQuery / XSLT</product>
          <component>Serialization 3.1</component>
          <version>Candidate Recommendation</version>
          <rep_platform>PC</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Michael Kay">mike</reporter>
          <assigned_to name="C. M. Sperberg-McQueen">cmsmcq</assigned_to>
          <cc>andrew_coleman</cc>
          
          <qa_contact name="Mailing list for public feedback on specs from XSL and XML Query WGs">public-qt-comments</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>124912</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2016-02-08 17:28:53 +0000</bug_when>
    <thetext>I parsed and then reserialized a JSON file containing records of the form:

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

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

{&quot;name&quot;:&quot;Gray County&quot;,&quot;coord&quot;:{&quot;lon&quot;:-100.802002,&quot;lat&quot;:35.416698},&quot;country&quot;:&quot;US&quot;,&quot;_id&quot;: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).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>125304</commentid>
    <comment_count>1</comment_count>
    <who name="Andrew Coleman">andrew_coleman</who>
    <bug_when>2016-03-01 11:15:57 +0000</bug_when>
    <thetext>The WG agreed to allow implementers to serialize numbers using any legal JSON lexical form.
The change has been applied to the spec.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>