<?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>26766</bug_id>
          
          <creation_ts>2014-09-09 23:10:45 +0000</creation_ts>
          <short_desc>[XSLT30] xsl:merge implementation issues, error conditions and non-streaming behavior</short_desc>
          <delta_ts>2014-09-12 09:57:53 +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>XSLT 3.0</component>
          <version>Last Call drafts</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="Abel Braaksma">abel.braaksma</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>111304</commentid>
    <comment_count>0</comment_count>
    <who name="Abel Braaksma">abel.braaksma</who>
    <bug_when>2014-09-09 23:10:45 +0000</bug_when>
    <thetext>The first two following questions were originally reported to me by my programmer, Eugene Fotin.

While implementing the new xsl:merge syntax, we stumbled upon the following questions, to which I believe the specification has no clear answer:

&gt; what error should be raised if both @for-each-stream and @for-each-item are present? 

I think that, in line with similar constructs that have mutual exclusive attributes, we should introduce a specific static error condition for this.

&gt; what to do when @for-each-stream is present and streamable=&quot;no&quot;
&gt; is absent?

From the current text, the semantics of for-each-stream are described in terms of streamability. I think that in the case of the effective value of streamable=&quot;no&quot;, the behavior should be similar to the fn:collection function (except that its arguments do not return collections, the behavior is more like fn:document), i.e., whether or not it is stable is implementation dependent. If we mean that, I think we should say so explicitly.

&gt; the type of @for-each-stream is xs:string*, however the spec 
&gt; demands it to return uris, in fact, this is a MUST. Making it 
&gt; just xs:string* seems too liberal.

Why not change the argument to be xs:anyURI*? Then a type error would be the logical error if an argument is not a URI.

&gt; the behavior of dereferencing the uris is described as the 
&gt; same as fn:doc. Does this preclude raising the same errors 
&gt; if dererencing fails? (this remark also applies to xsl:stream, 
&gt; which defines no errors of its own).

We are more explicit about error conditions with fn:streaem-available, stipulating the errors of fn:doc-available that it inherits. I think it is worth mentioning this for xsl:stream and xsl:merge/@for-each-stream as well.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>111306</commentid>
    <comment_count>1</comment_count>
    <who name="Abel Braaksma">abel.braaksma</who>
    <bug_when>2014-09-09 23:11:58 +0000</bug_when>
    <thetext>*** Bug 26765 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>111338</commentid>
    <comment_count>2</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2014-09-10 11:00:05 +0000</bug_when>
    <thetext>&gt; what error should be raised if both @for-each-stream and @for-each-item are present?

Agreed, for consistency we should allocate an error code.

&gt; what to do when @for-each-stream is present and streamable=&quot;no&quot; is absent?

Presumably you mean streamable=&quot;yes&quot; is absent?
I would say, treat for-each-stream=&quot;XX&quot; as if they had written for-each-item=&quot;(XX)!doc(.)&quot;.

&gt; the type of @for-each-stream is xs:string*, however the spec 
&gt; demands it to return uris, in fact, this is a MUST. Making it 
&gt; just xs:string* seems too liberal.

It is our consistent practice to accept xs:string where a URI is required, e.g. in doc(), xsl:stream, resolve-uri() etc. An xs:anyURI is OK, because of type promotion.

&gt; the behavior of dereferencing the uris is described as the 
&gt; same as fn:doc. Does this preclude raising the same errors 
&gt; if dererencing fails? (this remark also applies to xsl:stream, 
&gt; which defines no errors of its own).

Yes, we should add this: The process of obtaining a document node given a URI is the same as for the docFO30 function (including error conditions).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>111425</commentid>
    <comment_count>3</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2014-09-12 09:12:17 +0000</bug_when>
    <thetext>The WG agreed with the proposed changes.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>111426</commentid>
    <comment_count>4</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2014-09-12 09:22:23 +0000</bug_when>
    <thetext>I will take the opportunity to add xsl:stream and xsl:merge-source to the list of elements to which error XTSE1505 applies (validation and type are mutually exclusive).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>111428</commentid>
    <comment_count>5</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2014-09-12 09:36:18 +0000</bug_when>
    <thetext>I have also taken the opportunity to specify, for avoidance of doubt, that [xsl:]default-validation has no effect on whether xsl:stream and xsl:merge-source perform validation; they perform no validation unless explicitly requested.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>111429</commentid>
    <comment_count>6</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2014-09-12 09:46:16 +0000</bug_when>
    <thetext>Comment #3 is an misrepresentation of the WG decision, especially for para 2. Here is the actual decision:

DECISION para 1: the WG accepted allocating an error code for the mutual exclusive arguments

DECISION para 2: instead of the proposed solution, the WG agreed with requiring streamable=&quot;yes&quot; if for-each-stream attribute is present

DECISION para 3: no change, xs:string is in line with other functions and constructs

DECISION para 4: marked editorial, to add error conditions</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>111430</commentid>
    <comment_count>7</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2014-09-12 09:57:53 +0000</bug_when>
    <thetext>Changes applied. The error code allocated is XTSE3195:

&lt;error class=&quot;SE&quot; code=&quot;3195&quot;&gt;&lt;p&gt;The two attributes &lt;code&gt;for-each-item&lt;/code&gt; and
               &lt;code&gt;for-each-stream&lt;/code&gt; are mutually exclusive. The &lt;elcode&gt;xsl:merge-source&lt;/elcode&gt; element may contain
               either or neither, but not both. It is a &lt;termref def=&quot;dt-static-error&quot;/&gt; if both are present.
               Furthermore, if the &lt;code&gt;for-each-stream&lt;/code&gt; attribute is present, the only permitted value (and the default value)
               of the &lt;code&gt;streamable&lt;/code&gt; attribute is &lt;code&gt;yes&lt;/code&gt;.
            &lt;/p&gt;&lt;/error&gt;</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>