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 27371 - Tests like Serialization-009 should allow the error to be raised during evaluation
Summary: Tests like Serialization-009 should allow the error to be raised during evalu...
Status: RESOLVED WORKSFORME
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XQuery 3 & XPath 3 Test Suite (show other bugs)
Version: Working drafts
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: 2014-11-19 19:01 UTC by Josh Spiegel
Modified: 2014-11-19 22:10 UTC (History)
1 user (show)

See Also:


Attachments

Description Josh Spiegel 2014-11-19 19:01:07 UTC
<test-case name="Serialization-009" xmlns="http://www.w3.org/2010/09/qt-fots-catalog">
      <description> 
         It is a serialization error [err:SEPM0016] if a parameter value is invalid for the given parameter. 
         Wrong serialization parameter value for doctype-public.
      </description>
      <created by="Dennis Knochenwefel" on="2011-12-05"/>
      <dependency type="spec" value="XQ30+"/>
      <test><![CDATA[declare namespace output = "http://www.w3.org/2010/xslt-xquery-serialization";
         declare option output:doctype-public "&#xc381;";
         <result>ok</result>
      ]]></test>
      <result>
        <any-of>
           <!-- 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. -->
           <assert-xml><![CDATA[<result>ok</result>]]></assert-xml>     

           <!-- It is a serialization error [err:SEPM0016] if a parameter value is invalid for the given parameter. -->
           <assert-serialization-error code="SEPM0016"/>
         </any-of>
      </result>
 </test-case>

This test uses assert-serialization-error to test for SEPM0016.  Here is the definition of assert-serialization-error:
    
  "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)."

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:

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

So I would like to add an alternate result:

  <error code="SEPM0016"/>

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
Comment 1 Michael Kay 2014-11-19 21:43:16 UTC
I don't know what makes you think that serialization errors can't be reported "during evaluation". 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'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't, the error won't occur). Apart from that, the error can be detected in exactly the same way as <error code="xx">. So I can't see any possible value in adding an alternative result.
Comment 2 Josh Spiegel 2014-11-19 22:10:35 UTC
"Asserts that the query can be executed without error ..."  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!