Test match="$var" where $var is atomic
authorMichael Kay <mike@saxonica.com>
Sun, 16 Jul 2017 00:07:14 +0100
changeset 1722 9068cdd364c3
parent 1721 51ed5be20a34
child 1723 9f7bb7d3030b
Test match="$var" where $var is atomic
tests/attr/match/_match-test-set.xml
tests/attr/match/match-256.xsl
--- a/tests/attr/match/_match-test-set.xml	Tue Jul 11 15:23:09 2017 +0100
+++ b/tests/attr/match/_match-test-set.xml	Sun Jul 16 00:07:14 2017 +0100
@@ -4725,5 +4725,19 @@
          <assert>/out = "0 0 0 0 0 0 0 14 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 15 0 6 0 0 0 0 8 0 0 0 0 1 0 0 0 0 0 0 0 19 0 13 0 0 0 0 2 0 0 0 0 4 0 0 0 0 0 0 0 20 0 5 0 0 0 0 5 0 0 20 0 4 0 0 0 0 0 0 0 0 0 8 0 0 0 0 5 0 0 0 0 5 0 0 0 0 0 0 0 14 0 0 0 0 0 0 13 0 0 21 0 12 0 0 0 0 0 0 0 0 0 5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 7 0 0 0 0 9 0 0 0 0 9 0 0 0 0 0 0 0 19 0 0 0 0 0 0 0 0 0 0 0 0 0 0 20 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 20 0 0 0 0 0 0 0 0 0 0 0 5 0 0 14 0 5 0 0 0 0 0 0 0 0 0 6 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 5 0 0 18 0 0 0 0 0 0 3 0 0 18 0 3 0 0 20 0 0 0 0 0 0 0 0 0 0 0 8 0 0 0 0 1 0 0 0 0 0 0 0 14 0 0 0 0 0 0 0 0 0 0"</assert>
       </result>
    </test-case>
+   
+   <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"/>
+      <dependencies>
+         <spec value="XSLT30+"/>
+      </dependencies>
+      <test>
+         <stylesheet file="match-256.xsl"/>
+      </test>
+      <result>
+         <assert>empty(/out/node())</assert>
+      </result>
+   </test-case>
  
 </test-set>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/attr/match/match-256.xsl	Sun Jul 16 00:07:14 2017 +0100
@@ -0,0 +1,19 @@
+<xsl:stylesheet version="2.0"
+    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+    
+    <xsl:variable name="atomic" select="93"/>
+    
+    <!-- A match pattern in the form of a variable reference will only match nodes -->
+    <xsl:template match="$atomic">
+        <wrong/>
+    </xsl:template>
+    
+    <xsl:mode on-no-match="deep-skip"/>
+    
+    <xsl:template name="xsl:initial-template">
+        <out>
+            <xsl:apply-templates select="93" />
+        </out>
+    </xsl:template>
+    
+</xsl:stylesheet>