Error case, type mismatch on with-param variables in xsl:evaluate
authorMichael Kay <mike@saxonica.com>
Fri, 14 Dec 2018 23:35:18 +0000
changeset 1927 5d884354c5d5
parent 1926 59acff18e7c5
child 1928 9054a2d3f6d0
Error case, type mismatch on with-param variables in xsl:evaluate
tests/insn/evaluate/_evaluate-test-set.xml
tests/insn/evaluate/evaluate-018d.xsl
--- a/tests/insn/evaluate/_evaluate-test-set.xml	Fri Dec 14 23:33:54 2018 +0000
+++ b/tests/insn/evaluate/_evaluate-test-set.xml	Fri Dec 14 23:35:18 2018 +0000
@@ -376,6 +376,18 @@
          <assert-xml><![CDATA[<out>49</out>]]></assert-xml>
       </result>
    </test-case>
+   
+   <test-case name="evaluate-018d">
+      <description>Test xsl:evaluate with variables not matching the type required by xsl:with-param, detected dynamically.</description>
+      <created by="Michael Kay" on="2018-11-19"/>
+      <environment ref="eval007"/>
+      <test>
+         <stylesheet file="evaluate-018d.xsl"/>
+      </test>
+      <result>
+         <error code="XPTY0004"/>
+      </result>
+   </test-case>
 
    <test-case name="evaluate-019">
       <description>test that xsl:evaluate doesn't use the default namespace (bug in 8.7 and previous releases) Test was formerly saxon096</description>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/insn/evaluate/evaluate-018d.xsl	Fri Dec 14 23:35:18 2018 +0000
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="3.0"
+xmlns:xs="http://www.w3.org/2001/XMLSchema" exclude-result-prefixes="xs">
+
+<!-- PURPOSE:  Test xsl:evaluate() with variables -->
+<!-- Formerly test saxon070 -->
+
+
+
+<xsl:template match="/">
+<out>
+  <xsl:evaluate xpath="add" with-params="map{xs:QName('p1'): 6, xs:QName('p2'):7}">
+    <xsl:with-param name="p1" as="xs:integer" select="6"/>
+    <xsl:with-param name="p2" as="xs:integer" select="(1,'banana',3,4)[year-from-date(current-date()) idiv 1000]"/>
+  </xsl:evaluate> 
+</out>
+</xsl:template>
+</xsl:stylesheet>
\ No newline at end of file