<?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>22123</bug_id>
          
          <creation_ts>2013-05-21 15:28:50 +0000</creation_ts>
          <short_desc>Last example of xsl:stream may yield other results than expected</short_desc>
          <delta_ts>2013-05-23 17:01:17 +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>Member-only Editors Drafts</version>
          <rep_platform>All</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>minor</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>88000</commentid>
    <comment_count>0</comment_count>
    <who name="Abel Braaksma">abel.braaksma</who>
    <bug_when>2013-05-21 15:28:50 +0000</bug_when>
    <thetext>The last example just before 19.2 is the following:

&lt;xsl:transform version=&quot;3.0&quot; xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot;&gt;

&lt;xsl:mode name=&quot;delete-ednotes&quot; streamable=&quot;yes&quot; on-no-match=&quot;deep-copy&quot;/&gt;

&lt;xsl:template name=&quot;main&quot;&gt;
   &lt;xsl:stream href=&quot;book.xml&quot;&gt;
      &lt;xsl:apply-templates mode=&quot;delete-ednotes&quot;/&gt;
   &lt;/xsl:stream&gt;
&lt;/xsl:template&gt;

&lt;xsl:template match=&quot;ednote&quot; mode=&quot;delete-ednotes&quot;/&gt;

&lt;/xsl:transform&gt;


The text explains that this will remove any ednote elements. However, I think it only removes ednote when it is the root element of book.xml. The reason being that the effective mode deep-copies all nodes that are not matched, which means that when a match is not found, the whole subtree it copied and not processed further.

I think the correction should be to change deep-copy to shallow-copy and the result of the transformation will be what it should be: ednote elements are removed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>88129</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2013-05-23 16:55:34 +0000</bug_when>
    <thetext>Agreed, this should be shallow-copy.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>88130</commentid>
    <comment_count>2</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2013-05-23 17:01:17 +0000</bug_when>
    <thetext>Change has been applied.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>