W3C home > Mailing lists > Public > public-qt-comments@w3.org > August 2015

[Bug 28995] json-to-xml-012 and json-doc-012 should not expect quotation marks (0x22) to be escaped

From: <nobody@w3.org>
Date: Fri, 07 Aug 2015 19:36:36 +0000
To: public-qt-comments@w3.org
Message-ID: <bug-28995-523-XXdOqq2n3t@http.www.w3.org/Bugs/Public/>
https://www.w3.org/Bugs/Public/show_bug.cgi?id=28995

Josh Spiegel <josh.spiegel@oracle.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |---

--- Comment #2 from Josh Spiegel <josh.spiegel@oracle.com> ---

Could you explain why you think the result of xml-to-json-017 was wrong?  Here
is the test:

   xml-to-json(json-to-xml('"\\\/\"\r\t\n\u0020"'))

The expected result was:

   <assert-eq>'"\\/\"\r\t\n "'</assert-eq>

And you changed it to:

   <assert-eq>'"\\/"\r\t\n "'</assert-eq>

Here is my thinking:

json-to-xml has a default escape value of false, so the XDM string will not
have a JSON escape for the quotation mark.  The XML serialized result of
json-to-xml('"\\\/\"\r\t\n\u0020"') should look like this:

<fn:string xmlns:fn="http://www.w3.org/2005/xpath-functions">\/"&#13;   
 </fn:string>

Then xml-to-json will escape the string as described in bullet 2, b:
"any occurrence of quotation mark, backspace, form-feed, newline, carriage
return, or tab is replaced by \", \b, \f, \n, \r, or \t respectively;"

Which means the quotation mark should be escaped and the original result is
correct.  Am I missing anything?

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
Received on Friday, 7 August 2015 19:36:38 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 16:57:55 UTC