Add test for dynamic call on current() (error case)
authorMichael Kay <mike@saxonica.com>
Wed, 18 Feb 2015 11:42:03 +0000
changeset 824 46347d1c8198
parent 823 9bdf7ae265f5
child 825 3c1d98b8c6a6
Add test for dynamic call on current() (error case)
tests/misc/error/_error-test-set.xml
tests/misc/error/error-1360b.xsl
--- a/tests/misc/error/_error-test-set.xml	Wed Feb 18 11:41:04 2015 +0000
+++ b/tests/misc/error/_error-test-set.xml	Wed Feb 18 11:42:03 2015 +0000
@@ -7599,6 +7599,23 @@
          <error code="XTDE1360"/>
       </result>
    </test-case>
+   
+   <test-case name="error-1360b">
+      <description>A dynamic call to the current() function is a dynamic error
+      </description>
+      <created by="Michael Kay" on="2015-02-07"/>
+      <environment ref="error001"/>
+      <dependencies>
+         <spec value="XSLT20+"/>
+      </dependencies>
+      <test>
+         <stylesheet file="error-1360b.xsl"/>
+         <initial-template name="main"/>
+      </test>
+      <result>
+         <error code="XTDE1360"/>
+      </result>
+   </test-case>
 
    <test-case name="error-1370a">
       <description>Generate error XTDE1370. Was error-code-365.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/misc/error/error-1360b.xsl	Wed Feb 18 11:42:03 2015 +0000
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- A dynamic call to the current() function is a dynamic error.-->
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                xmlns:xs="http://www.w3.org/2001/XMLSchema"
+                xmlns:my="http://my.com/"
+                version="3.0">
+
+<?error XTDE1360?>
+
+  <xsl:variable name="f" select="current#0"/>
+  <xsl:template name="main">
+      <out>
+        <xsl:for-each select="1 to 10">
+            <xsl:sequence select="$f()"/>
+        </xsl:for-each>  
+      </out>
+  </xsl:template>
+ 
+
+</xsl:stylesheet>