match="$atomic" where the variable is bound to an atomic value
authorMichael Kay <mike@saxonica.com>
Mon, 18 Sep 2017 23:31:36 +0100
changeset 1760 748a74a64be2
parent 1759 97eef08c8f1d
child 1761 f491f8795c7c
match="$atomic" where the variable is bound to an atomic value
tests/attr/match/_match-test-set.xml
tests/attr/match/match-256.xsl
--- a/tests/attr/match/_match-test-set.xml	Mon Sep 18 23:30:43 2017 +0100
+++ b/tests/attr/match/_match-test-set.xml	Mon Sep 18 23:31:36 2017 +0100
@@ -4728,7 +4728,7 @@
    
    <test-case name="match-256">
       <description>Purpose: A match pattern in the form of a variable reference will only match nodes.</description>
-      <created by="Michael Kay" on="2017-01-09"/>
+      <created by="Michael Kay" on="2017-07-16"/>
       <dependencies>
          <spec value="XSLT30+"/>
       </dependencies>
--- a/tests/attr/match/match-256.xsl	Mon Sep 18 23:30:43 2017 +0100
+++ b/tests/attr/match/match-256.xsl	Mon Sep 18 23:31:36 2017 +0100
@@ -4,6 +4,18 @@
     <xsl:variable name="atomic" select="93"/>
     
     <!-- A match pattern in the form of a variable reference will only match nodes -->
+    
+    <!-- Analysis (MHK 2017-09-15). The semantics of this pattern are that it will match an item N if:
+        
+        N is a node, and the result of evaluating the expression root(.)//($atomic) with a singleton focus 
+        based on N is a sequence that includes the node N.
+        
+        Now, if N is a node, the result of this expression will be a sequence consisting of multiple occurrences
+        of the integer 93. This sequence does not include N, therefore the pattern does not match. There is no
+        dynamic error, and no type error, so no rule in the specification is violated and the most the processor
+        can do is to issue a warning.
+    -->
+    
     <xsl:template match="$atomic">
         <wrong/>
     </xsl:template>