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 29934 - fn-parse-json-110 expects wrong result
Summary: fn-parse-json-110 expects 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-10-11 19:32 UTC by Josh Spiegel
Modified: 2016-10-21 10:08 UTC (History)
2 users (show)

See Also:


Attachments

Description Josh Spiegel 2016-10-11 19:32:58 UTC
<test-case name="fn-parse-json-110" xmlns="http://www.w3.org/2010/09/qt-fots-catalog">
  <created by="Michael Kay" on="2016-09-29"/>
  <test><![CDATA[parse-json('{"'||codepoints-to-string((10, 37))||'":"x", "\n%":"y"}', map{'escape':true(), 'duplicates':'reject'})]]></test>
  <result>
    <error code="FOJS0003"/>
  </result>
</test-case>

The input to parse-json is not a valid JSON text.  From RFC7159:

<quote>
All Unicode characters may be placed within the
quotation marks, except for the characters that must be escaped:
quotation mark, reverse solidus, and the control characters (U+0000
through U+001F).
</quote>

Therefore, passing a naked control character should raise FOJS0001.
Comment 1 Andrew Coleman 2016-10-21 07:20:13 UTC
The WG agreed the following resolution:

ACTION A-657-15: O'Neil to fix the tests mentioned in this bug report, fn-parse-json-110, bug 29934
Comment 2 Michael Kay 2016-10-21 10:08:20 UTC
I have split the test into two, one testing for duplicates with the original intent, and one testing that raw control characters are rejected.