Add test case for bug 29351 (xsl:evaluate)
authorMichael Kay <mike@saxonica.com>
Tue, 22 Dec 2015 10:23:37 +0000
changeset 1192 bee08af8dd04
parent 1191 635ce4a4a0f0
child 1193 b67dcd3a540c
Add test case for bug 29351 (xsl:evaluate)
tests/insn/evaluate/_evaluate-test-set.xml
tests/insn/evaluate/evaluate-043.xsl
--- a/tests/insn/evaluate/_evaluate-test-set.xml	Fri Dec 04 15:34:18 2015 +0000
+++ b/tests/insn/evaluate/_evaluate-test-set.xml	Tue Dec 22 10:23:37 2015 +0000
@@ -724,4 +724,15 @@
          <error code="XPST0008"/>
       </result>
    </test-case>
+   
+   <test-case name="evaluate-043">
+      <description>Error: parameters in map should use QName keys, not strings. See bug 29351.</description>
+      <created by="Michael Kay" on="2015-12-22"/>
+      <test>
+         <stylesheet file="evaluate-043.xsl"/>
+      </test>
+      <result>
+         <error code="XTTE3165"/>
+      </result>
+   </test-case>
 </test-set>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/insn/evaluate/evaluate-043.xsl	Tue Dec 22 10:23:37 2015 +0000
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+    xmlns:map="http://www.w3.org/2005/xpath-functions/map"
+    xmlns:xs="http://www.w3.org/2001/XMLSchema" version="3.0">
+    <xsl:template name="xsl:initial-template">
+        <out>
+            <!-- error: key in map should be a QName, not a string -->
+            <xsl:variable name="map" select="map { 'beast' : xs:integer(666) }"/>
+            <xsl:variable name="xpath2" select="'$beast + 1'"/>
+            <xsl:evaluate xpath="$xpath2" with-params="$map"/>
+        </out>
+    </xsl:template>
+</xsl:stylesheet>
\ No newline at end of file