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 22740 - xsl:fork example doesn't produce the described results
Summary: xsl:fork example doesn't produce the described results
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 trivial
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-07-20 15:00 UTC by Abel Braaksma
Modified: 2014-05-15 14:00 UTC (History)
0 users

See Also:


Attachments

Description Abel Braaksma 2013-07-20 15:00:42 UTC
The description for the second example under xsl:fork:

"The requirement is to output a copy of the input document in which (a) the note elements have been removed,..." 

does not fit the code provided:

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

<xsl:template match="note"/>

<xsl:template match="/*">
  <xsl:fork>
    <xsl:sequence>
      <xsl:apply-templates/>
    </xsl:sequence>
    <xsl:sequence>
      <footnote>
        <p>Removed <xsl:value-of select="count(.//note)"/> 
                 note elements.</p>
      </footnote>
    </xsl:sequence>  
  </xsl:fork>
</xsl:template>

The example uses deep-copy, which prevents processing of any children below /*/*, which means that nested note-elements will be part of the output. To remove the note elements and to keep anything else, the line 

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

should be changed into

<xsl:mode on-no-match="shallow-copy" streamable="yes"/>

Abel


PS: this error is similar to https://www.w3.org/Bugs/Public/show_bug.cgi?id=22123, but that was in another example.
Comment 1 Michael Kay 2013-07-20 15:54:53 UTC
Thanks, fixed.