This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 29611 - xml-to-json-D-507 expects the wrong result
Summary: xml-to-json-D-507 expects the wrong result
Status: RESOLVED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XQuery 3 & XPath 3 Test Suite (show other bugs)
Version: Candidate Recommendation
Hardware: PC All
: P2 normal
Target Milestone: ---
Assignee: O'Neil Delpratt
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-05-05 21:52 UTC by Josh Spiegel
Modified: 2016-06-14 14:52 UTC (History)
1 user (show)

See Also:


Attachments

Description Josh Spiegel 2016-05-05 21:52:49 UTC
Here are the relevant inputs:

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

   <environment name="xml-to-json-D">
      <source role="." file="xml-to-json/xml-to-json-D.xsl">
        ...
      </source>
   </environment>

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

    <xsl:template name="t507">
        <xsl:variable name="in"><j:map><j:string key='\"' escaped-key=" true ">1</j:string><j:string key='\"' escaped-key=" false ">0</j:string></j:map></xsl:variable>
        <t><xsl:sequence select="xml-to-json($in)"/></t>
    </xsl:template>
    
    ...
 
Notice it expects:

    '{"\n":"1","\n":"2"}'

I think it should expect:

    '{"\"":"1","\\\"":"0"}'
Comment 1 Michael Kay 2016-06-14 14:52:22 UTC
This test has been updated.

(The previous version of the test was provisional while we debated the relevant rules in the specification.)