<?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>23329</bug_id>
          
          <creation_ts>2013-09-23 13:40:53 +0000</creation_ts>
          <short_desc>[xslt3.0] xsl:next-match and templates using union patterns</short_desc>
          <delta_ts>2014-05-15 14:00:43 +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>Working drafts</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>93641</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2013-09-23 13:40:53 +0000</bug_when>
    <thetext>Consider &lt;xsl:template match=&quot;a[xx] | a[yy]&quot;&gt;

For xsl:next-match we have a Note that says:

As explained in 6.4 Conflict Resolution for Template Rules, a template rule whose match pattern contains multiple alternatives separated by | is treated equivalently to a set of template rules, one for each alternative. This means that where the same item matches more than one alternative, and the alternatives have different priority, it is possible for an xsl:next-match instruction to cause the current template rule to be invoked recursively. This situation does not occur when the alternatives have the same priority.

(1) the reference to 6.4 is incorrect, it should be to 6.5.

(2) In the relevant rule in 6.5 it says &quot;However, it is not an error if an item matches more than one of the alternatives.&quot;. In 3.0 this would not be an error anyway, so the sentence is obsolete.

(3) The sentence &quot;This situation does not occur when the alternatives have the same priority.&quot; appears unfounded. In the above example, the alternatives have the same priority, and there doesn&apos;t seem to be any normative statement about what xsl:next-match does in this case. I think we should say that the rule &quot;the template rule is treated equivalently to a set of template rules, one for each alternative&quot; applies only if there is no explicit priority and the alternatives have different default priority. If they have the same (explicit or implicit) priority, then we should behave as if there is only one template rule, which means that next-match will not select the rule more than once.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>93812</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2013-09-25 16:14:50 +0000</bug_when>
    <thetext>In looking at this none of us were enamoured of the 2.0 specification, but decided that the simplest extension of compatible behaviour was to say that we always treat a union pattern as defining multiple template rules, and we treat the &quot;declaration order&quot; of these rules (which affects their ranking during conflict resolution and next-match) as being the order of branches of the union.

We should note also that this splitting applies ONLY if there is no explicit priority attribute.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>93861</commentid>
    <comment_count>2</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2013-09-26 07:29:09 +0000</bug_when>
    <thetext>These changes have been applied.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>