Merge
authorabraaksm
Mon, 30 Mar 2015 18:49:39 +0200
changeset 894 0fc26a1f66f4
parent 893 d42d1074b77a (current diff)
parent 891 b0d6c9226dcc (diff)
child 895 c964d5bbd00e
Merge
--- a/tests/expr/higher-order-functions/_higher-order-functions-test-set.xml	Mon Mar 30 18:49:01 2015 +0200
+++ b/tests/expr/higher-order-functions/_higher-order-functions-test-set.xml	Mon Mar 30 18:49:39 2015 +0200
@@ -721,26 +721,26 @@
    <test-case name="higher-order-functions-055">
       <description>atomize a function item</description>
       <created by="Michael Kay" on="2012-11-07"/>
-      <dependencies/>
+      <modified by="Michael Kay" on="2015-03-30" change="correct expected error code. Note bug 27610."/>
       <test>
          <stylesheet file="higher-order-functions-055.xsl"/>
          <initial-template name="main"/>
       </test>
       <result>
-         <error code="XPTY0004"/>
+         <error code="FOTY0013"/>
       </result>
    </test-case>
 
    <test-case name="higher-order-functions-056">
       <description>atomize a function item</description>
       <created by="Michael Kay" on="2012-11-07"/>
-      <dependencies/>
+      <modified by="Michael Kay" on="2015-03-30" change="correct expected error code. Note bug 27610."/>
       <test>
          <stylesheet file="higher-order-functions-056.xsl"/>
          <initial-template name="main"/>
       </test>
       <result>
-         <error code="XPTY0004"/>
+         <error code="FOTY0013"/>
       </result>
    </test-case>
 
@@ -760,7 +760,7 @@
    <test-case name="higher-order-functions-058">
       <description>Heterogeneous sequence on rhs of "/"</description>
       <created by="Michael Kay" on="2012-11-07"/>
-      <dependencies/>
+      <modified by="Michael Kay" on="2015-03-30" change="See bug 28369"/>
       <test>
          <stylesheet file="higher-order-functions-058.xsl"/>
          <initial-template name="main"/>
--- a/tests/expr/higher-order-functions/higher-order-functions-058.xsl	Mon Mar 30 18:49:01 2015 +0200
+++ b/tests/expr/higher-order-functions/higher-order-functions-058.xsl	Mon Mar 30 18:49:39 2015 +0200
@@ -8,7 +8,7 @@
     <!-- Heterogeneous sequence on rhs of "/" -->
  
     
-    <xsl:variable name="f"><a b="3"/></xsl:variable>
+    <xsl:variable name="f" as="element(*)"><a b="3"/></xsl:variable>
     
  
     <xsl:template name="main">
--- a/tests/insn/evaluate/_evaluate-test-set.xml	Mon Mar 30 18:49:01 2015 +0200
+++ b/tests/insn/evaluate/_evaluate-test-set.xml	Mon Mar 30 18:49:39 2015 +0200
@@ -333,6 +333,42 @@
          <assert-xml><![CDATA[<out>13</out>]]></assert-xml>
       </result>
    </test-case>
+   
+   <test-case name="evaluate-018a">
+      <description>Test xsl:evaluate with variables specified using @with-params.</description>
+      <created by="Michael Kay" on="2015-03-30"/>
+      <environment ref="eval007"/>
+      <test>
+         <stylesheet file="evaluate-018a.xsl"/>
+      </test>
+      <result>
+         <assert-xml><![CDATA[<out>13</out>]]></assert-xml>
+      </result>
+   </test-case>
+   
+   <test-case name="evaluate-018b">
+      <description>Test xsl:evaluate with variables specified using @with-params+child xsl:with-param.</description>
+      <created by="Michael Kay" on="2015-03-30"/>
+      <environment ref="eval007"/>
+      <test>
+         <stylesheet file="evaluate-018b.xsl"/>
+      </test>
+      <result>
+         <assert-xml><![CDATA[<out>13</out>]]></assert-xml>
+      </result>
+   </test-case>
+   
+   <test-case name="evaluate-018c">
+      <description>Test xsl:evaluate with variables specified duplicated on with-params attribute and xsl:with-param child.</description>
+      <created by="Michael Kay" on="2015-03-30"/>
+      <environment ref="eval007"/>
+      <test>
+         <stylesheet file="evaluate-018c.xsl"/>
+      </test>
+      <result>
+         <assert-xml><![CDATA[<out>13</out>]]></assert-xml>
+      </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>
@@ -645,4 +681,22 @@
             ><out>http://www.w3.org/#3</out><out>http://example.com/?4</out></Result>]]></assert-xml>
       </result>
    </test-case>
