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


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:


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;   

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