This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 22123 - Last example of xsl:stream may yield other results than expected
Summary: Last example of xsl:stream may yield other results than expected
Status: CLOSED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XSLT 3.0 (show other bugs)
Version: Member-only Editors Drafts
Hardware: All All
: P2 minor
Target Milestone: ---
Assignee: Michael Kay
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-05-21 15:28 UTC by Abel Braaksma
Modified: 2013-05-23 17:01 UTC (History)
0 users

See Also:


Attachments

Description Abel Braaksma 2013-05-21 15:28:50 UTC
The last example just before 19.2 is the following:

<xsl:transform version="3.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:mode name="delete-ednotes" streamable="yes" on-no-match="deep-copy"/>

<xsl:template name="main">
   <xsl:stream href="book.xml">
      <xsl:apply-templates mode="delete-ednotes"/>
   </xsl:stream>
</xsl:template>

<xsl:template match="ednote" mode="delete-ednotes"/>

</xsl:transform>


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.
Comment 1 Michael Kay 2013-05-23 16:55:34 UTC
Agreed, this should be shallow-copy.
Comment 2 Michael Kay 2013-05-23 17:01:17 UTC
Change has been applied.