<?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>29373</bug_id>
          
          <creation_ts>2016-01-13 17:14:07 +0000</creation_ts>
          <short_desc>Missing error code when fn:serialize receives a QName method in no namespace</short_desc>
          <delta_ts>2016-03-22 09:50:56 +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>Candidate Recommendation</version>
          <rep_platform>PC</rep_platform>
          <op_sys>All</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="Josh Spiegel">josh.spiegel</reporter>
          <assigned_to name="Michael Kay">mike</assigned_to>
          <cc>andrew_coleman</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>124580</commentid>
    <comment_count>0</comment_count>
    <who name="Josh Spiegel">josh.spiegel</who>
    <bug_when>2016-01-13 17:14:07 +0000</bug_when>
    <thetext>Consider test serialize-xml-120

 &lt;test-case name=&quot;serialize-xml-120&quot; covers=&quot;fn-serialize&quot;&gt;
   ...
   &lt;test&gt;let $params := map { QName(&quot;&quot;,&quot;indent&quot;) : true() }
         return serialize(., $params)
   &lt;/test&gt;
   &lt;result&gt;
     &lt;error code=&quot;SEPM0017&quot;/&gt; 
   &lt;/result&gt;
 &lt;/test-case&gt;

SEPM0017 should not be expected in this case.  From SER31:

  https://www.w3.org/TR/2015/CR-xslt-xquery-serialization-31-20151217/
  &quot;If in any case evaluating this expression would yield an error, serialization error [err:SEPM0017] results.&quot;

&quot;expression&quot; refers to query that validates a serialization document and there is no serialization document used in this case.

But I don&apos;t think the specification says which error code should be raised. 
http://www.w3.org/XML/Group/qtspecs/specifications/xpath-functions-31/html/#func-serialize

&quot;The key of the entry is an xs:string value in the cases of parameter names defined in these specifications, or an xs:QName (with non-absent namespace) in the case of implementation-defined serialization parameters.&quot;

Then the table has a note:

&quot;If an xs:QName is supplied, then it must have a non-absent namespace URI. This means that system-defined serialization methods such as xml and json are defined as strings, not as xs:QName values.&quot;

One could argue that this falls under SEPM0016 but I think the definition should clarify this.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>125389</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2016-03-08 20:21:35 +0000</bug_when>
    <thetext>I have been asked to propose a resolution.

Note 1 beneath the table refers to the entries in the table that reference Note 1, that is, the values of the method and json-node-output-method parameters. It is therefore not relevant to this test case. The Note should be clarified to avoid any misunderstanding on this point. 

I believe that this test case should not be an error. The spec says that &quot;The option parameter conventions apply&quot;, and these conventions state that option keys that are not recognized are ignored. The thinking here is that an implementation can look in the map for the keys it knows how to handle, it does not have to enumerate all the keys in the map and check that each one is recognized. An implementation shouldn&apos;t be looking for QName(&quot;&quot;, &quot;indent&quot;) and should therefore ignore it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>125564</commentid>
    <comment_count>2</comment_count>
    <who name="Andrew Coleman">andrew_coleman</who>
    <bug_when>2016-03-18 14:53:01 +0000</bug_when>
    <thetext>At the meeting on 2016-03-15, the WG agreed to adopt the resolution proposed in comment 1</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>125584</commentid>
    <comment_count>3</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2016-03-22 09:50:56 +0000</bug_when>
    <thetext>In closing this, I thought it would be useful to have an example of how to set serialization parameters using a map. The existing example

The expression fn:serialize($data, map{}) returns &apos;&lt;a b=&quot;3&quot;/&gt;&apos;.

is rather trivial. So I have changed it to

fn:serialize($data, map{&quot;method&quot;:&quot;xml&quot;, &quot;omit-xml-declaration&quot;:true()})

but with the observation that neither of these parameters is necessary, because they correspond to the defaults.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>