<?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>29611</bug_id>
          
          <creation_ts>2016-05-05 21:52:49 +0000</creation_ts>
          <short_desc>xml-to-json-D-507 expects the wrong result</short_desc>
          <delta_ts>2016-06-14 14:52:22 +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>XQuery 3 &amp; XPath 3 Test Suite</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="Josh Spiegel">josh.spiegel</reporter>
          <assigned_to name="O&apos;Neil Delpratt">oneil</assigned_to>
          <cc>mike</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>126356</commentid>
    <comment_count>0</comment_count>
    <who name="Josh Spiegel">josh.spiegel</who>
    <bug_when>2016-05-05 21:52:49 +0000</bug_when>
    <thetext>Here are the relevant inputs:

   &lt;test-case name=&quot;xml-to-json-D-507&quot;&gt;
      &lt;description&gt;Valid input - maps&lt;/description&gt;
      &lt;created by=&quot;Michael Kay&quot; on=&quot;2016-04-22&quot;/&gt;
      &lt;environment ref=&quot;xml-to-json-D&quot;/&gt;
      &lt;dependency type=&quot;spec&quot; value=&quot;XP31+ XQ31+&quot;/&gt;
      &lt;test&gt;xml-to-json(//*:template[@name=&quot;t507&quot;]/*:variable/*)&lt;/test&gt;
      &lt;result&gt;
         &lt;assert-eq&gt;&apos;{&quot;\n&quot;:&quot;1&quot;,&quot;\n&quot;:&quot;2&quot;}&apos;&lt;/assert-eq&gt;
      &lt;/result&gt;
   &lt;/test-case&gt;

   &lt;environment name=&quot;xml-to-json-D&quot;&gt;
      &lt;source role=&quot;.&quot; file=&quot;xml-to-json/xml-to-json-D.xsl&quot;&gt;
        ...
      &lt;/source&gt;
   &lt;/environment&gt;

xml-to-json/xml-to-json-D.xsl
    ...

    &lt;xsl:template name=&quot;t507&quot;&gt;
        &lt;xsl:variable name=&quot;in&quot;&gt;&lt;j:map&gt;&lt;j:string key=&apos;\&quot;&apos; escaped-key=&quot; true &quot;&gt;1&lt;/j:string&gt;&lt;j:string key=&apos;\&quot;&apos; escaped-key=&quot; false &quot;&gt;0&lt;/j:string&gt;&lt;/j:map&gt;&lt;/xsl:variable&gt;
        &lt;t&gt;&lt;xsl:sequence select=&quot;xml-to-json($in)&quot;/&gt;&lt;/t&gt;
    &lt;/xsl:template&gt;
    
    ...
 
Notice it expects:

    &apos;{&quot;\n&quot;:&quot;1&quot;,&quot;\n&quot;:&quot;2&quot;}&apos;

I think it should expect:

    &apos;{&quot;\&quot;&quot;:&quot;1&quot;,&quot;\\\&quot;&quot;:&quot;0&quot;}&apos;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>126758</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2016-06-14 14:52:22 +0000</bug_when>
    <thetext>This test has been updated.

(The previous version of the test was provisional while we debated the relevant rules in the specification.)</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>