+   
+   <test-case name="evaluate-040">
+      <description>Same as evaluate-039 but using @with-params</description>
+      <created by="Michael Kay" on="2015-03-30"/>
+      <dependencies>
+         <feature value="schema_aware" satisfied="true"/>
+      </dependencies>
+      <test>
+         <stylesheet file="evaluate-040.xsl"/>
+         <initial-template name="main"/>
+      </test>
+      <result>
+         <assert-xml><![CDATA[<Result><out>http://www.w3.org/?0</out><out>http://example.com/#1</out
+            ><out>http://www.w3.org/?2</out><out>http://example.com/?3</out><out>http://www.w3.org/?4</out
+            ><out>http://example.com/?0</out><out>http://www.w3.org/?1</out><out>http://example.com/?2</out
+            ><out>http://www.w3.org/#3</out><out>http://example.com/?4</out></Result>]]></assert-xml>
+      </result>
+   </test-case>
 </test-set>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/insn/evaluate/evaluate-018a.xsl	Mon Mar 30 18:49:39 2015 +0200
@@ -0,0 +1,15 @@
+<?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}"/> 
+</out>
+</xsl:template>
+</xsl:stylesheet>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/insn/evaluate/evaluate-018b.xsl	Mon Mar 30 18:49:39 2015 +0200
@@ -0,0 +1,17 @@
+<?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('p2'):7}">
+    <xsl:with-param name="p1" select="6"/>
+  </xsl:evaluate> 
+</out>
+</xsl:template>
+</xsl:stylesheet>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/insn/evaluate/evaluate-018c.xsl	Mon Mar 30 18:49:39 2015 +0200
@@ -0,0 +1,17 @@
+<?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'):42, xs:QName('p2'):7}">
+    <xsl:with-param name="p1" select="6"/>
+  </xsl:evaluate> 
+</out>
+</xsl:template>
+</xsl:stylesheet>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/insn/evaluate/evaluate-040.xsl	Mon Mar 30 18:49:39 2015 +0200
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- Same as evaluate-039 but using @with-params -->
+
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ev39="http://example.com/evaluate39" version="3.0"
+exclude-result-prefixes="xs ev39">
+
+  <xsl:import-schema>
+    <xs:schema targetNamespace="http://example.com/evaluate039">
+      <xs:simpleType name="restrictedDate">
+        <xs:restriction base="xs:date">
+          <xs:minInclusive value="2009-01-01"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:schema>
+  </xsl:import-schema>
+  
+  <xsl:param name="path1">concat(static-base-uri(), "#", $v)</xsl:param>
+  <xsl:param name="path2">concat(static-base-uri(), "?", $v)</xsl:param>
+  
+  <xsl:template match="/" name="main">
+    <Result>
+      <xsl:for-each select="1 to 100000">
+        <xsl:variable name="r" as="xs:string">
+          <xsl:evaluate xpath="if (position() mod 7 = 0) then $path1 else $path2"
+                        base-uri="{if (position() mod 2 = 0) then 'http://www.w3.org/' else 'http://example.com/'}"
+                        schema-aware="{if (position() mod 3 = 0) then ' true ' else 'false'}"
+                        with-params="map{xs:QName('v'): position() mod 5}"/>
+        </xsl:variable>
+        <xsl:if test="position() ge 90 and position() lt 100">
+            <out><xsl:value-of select="$r"/></out>
+        </xsl:if>
+      </xsl:for-each>
+    </Result>
+  </xsl:template>
+  
+</xsl:stylesheet>