<?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>29940</bug_id>
          
          <creation_ts>2016-10-18 08:41:23 +0000</creation_ts>
          <short_desc>[FO31] fn:transform serialization parameters</short_desc>
          <delta_ts>2016-12-16 19:55:32 +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>Windows NT</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="Tim Mills">tim</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>127818</commentid>
    <comment_count>0</comment_count>
    <who name="Tim Mills">tim</who>
    <bug_when>2016-10-18 08:41:23 +0000</bug_when>
    <thetext>The description of option serialization-parameters reads:

&quot;Serialization parameters for the principal result document. Any values supplied here override values specified in an xsl:output declaration in the stylesheet. These values have no effect on the serialization of secondary result documents. Default is an empty map. Standard parameters such as method and indent are supplied as QNames in no namespace.&quot;

It&apos;s not clear whether the parameters replace or augment those specified in the XSLT.  e.g. if an xsl:output element specifies indent=&quot;yes&quot; and an empty serialization parameters map is specified, does indent=&quot;yes&quot; still hold?  How about character maps or cdata-section-elements?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>127820</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2016-10-18 09:43:56 +0000</bug_when>
    <thetext>The intent is that it should follow the same semantics as all the other mechanisms for overriding serialization parameters, e.g.

* multiple xsl:output declarations with different precedence

* parameter documents overriding xsl:output

* xsl:result-document overriding xsl:output

* API parameters overriding parameters within the stylesheet

These are all designed to work the same way:

- if a parameter is present then it overrides the underlying parameter, except for cdata-section-elements and suppress-indentation where it supplements it

- if a parameter is absent then the underlying value is unchanged

I guess it would be useful to have all these rules in one place and to be able to refer to them by name - but we can&apos;t do that for XSLT 1.0 and 2.0.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>127838</commentid>
    <comment_count>2</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2016-10-18 15:56:08 +0000</bug_when>
    <thetext>Agreed that it would be useful to have a slightly less terse explanation in the spec of how this is supposed to work.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>127847</commentid>
    <comment_count>3</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2016-10-19 08:46:56 +0000</bug_when>
    <thetext>Taking into account also bug #29943, I have replaced the entry for serialization-params in the fn:transform table with:

Serialization parameters for the principal result document. The supplied map follows the same rules that apply to a map supplied as the second argument of &lt;code&gt;fn:serialize&lt;/code&gt;. When a parameter is not supplied (that is, when the key is absent or when the corresponding value is an empty sequence) the value used is the value specified in the unnamed &lt;code&gt;xsl:output&lt;/code&gt; declaration, or its default. When a parameter is supplied, the corresponding value overrides or augments the value specified in the unnamed &lt;code&gt;xsl:output&lt;/code&gt; declaration (or its default), following the same rules as when one &lt;code&gt;xsl:output&lt;/code&gt; declaration overrides another with lower import precedence.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>127849</commentid>
    <comment_count>4</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2016-10-19 09:26:30 +0000</bug_when>
    <thetext>A slight refinement.

In the serialization parameters, map { &quot;standalone&quot;: () } means that no standalone attribute should be written to the XML declaration. We need this setting to be able to override a stylesheet declaration like &lt;xsl:output standalone=&quot;yes&quot;/&gt;.

Therefore, I think we should treat a parameter that is present with a value of () as an override of a value specified in xsl:output, rather than ignoring it as proposed in comment #3.

I&apos;m leaving the bug open so that the resolution can be reviewed by the WG. The text now reads:

Serialization parameters for the principal result document. The supplied map follows the same rules that apply to a map supplied as the second argument of &lt;code&gt;fn:serialize&lt;/code&gt;. When a parameter is supplied, the corresponding value overrides or augments the value specified in the unnamed &lt;code&gt;xsl:output&lt;/code&gt; declaration (or its default), following the same rules as when one &lt;code&gt;xsl:output&lt;/code&gt; declaration overrides another with lower import precedence.
When a parameter is supplied and the corresponding value is an empty sequence (for example, &lt;code&gt;map{&quot;standalone&quot;:()}&lt;/code&gt;, any value specified in the unnamed &lt;code&gt;xsl:output&lt;/code&gt; declaration is overridden by the default value.  When a parameter is not supplied in &lt;code&gt;serialization-params&lt;/code&gt; (that is, when the key is absent) the value that applies is the value appearing in the unnamed &lt;code&gt;xsl:output&lt;/code&gt; declaration, or its default.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>127957</commentid>
    <comment_count>5</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2016-10-25 15:25:05 +0000</bug_when>
    <thetext>The proposal was accepted.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>127962</commentid>
    <comment_count>6</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2016-10-26 09:40:37 +0000</bug_when>
    <thetext>The changes have been applied to the spec.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>