Add test for xsl:text-match using atomic values
authorMichael Kay <mike@saxonica.com>
Mon, 25 Jan 2016 10:29:14 +0000
changeset 1214 7fd567cafa00
parent 1213 b62e4ad649b8
child 1215 077077057502
Add test for xsl:text-match using atomic values
tests/insn/next-match/_next-match-test-set.xml
tests/insn/next-match/next-match-027.xsl
--- a/tests/insn/next-match/_next-match-test-set.xml	Mon Jan 25 10:28:46 2016 +0000
+++ b/tests/insn/next-match/_next-match-test-set.xml	Mon Jan 25 10:29:14 2016 +0000
@@ -497,4 +497,18 @@
          <assert-xml><![CDATA[<out><foo/><bar/></out>]]></assert-xml>
       </result>
    </test-case>
+   
+   <test-case name="next-match-027">
+      <description>Test of xsl:next-match applied to atomic values.</description>
+      <created by="Michael Kay" on="2016-01-19"/>
+      <dependencies>
+         <spec value="XSLT30+"/>
+      </dependencies>
+      <test>
+         <stylesheet file="next-match-027.xsl"/>
+      </test>
+      <result>
+         <assert>/out = "A1BA2CBA3DCBA4EDCBA5"</assert>
+      </result>
+   </test-case>
 </test-set>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/insn/next-match/next-match-027.xsl	Mon Jan 25 10:29:14 2016 +0000
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="3.0">
+<!-- Purpose: Simple test of next-match where the match pattern is a NameTest -->
+
+   <xsl:template name="xsl:initial-template">
+      <out>
+         <xsl:apply-templates select="1 to 5"/>
+      </out>
+   </xsl:template>
+   
+   <xsl:template match=".[. ge 5]" priority="5">E<xsl:next-match/></xsl:template>
+   <xsl:template match=".[. ge 4]" priority="4">D<xsl:next-match/></xsl:template>
+   <xsl:template match=".[. ge 3]" priority="3">C<xsl:next-match/></xsl:template>
+   <xsl:template match=".[. ge 2]" priority="2">B<xsl:next-match/></xsl:template>
+   <xsl:template match=".[. ge 1]" priority="1">A<xsl:next-match/></xsl:template>
+   
+</xsl:transform>