<?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>29716</bug_id>
          
          <creation_ts>2016-07-03 21:47:11 +0000</creation_ts>
          <short_desc>[xslt 3.0] xsl:copy and the current template rule</short_desc>
          <delta_ts>2016-10-06 18:42:21 +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>Candidate Recommendation</version>
          <rep_platform>PC</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>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Michael Kay">mike</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>126886</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2016-07-03 21:47:11 +0000</bug_when>
    <thetext>In 5.3.4 we have a list of instructions that clear the current template rule:

xsl:for-each, xsl:for-each-group, xsl:analyze-string, xsl:iterate, xsl:stream, xsl:merge

The current template rule is used by xsl:apply-imports and xsl:next-match; it doesn&apos;t make sense to use these instructions if the context item has changed, so the list above is supposed to include all instructions that execute contained instructions with a new context item.

xsl:copy with a select attribute also sets a new context item, so this should be in the list. But for compatibility with 1.0/2.0, this applies only when there is a select attribute.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>126887</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2016-07-03 21:52:43 +0000</bug_when>
    <thetext>In addition, xsl:call-template should probably clear the current template rule if the called template has 

&lt;xsl:context-item use=&quot;absent&quot;/&gt;

See also the Note in 6.8

These rules ensure that when xsl:apply-imports or xsl:next-match is called, the context item is the same as when the current template rule was invoked.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>126945</commentid>
    <comment_count>2</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2016-07-10 17:36:47 +0000</bug_when>
    <thetext>Note also that in 5.3.4 the initial setting for the current template rule as currently described is nonsense:

If a named template is supplied as the entry point to the transformation, then absent; otherwise the initial named template

This should read: 

If apply-templates invocation is used (see 2.3.3), then while processing each item in the *initial match selection*, the *current template rule* is initially set to the template rule chosen to process that item. Otherwise, absent.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>126946</commentid>
    <comment_count>3</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2016-07-10 18:10:05 +0000</bug_when>
    <thetext>The changes have been applied to the spec.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>