This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
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"}'
This test has been updated. (The previous version of the test was provisional while we debated the relevant rules in the specification.)