<?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>27371</bug_id>
          
          <creation_ts>2014-11-19 19:01:07 +0000</creation_ts>
          <short_desc>Tests like Serialization-009 should allow the error to be raised during evaluation</short_desc>
          <delta_ts>2014-11-19 22:10:35 +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>XQuery 3 &amp; XPath 3 Test Suite</component>
          <version>Working drafts</version>
          <rep_platform>PC</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WORKSFORME</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="Josh Spiegel">josh.spiegel</reporter>
          <assigned_to name="O&apos;Neil Delpratt">oneil</assigned_to>
          <cc>mike</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>115139</commentid>
    <comment_count>0</comment_count>
    <who name="Josh Spiegel">josh.spiegel</who>
    <bug_when>2014-11-19 19:01:07 +0000</bug_when>
    <thetext>&lt;test-case name=&quot;Serialization-009&quot; xmlns=&quot;http://www.w3.org/2010/09/qt-fots-catalog&quot;&gt;
      &lt;description&gt; 
         It is a serialization error [err:SEPM0016] if a parameter value is invalid for the given parameter. 
         Wrong serialization parameter value for doctype-public.
      &lt;/description&gt;
      &lt;created by=&quot;Dennis Knochenwefel&quot; on=&quot;2011-12-05&quot;/&gt;
      &lt;dependency type=&quot;spec&quot; value=&quot;XQ30+&quot;/&gt;
      &lt;test&gt;&lt;![CDATA[declare namespace output = &quot;http://www.w3.org/2010/xslt-xquery-serialization&quot;;
         declare option output:doctype-public &quot;&amp;#xc381;&quot;;
         &lt;result&gt;ok&lt;/result&gt;
      ]]&gt;&lt;/test&gt;
      &lt;result&gt;
        &lt;any-of&gt;
           &lt;!-- the processor may use these parameters to control the way in which the serialization takes place.
                It is the responsibility of the host language to specify how invalid values should be handled at the level of that language. --&gt;
           &lt;assert-xml&gt;&lt;![CDATA[&lt;result&gt;ok&lt;/result&gt;]]&gt;&lt;/assert-xml&gt;     

           &lt;!-- It is a serialization error [err:SEPM0016] if a parameter value is invalid for the given parameter. --&gt;
           &lt;assert-serialization-error code=&quot;SEPM0016&quot;/&gt;
         &lt;/any-of&gt;
      &lt;/result&gt;
 &lt;/test-case&gt;

This test uses assert-serialization-error to test for SEPM0016.  Here is the definition of assert-serialization-error:
    
  &quot;Asserts that the query can be executed without error, but serializing the result
  produces a serialization error.
  The result of the query must be serialized using the serialization
  options specified within the query (if any).&quot;

I think in this case, the test should also allow the error to be thrown during expression processing. From XQuery 3.0, 2.4.4:

  &quot;A processor that is not performing serialization may report errors if any 
  serialization parameters are incorrect, or may ignore such parameters.&quot;

So I would like to add an alternate result:

  &lt;error code=&quot;SEPM0016&quot;/&gt;

And I would like to make the same type of fix to the following tests as well:

  Serialization-010
  Serialization-011
  Serialization-012
  Serialization-015
  Serialization-017
  Serialization-018
  Serialization-019
  Serialization-020
  Serialization-024
  Serialization-025</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>115141</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2014-11-19 21:43:16 +0000</bug_when>
    <thetext>I don&apos;t know what makes you think that serialization errors can&apos;t be reported &quot;during evaluation&quot;. It only says that the query CAN BE executed without error (i.e. that there is no error if the result is not serialized), it doesn&apos;t say that the query IS executed without error.

The use of assert-serialization-error tells the test driver that serialization must be attempted (because if it isn&apos;t, the error won&apos;t occur). Apart from that, the error can be detected in exactly the same way as &lt;error code=&quot;xx&quot;&gt;. So I can&apos;t see any possible value in adding an alternative result.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>115148</commentid>
    <comment_count>2</comment_count>
    <who name="Josh Spiegel">josh.spiegel</who>
    <bug_when>2014-11-19 22:10:35 +0000</bug_when>
    <thetext>&quot;Asserts that the query can be executed without error ...&quot;  I thought this means that it ensures the query can be executed without error.

But this is apparently not the meaning you intended.  Thanks for the  clarification!</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>