<?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>30315</bug_id>
          
          <creation_ts>2018-11-04 00:49:10 +0000</creation_ts>
          <short_desc>[FO31] fn:serialize error conditions incomplete and unclear</short_desc>
          <delta_ts>2018-11-04 00:49:10 +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>Recommendation</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows NT</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></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="Abel Braaksma">abel.online</reporter>
          <assigned_to name="Michael Kay">mike</assigned_to>
          
          
          <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>129381</commentid>
    <comment_count>0</comment_count>
    <who name="Abel Braaksma">abel.online</who>
    <bug_when>2018-11-04 00:49:10 +0000</bug_when>
    <thetext>The text for fn:serialize says:

&quot;The serialization process will raise an error if $arg is an attribute or 
namespace node.&quot;

It fails to include what error that is and it if it mentions these un-serializable types, it stands to reason that the text should also mean that a function item, map or array will lead to a serialization error (or if not: how should they be treated?). Reasonably, SENR0001 or XPTY0004 could be raised.

The tests serialize-xml-002, seralize-xml-010 - 012 all expect error SENR0001, but the text above says &quot;an error&quot;. Could we perhaps rephrase it to point to the corresponding error in the SER31 spec?

The last sentence in the Error section is:

&quot;If any serialization error occurs, including the detection of an invalid value for a serialization parameter as described above, this results in the fn:serialize call failing with a dynamic error.&quot;

This makes the earlier sentence rather redundant. Also, I&apos;d argue that perhaps this should point out that &quot;a dynamic error&quot; is an error from the SER31. Unless this is intended to be implemention-defined/dependent, in which case I think we should say so. The tests expect specific errors.

My suggestion for a fix would be something like (replace both statements with one):

&quot;The serialization process will raise an error if $arg is an attribute or 
namespace node, or if it is a function item [SENR0001]. If any other serialization error occurs during the serialization process as described in [SER31], that error is propagated in an implementation-dependent way and the fn:serialize call will fail with a dynamic error.&quot;


This would leave it sufficiently open (as not to violate the current status of &quot;an error&quot;) while strongly suggesting to use the serialization error codes (which leads to better interoperability).</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>