New tests for self axis in patterns
authorMichael Kay <mike@saxonica.com>
Thu, 17 Aug 2017 10:12:39 +0100
changeset 1743 d4514cf69148
parent 1742 b6acc0e5e3af
child 1744 60ad316ccf04
New tests for self axis in patterns
tests/attr/match/_match-test-set.xml
tests/attr/match/match-257.xsl
tests/attr/match/match-258.xsl
tests/attr/match/match-259.xsl
--- a/tests/attr/match/_match-test-set.xml	Tue Aug 15 15:34:48 2017 +0100
+++ b/tests/attr/match/_match-test-set.xml	Thu Aug 17 10:12:39 2017 +0100
@@ -4739,5 +4739,53 @@
          <assert>empty(/out/node())</assert>
       </result>
    </test-case>
+   
+   <test-case name="match-257">
+      <description>self axis in pattern, followed by other steps</description>
+      <keywords> self-axis</keywords>
+      <created by="Michael Kay" on="2017-08-17"/>
+      <environment ref="match1059"/>
+      <dependencies>
+         <spec value="XSLT30+"/>
+      </dependencies>
+      <test>
+         <stylesheet file="match-257.xsl"/>
+      </test>
+      <result>
+         <assert-xml><![CDATA[<out><ok a="wrong"/></out>]]></assert-xml>
+      </result>
+   </test-case>
+   
+   <test-case name="match-258">
+      <description>Multiple self axis steps in pattern, followed by other steps</description>
+      <keywords> self-axis</keywords>
+      <created by="Michael Kay" on="2017-08-17"/>
+      <environment ref="match1059"/>
+      <dependencies>
+         <spec value="XSLT30+"/>
+      </dependencies>
+      <test>
+         <stylesheet file="match-258.xsl"/>
+      </test>
+      <result>
+         <assert-xml><![CDATA[<out><ok a="wrong"/></out>]]></assert-xml>
+      </result>
+   </test-case>
+   
+   <test-case name="match-259">
+      <description>Self axis step as the last step in a pattern</description>
+      <keywords> self-axis</keywords>
+      <created by="Michael Kay" on="2017-08-17"/>
+      <environment ref="match1059"/>
+      <dependencies>
+         <spec value="XSLT30+"/>
+      </dependencies>
+      <test>
+         <stylesheet file="match-259.xsl"/>
+      </test>
+      <result>
+         <assert-xml><![CDATA[<out><ok a="wrong"/></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-257.xsl	Thu Aug 17 10:12:39 2017 +0100
@@ -0,0 +1,21 @@
+<?xml version="1.0"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+    xmlns:xs="http://www.w3.org/2001/XMLSchema" exclude-result-prefixes="xs" version="3.0">
+
+    <?spec xslt#patterns?>
+    <!-- Purpose: self axis in pattern, followed by other steps -->
+
+
+    <xsl:template match="/">
+        <out>
+            <xsl:apply-templates select="//*"/>
+        </out>
+    </xsl:template>
+
+    <xsl:template match="self::foo//baz">
+        <ok a="{@att1}"/>
+    </xsl:template>
+
+    <xsl:template match="* | text()"/>
+
+</xsl:stylesheet>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/attr/match/match-258.xsl	Thu Aug 17 10:12:39 2017 +0100
@@ -0,0 +1,21 @@
+<?xml version="1.0"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+    xmlns:xs="http://www.w3.org/2001/XMLSchema" exclude-result-prefixes="xs" version="3.0">
+
+    <?spec xslt#patterns?>
+    <!-- Purpose: Multiple self axis steps in pattern, followed by other steps -->
+
+
+    <xsl:template match="/">
+        <out>
+            <xsl:apply-templates select="//*"/>
+        </out>
+    </xsl:template>
+
+    <xsl:template match="self::foo/self::*[@att1]/baz">
+        <ok a="{@att1}"/>
+    </xsl:template>
+
+    <xsl:template match="* | text()"/>
+
+</xsl:stylesheet>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/attr/match/match-259.xsl	Thu Aug 17 10:12:39 2017 +0100
@@ -0,0 +1,21 @@
+<?xml version="1.0"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+    xmlns:xs="http://www.w3.org/2001/XMLSchema" exclude-result-prefixes="xs" version="3.0">
+
+    <?spec xslt#patterns?>
+    <!-- Purpose: Self axis step as the last step in a pattern -->
+
+
+    <xsl:template match="/">
+        <out>
+            <xsl:apply-templates select="//*"/>
+        </out>
+    </xsl:template>
+
+    <xsl:template match="foo//self::baz">
+        <ok a="{@att1}"/>
+    </xsl:template>
+
+    <xsl:template match="* | text()"/>
+
+</xsl:stylesheet>