New test case for match pattern with predicate
authorMichael Kay <mike@saxonica.com>
Mon, 28 Dec 2015 17:55:03 +0000
changeset 1195 db4cdc265c27
parent 1194 30a6363b39ef
child 1196 1d6926487cf1
New test case for match pattern with predicate
tests/attr/match/_match-test-set.xml
tests/attr/match/match-245.xsl
--- a/tests/attr/match/_match-test-set.xml	Mon Dec 28 17:53:49 2015 +0000
+++ b/tests/attr/match/_match-test-set.xml	Mon Dec 28 17:55:03 2015 +0000
@@ -4528,4 +4528,19 @@
          <error code="XTSE3105"/>
       </result>
    </test-case>
+   
+   <test-case name="match-245">
+      <description>Purpose: Test of node=value in predicate in match pattern.</description>
+      <created by="Michael Kay" on="2015-12-17"/>
+      <environment ref="match1004"/>
+      <dependencies>
+         <spec value="XSLT20+"/>
+      </dependencies>
+      <test>
+         <stylesheet file="match-245.xsl"/>
+      </test>
+      <result>
+         <assert-xml><![CDATA[<out><in>b</in><in>b</in><in>b</in><in>b</in><in>b</in><in>b</in></out>]]></assert-xml>
+      </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-245.xsl	Mon Dec 28 17:55:03 2015 +0000
@@ -0,0 +1,24 @@
+<?xml version="1.0"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
+
+<?spec xslt#patterns?>
+  <!-- Purpose: Test of local variables in match pattern with mode="#all". -->
+  
+<xsl:param name="target" select="'b'"/>
+<xsl:strip-space elements="*"/>  
+
+<xsl:template match="letters">
+  <out>
+    <xsl:apply-templates mode="m1"/>
+    <xsl:apply-templates mode="m2"/>
+    <xsl:apply-templates mode="m3"/>
+  </out>
+</xsl:template>
+
+<xsl:template match="letter[some $x in tokenize(., '-') satisfies $x = $target]" mode="#all">
+  <in><xsl:value-of select="."/></in>
+</xsl:template>
+
+<xsl:template match="letter" mode="#all"/>
+
+</xsl:stylesheet>