<?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>28486</bug_id>
          
          <creation_ts>2015-04-14 08:47:10 +0000</creation_ts>
          <short_desc>[XQ 3.1] Lexical form of serialization parameters</short_desc>
          <delta_ts>2015-07-09 22:12:33 +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.1</component>
          <version>Last Call drafts</version>
          <rep_platform>PC</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</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="Michael Kay">mike</reporter>
          <assigned_to name="Jonathan Robie">jonathan.robie</assigned_to>
          <cc>josh.spiegel</cc>
    
    <cc>tim</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>119486</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2015-04-14 08:47:10 +0000</bug_when>
    <thetext>XQuery section 2.2.4 defines XQuery serialization parameters (&quot;declare output&quot;) by reference to Serialization section 3.

But serialization section 3 describes only the value space of these parameters, not their lexical form. It&apos;s up to the host language to specify the lexical form, but it fails to do so.

For example, a number of serialization parameters are defined to contain (one or more) expanded QNames. (method, cdata-section-elements, suppress-indentation, json-node-output-method). The term &quot;expanded QName&quot; links (indirectly) to the definition in XPath 3.1. The definition of &quot;expanded QName&quot; describes the value space, not the lexical representation.

So it&apos;s unclear how expanded QNames are actually written in the declare output declaration.  There needs to be a statement that a QName can be written as an EQName; there should also be a statement about the default namespace that is used when a name is written as a simple NCName (it should be the default namespace for elements and types).

The problem applies to all serialization parameters, but it is particularly acute for those containing QNames.

Another aspect of the lexical representation that is left underspecified is boundary whitespace: it should say that for list-valued parameters such as suppress-indentation that the list is whitespace-separated, and for all parameters, it should say that leading and trailing whitespace is trimmed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>119487</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2015-04-14 09:05:19 +0000</bug_when>
    <thetext>A particular issue with the parameters &quot;method&quot; and &quot;json-node-output-method&quot;: there should be no default namespace for these. Method &quot;xml&quot; should mean &quot;xml&quot;, not &quot;xml&quot; in the default namespace for elements and types.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>119496</commentid>
    <comment_count>2</comment_count>
    <who name="Josh Spiegel">josh.spiegel</who>
    <bug_when>2015-04-14 14:39:13 +0000</bug_when>
    <thetext>As I recall, the WG previously decided that the lexical space is defined by the schema for serialization parameters.  

In 2.2.4:

&quot;Except for parameter-document, each option corresponds to a serialization parameter element defined in Section B Schema for Serialization Parameters SER31. The name of each option is the same as the name of the corresponding serialization parameter element, and the values permitted for each option are the same as the values allowed in the serialization parameter element.&quot;

For example, I think the intent is that the lexical space for &quot;method&quot; is that of &quot;method-type&quot; in the schema for serialization parameters. 

See comments 10, 11, and 12 on bug 15390.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>119497</commentid>
    <comment_count>3</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2015-04-14 14:55:52 +0000</bug_when>
    <thetext>Thanks for the reference.

Comments 12 on bug 15390 concerns the namespace context for resolving QNames, and appears to be unanswered.

In my view using the default namespace for elements and types to resolve the method name &quot;xml&quot; would be horribly confusing.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>119498</commentid>
    <comment_count>4</comment_count>
    <who name="Josh Spiegel">josh.spiegel</who>
    <bug_when>2015-04-14 15:10:55 +0000</bug_when>
    <thetext>If the value for &quot;method&quot; is &quot;xml&quot;, it would be a string - not a QName (recall &quot;method-type&quot; is a union).  The part in comment 12 about using the default element/type namespace relevant for parameters like cdata-section-element.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>119532</commentid>
    <comment_count>5</comment_count>
    <who name="Tim Mills">tim</who>
    <bug_when>2015-04-15 13:31:39 +0000</bug_when>
    <thetext>
&gt; So it&apos;s unclear how expanded QNames are actually written in the declare
&gt; output declaration.  There needs to be a statement that a QName can be
&gt; written as an EQName; there should also be a statement about the default
&gt; namespace that is used when a name is written as a simple NCName (it should
&gt; be the default namespace for elements and types).

Our implementation does NOT use the default element/type namespace for

        declare option output:method
        declare option output:cdata-section-elements
        declare option output:suppress-indentation

and so we think that your assertion &quot;it should be the default namespace for elements and types&quot; is up for debate.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>119533</commentid>
    <comment_count>6</comment_count>
    <who name="Josh Spiegel">josh.spiegel</who>
    <bug_when>2015-04-15 13:54:50 +0000</bug_when>
    <thetext>Consider this query:

  declare default element namespace &quot;http://example.org&quot;;
  declare option output:method &quot;xml&quot;
  declare option output:cdata-section-elements &quot;foo&quot;;

  &lt;foo&gt;bar&lt;/foo&gt;

I think the least surprising serialization is:

  &lt;foo xmlns=&quot;http://example.org&quot;&gt;&lt;![CDATA[bar]]&gt;&lt;/foo&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>119536</commentid>
    <comment_count>7</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2015-04-15 14:59:12 +0000</bug_when>
    <thetext>Certainly XSLT has always had the rule that for &lt;xsl:output cdata-section-elements=&quot;foo&quot;/&gt;, the default namespace applies. (XSLT of course distinguishes the default namespace for input elements and that for output elements).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>120268</commentid>
    <comment_count>8</comment_count>
    <who name="Jonathan Robie">jonathan.robie</who>
    <bug_when>2015-05-12 16:13:58 +0000</bug_when>
    <thetext>The specification currently says this:

&lt;quote&gt;
Except for parameter-document, each option corresponds to a serialization parameter element defined in Section B Schema for Serialization Parameters SER31. The name of each option is the same as the name of the corresponding serialization parameter element, and the values permitted for each option are the same as the values allowed in the serialization parameter element.
&lt;/quote&gt;

This needs to be extended to say that the namespace context is the set of statically known namespaces and to allow EQNames.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>120269</commentid>
    <comment_count>9</comment_count>
    <who name="Jonathan Robie">jonathan.robie</who>
    <bug_when>2015-05-12 16:14:55 +0000</bug_when>
    <thetext>The Working Group decided to accept comment #8 as the resolution of this issue.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>121794</commentid>
    <comment_count>10</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2015-07-06 09:24:31 +0000</bug_when>
    <thetext>This change has not been applied in the current draft.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>121919</commentid>
    <comment_count>11</comment_count>
    <who name="Josh Spiegel">josh.spiegel</who>
    <bug_when>2015-07-09 16:49:20 +0000</bug_when>
    <thetext>I think the decision needs to be extended such that the default element/type namespace is used in cases where the QName has no prefix.  e.g.

&quot;For QName values, the EQName syntax is allowed and prefixes are
expanded to namespace URIs by means of the statically known namespaces, or 
if unprefixed, the default element/type namespace&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>121928</commentid>
    <comment_count>12</comment_count>
    <who name="Jonathan Robie">jonathan.robie</who>
    <bug_when>2015-07-09 22:12:33 +0000</bug_when>
    <thetext>Fixed using Josh&apos;s proposed wording.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>