xsl:evaluate calling document() may or may not succeed
authorMichael Kay <mike@saxonica.com>
Tue, 29 Aug 2017 21:36:47 +0100
changeset 1752 b8594537eaed
parent 1751 8c7f1df6467d
child 1753 11ea335f61ab
xsl:evaluate calling document() may or may not succeed
tests/insn/evaluate/_evaluate-test-set.xml
tests/insn/evaluate/evaluate-048.xsl
--- a/tests/insn/evaluate/_evaluate-test-set.xml	Tue Aug 29 21:36:14 2017 +0100
+++ b/tests/insn/evaluate/_evaluate-test-set.xml	Tue Aug 29 21:36:47 2017 +0100
@@ -796,4 +796,24 @@
          <error code="XTDE3160"/>
       </result>
    </test-case>
+   
+   <test-case name="evaluate-048">
+      <description>A dynamic call to fn:document() may or may not succeed (spec bug 30049)</description>
+      <created by="Michael Kay" on="2017-08-17"/>
+      <dependencies>
+         <feature value="dynamic_evaluation"/>
+         <feature value="higher_order_functions"/>
+         <feature value="XPath_3.1"/>
+         <spec value="XSLT30+"/>
+      </dependencies>
+      <test>
+         <stylesheet file="evaluate-048.xsl"/>        
+      </test>
+      <result>
+         <any-of>
+            <assert>/out/*:html</assert>
+            <error code="XTDE3160"/>
+         </any-of>       
+      </result>
+   </test-case>
 </test-set>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/insn/evaluate/evaluate-048.xsl	Tue Aug 29 21:36:47 2017 +0100
@@ -0,0 +1,17 @@
+<?xml version="1.0"?> 
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="3.0"
+  xmlns:my="http://www.example.com/my-functions" exclude-result-prefixes="my">
+
+  <!-- PURPOSE A dynamic call to fn:document() may or may not succeed -->
+
+
+  <xsl:param name="p">function-lookup(QName('http://www.w3.org/2005/xpath-functions', 'document'), 1)('http://www.w3.org')</xsl:param>
+  
+  <xsl:template name="xsl:initial-template">
+    <out>
+      <xsl:evaluate xpath="$p"/>
+    </out>
+  </xsl:template>
+
+ 
+</xsl:stylesheet>