<?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>30110</bug_id>
          
          <creation_ts>2017-05-12 15:37:17 +0000</creation_ts>
          <short_desc>Test-cases match-06[3|4] make wrong assumptions about pattern priority</short_desc>
          <delta_ts>2017-05-12 16:19:57 +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 Test Suite</component>
          <version>Working drafts</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows NT</op_sys>
          <bug_status>RESOLVED</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="johnlumley">john</reporter>
          <assigned_to name="Abel Braaksma">abel.online</assigned_to>
          <cc>mike</cc>
          
          <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>128591</commentid>
    <comment_count>0</comment_count>
    <who name="johnlumley">john</who>
    <bug_when>2017-05-12 15:37:17 +0000</bug_when>
    <thetext>In the test cases match-063 and match-064, both contain (the same) two templates with match patterns: 

&lt;xsl:template match=&quot;foo except /*/*&quot;&gt;
&lt;xsl:template match=&quot;foo&quot;&gt;...

The tests are written on the assumption that the first pattern has a higher default priority than the second, presumably anticipating the &apos;catchall&apos; of +0.5. 

However https://www.w3.org/TR/xslt-30/#default-priority states:

  &quot;If the top-level pattern is an IntersectExceptExprP containing two or more PathExprP operands separated by intersect or except operators, then the priority of the pattern is that of the first PathExprP.&quot;

so the first pattern should have the same priority as the second, and the &apos;select the last matching&apos; behaviour will not produce the desired results.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>128592</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2017-05-12 16:19:57 +0000</bug_when>
    <thetext>Fixed by changing the order of the template rules.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>