<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>27156</bug_id>
          
          <creation_ts>2014-10-24 16:41:34 +0000</creation_ts>
          <short_desc>fn:parse-json</short_desc>
          <delta_ts>2014-11-17 10:37:04 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>XPath / XQuery / XSLT</product>
          <component>Functions and Operators 3.1</component>
          <version>Working drafts</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows NT</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Christian Gruen">christian.gruen</reporter>
          <assigned_to name="Michael Kay">mike</assigned_to>
          <cc>andrew_coleman</cc>
    
    <cc>cmsmcq</cc>
    
    <cc>jonathan.robie</cc>
          
          <qa_contact name="Mailing list for public feedback on specs from XSL and XML Query WGs">public-qt-comments</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>113712</commentid>
    <comment_count>0</comment_count>
    <who name="Christian Gruen">christian.gruen</who>
    <bug_when>2014-10-24 16:41:34 +0000</bug_when>
    <thetext>I have two question on the specification of fn:parse-json (Working Draft, Oct 7):

* What is supposed to be the default value for the &quot;liberal&quot; option?

* If &quot;unescape&quot; is set to true, will invalid XML characters be replaced by xFFFD, or will an error be raised instead (FOJS0002)?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>114173</commentid>
    <comment_count>1</comment_count>
    <who name="C. M. Sperberg-McQueen">cmsmcq</who>
    <bug_when>2014-10-28 19:08:48 +0000</bug_when>
    <thetext>The description of errors says:

    A dynamic error [err:FOJS0001] occurs if the value of $input does not 
    conform to the JSON grammar, unless the option &quot;liberal&quot;:true() is 
    present and the processor chooses to accept the deviation.

I think that amounts to saying that the default value is false().</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>114174</commentid>
    <comment_count>2</comment_count>
    <who name="Jonathan Robie">jonathan.robie</who>
    <bug_when>2014-10-28 19:14:18 +0000</bug_when>
    <thetext>(In reply to Christian Gruen from comment #0)
&gt; I have two question on the specification of fn:parse-json (Working Draft,
&gt; Oct 7):
&gt; 
&gt; * What is supposed to be the default value for the &quot;liberal&quot; option?

The default must be False - see this error condition:

A dynamic error [err:FOJS0001] occurs if the value of $input does not conform to the JSON grammar, unless the option &quot;liberal&quot;:true() is present and the processor chooses to accept the deviation.

That should be stated explicitly in the table.

&gt; * If &quot;unescape&quot; is set to true, will invalid XML characters be replaced by
&gt; xFFFD, or will an error be raised instead (FOJS0002)?

This error seems to answer the question:

A dynamic error [err:FOJS0002] occurs if the value of $input contains an escaped representation of a character (or codepoint) that is not a valid character in the version of XML supported by the implementation, unless the unescape option is set to false.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>114175</commentid>
    <comment_count>3</comment_count>
    <who name="Jonathan Robie">jonathan.robie</who>
    <bug_when>2014-10-28 19:17:03 +0000</bug_when>
    <thetext>&gt; &gt; * If &quot;unescape&quot; is set to true, will invalid XML characters be replaced by
&gt; &gt; xFFFD, or will an error be raised instead (FOJS0002)?
&gt; 
&gt; This error seems to answer the question:
&gt; 
&gt; A dynamic error [err:FOJS0002] occurs if the value of $input contains an
&gt; escaped representation of a character (or codepoint) that is not a valid
&gt; character in the version of XML supported by the implementation, unless the
&gt; unescape option is set to false.

Ah, but the specification also says this:

If the input contains escape sequences representing characters or codepoints that are valid characters in the version of XML supported by the implementation, the escape sequence is replaced by the character(s) that it represents. If the input contains escape sequences representing characters or codepoints that are not valid characters in the version of XML supported by the implementation, the escape sequence is replaced by the Unicode replacement character (xFFFD).

So this seems to answer the question two different ways, and they contradict each other.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>114805</commentid>
    <comment_count>4</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2014-11-11 17:26:09 +0000</bug_when>
    <thetext>Also note that the table (first entry) says &quot;An error must be raised (TBA) &quot; - the TBS needs to be resolved</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>114931</commentid>
    <comment_count>5</comment_count>
    <who name="Andrew Coleman">andrew_coleman</who>
    <bug_when>2014-11-14 13:12:02 +0000</bug_when>
    <thetext>At the telecon on 2014-11-11, the WG agreed the following resolution to this bug...


DECISION: On encountering invalid escape sequences, use the Unicode 
replacement character.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>