Fixing bug#26796 and bug#26801, namespaces, cleanup, extension functions, (wrong) error codes
authorabraaksm
Mon, 15 Sep 2014 03:11:03 +0200
changeset 680 30591c1673a4
parent 679 398dc213fbbb
child 681 577c0d257519
Fixing bug#26796 and bug#26801, namespaces, cleanup, extension functions, (wrong) error codes
tests/insn/evaluate/_evaluate-test-set.xml
tests/insn/evaluate/eval003.xml
tests/insn/evaluate/evaluate-006.xsl
tests/insn/evaluate/evaluate-007.xsl
tests/insn/evaluate/evaluate-008.xsl
tests/insn/evaluate/evaluate-010.xsl
tests/insn/evaluate/evaluate-015.xsl
tests/insn/evaluate/evaluate-017.xsl
tests/insn/evaluate/evaluate-022.xsl
tests/insn/evaluate/evaluate-023.xsl
tests/insn/evaluate/evaluate-024.xsl
tests/insn/evaluate/evaluate-025.xsl
tests/insn/evaluate/evaluate-026.xsl
tests/insn/evaluate/evaluate-027.xsl
tests/insn/evaluate/evaluate-039.xsl
--- a/tests/insn/evaluate/_evaluate-test-set.xml	Sun Sep 14 19:20:21 2014 +0200
+++ b/tests/insn/evaluate/_evaluate-test-set.xml	Mon Sep 15 03:11:03 2014 +0200
@@ -146,25 +146,28 @@
    <test-case name="evaluate-006">
       <description>Test availability of functions within xsl:evaluate. Test was formerly saxon083.</description>
       <created by="Michael Kay" on="2012-11-07"/>
+      <modified by="Abel Braaksma" on="2014-09-14" change="Bug#26796: Remove redundant Java namespace, fix function call"/>
       <test>
          <stylesheet file="evaluate-006.xsl"/>
          <initial-template name="main"/>
       </test>
       <result>
-         <assert-xml><![CDATA[<out><a>true</a><a>ab</a><a>1</a><a>3</a><a>25</a><a>5</a></out>]]></assert-xml>
+         <assert-xml><![CDATA[<out><a>true</a><a>ab</a><a>1</a><a>3</a><a>25</a><a>1728</a></out>]]></assert-xml>
       </result>
    </test-case>
 
    <test-case name="evaluate-007">
       <description>test current() occurring within xsl:evaluate. Now allowed</description>
-      <created by="Michael Kay" on="2012-11-07"/>
+      <created by="Michael Kay" on="2012-11-07"/>      
       <modified by="Michael Kay" on="2013-06-19" change="remove unnecessary Saxon namespace"/>
+      <modified by="Abel Braaksma" on="2014-09-14" change="Bug#26796: Remove redundant Java namespace"/>
+      <modified by="Abel Braaksma" on="2014-09-15" change="Bug#26796: Use of fn:current is not allowed in xsl:evaluate, fixed to catch the error"/>
       <test>
          <stylesheet file="evaluate-007.xsl"/>
          <initial-template name="main"/>
       </test>
       <result>
-         <assert-xml><![CDATA[<out><z><a n="1"/></z><z><a n="2"/></z><z><a n="3"/></z><z><a n="4"/></z></out>]]></assert-xml>
+         <error code="XPST0017"/>
       </result>
    </test-case>
 
@@ -172,6 +175,7 @@
       <description>test call on polymorphic extension function occurring within xsl:evaluate. Bug 2859861</description>
       <created by="Michael Kay" on="2012-11-07"/>
       <modified by="Michael Kay" on="2012-12-05" change="fix bug 23203"/>
+      <modified by="Abel Braaksma" on="2014-09-14" change="Bug#26796: make test somewhat meaningful when ext. function is not available, by using xsl:evaluate to the equiv. function"/>
       <test>
          <stylesheet file="evaluate-008.xsl"/>
          <initial-template name="main"/>
@@ -199,6 +203,7 @@
    <test-case name="evaluate-010">
       <description>Test designed to exercise any caching done by the implementation</description>
       <created by="Michael Kay" on="2012-11-07"/>
+      <modified by="Abel Braaksma" on="2014-09-15" change="Bug#26796, avoiding confusion on the saxon namespace"/>
       <dependencies>
          <feature value="schema_aware"/>
       </dependencies>
@@ -207,10 +212,10 @@
          <initial-template name="main"/>
       </test>
       <result>
-         <assert-xml><![CDATA[<Result><out>http://www.w3.org/?0</out><out>http://saxon.sf.net/#1</out
-            ><out>http://www.w3.org/?2</out><out>http://saxon.sf.net/?3</out><out>http://www.w3.org/?4</out
-            ><out>http://saxon.sf.net/?0</out><out>http://www.w3.org/?1</out><out>http://saxon.sf.net/?2</out
-            ><out>http://www.w3.org/#3</out><out>http://saxon.sf.net/?4</out></Result>]]></assert-xml>
+         <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>
 
@@ -274,9 +279,10 @@
 
    <test-case name="evaluate-015">
       <description>
-         Basic test of xsl:evaluate. Includes a test where the expression to be evaluated itself calls xsl:evaluate. 
+         Complex test of xsl:evaluate. Includes a test where the expression to be evaluated itself calls xsl:evaluate, and inherits the context. 
          Test was formerly saxon013</description>
       <created by="Michael Kay" on="2012-11-07"/>
+      <modified by="Abel Braaksma" on="2014-09-15" change="Bug#26796, removed dependency on saxon:evaluate-node, by rewriting it as a stylesheet function with similar semantics"/>
       <environment ref="eval003"/>
       <test>
          <stylesheet file="evaluate-015.xsl"/>
@@ -302,6 +308,7 @@
    <test-case name="evaluate-017">
       <description>Test of xsl:evaluate calling an external Java function. Test was formerly saxon037</description>
       <created by="Michael Kay" on="2012-11-07"/>
+      <modified by="Abel Braaksma" on="2014-09-14" change="Bug#26796: fixed incorrect dependency on saxon namespace in xsl:otherwise"/>
       <environment ref="eval005"/>
      <test>
          <stylesheet file="evaluate-017.xsl"/>
@@ -369,6 +376,7 @@
       <description>test type error occurring within xsl:evaluate. Formerly saxon9083-err</description>
       <created by="Michael Kay" on="2012-11-07"/>
       <modified by="Abel Braaksma" on="2013-12-10" change="xsl:evaluate occured in xslt3.0 spec, set stylesheet @version to 3.0"/>
+      <modified by="Abel Braaksma" on="2014-09-14" change="Bug#26796: Remove redundant Java namespace, fix ext. function call to use one from the standard math namespace"/>
       <environment ref="eval012"/>
       <test>
          <stylesheet file="evaluate-022.xsl"/>
@@ -384,18 +392,23 @@
    <test-case name="evaluate-023">
       <description>test type error occurring on result of xsl:evaluate</description>
       <created by="Michael Kay" on="2012-11-07"/>
+      <modified by="Abel Braaksma" on="2014-09-15" change="Bug#26801: fixing the error code (currently allowing both XPTY0004 and XTTE0780, but I think the former should be removed)"/>
       <environment ref="eval012"/>
       <test>
          <stylesheet file="evaluate-023.xsl"/>
       </test>
       <result>
-         <error code="XPTY0004"/>
+         <any-of>
+            <error code="XPTY0004"/>
+            <error code="XTTE0780"/>
+         </any-of>
       </result>
    </test-case>
 
    <test-case name="evaluate-024">
       <description>xsl:evaluate fails with absent context item</description>
       <created by="Michael Kay" on="2012-11-07"/>
+      <modified by="Abel Braaksma" on="2014-09-15" change="Removed redundant, unused code"/>
       <environment ref="eval012"/>
       <test>
          <stylesheet file="evaluate-024.xsl"/>
@@ -409,6 +422,7 @@
       <description>xsl:evaluate fails with absent context item</description>
       <created by="Michael Kay" on="2012-11-07"/>
       <modified by="Abel Braaksma" on="2013-12-10" change="xsl:evaluate occured in xslt3.0 spec, set stylesheet @version to 3.0"/>
+      <modified by="Abel Braaksma" on="2014-09-15" change="Removed redundant, unused code"/>
       <environment ref="eval012"/>
       <test>
          <stylesheet file="evaluate-025.xsl"/>
@@ -422,19 +436,22 @@
       <description>xsl:evaluate fails with context item as sequence of items</description>
       <created by="Michael Kay" on="2012-11-07"/>
       <modified by="Abel Braaksma" on="2013-12-10" change="xsl:evaluate occured in xslt3.0 spec, set stylesheet @version to 3.0"/>
+      <modified by="Abel Braaksma" on="2014-09-15" change="Removed redundant, unused code"/>
+      <modified by="Abel Braaksma" on="2014-09-15" change="Bug#26801: fixing the error code, should be XTTE3210 instead of XPTY0004"/>
       <environment ref="eval012"/>
       <test>
          <stylesheet file="evaluate-026.xsl"/>
       </test>
       <result>
-         <error code="XPTY0004"/>
+         <error code="XTTE3210"/>
       </result>
    </test-case>
 
    <test-case name="evaluate-027">
-      <description>Test use of second argument to saxon:expression() to supply a namespace context</description>
+      <description>Test to supply a namespace context to xsl:evaluate</description>
       <created by="Michael Kay" on="2012-11-07"/>
       <modified by="Abel Braaksma" on="2013-12-10" change="xsl:evaluate occured in xslt3.0 spec, set stylesheet @version to 3.0"/>
+      <modified by="Abel Braaksma" on="2014-09-15" change="Bug#26796: Remove redundant Java and Saxon namespace"/>
       <environment ref="eval014"/>
       <test>
          <stylesheet file="evaluate-027.xsl"/>
@@ -610,6 +627,7 @@
       <description>Test designed to exercise any caching done by the implementation, uses schema-aware AVT attributes which evaluate to "true" and "false"</description>
       <created by="Debbie Lockett" on="2014-08-08"/>
       <modified by="Abel Braaksma" on="2014-09-14" change="made test specific for schema-aware processors, per bug#26793"/>
+      <modified by="Abel Braaksma" on="2014-09-15" change="Bug#26796, avoiding confusion on the saxon namespace"/>
       <dependencies>
          <feature value="schema_aware" satisfied="true"/>
       </dependencies>
@@ -618,10 +636,10 @@
          <initial-template name="main"/>
       </test>
       <result>
-         <assert-xml><![CDATA[<Result><out>http://www.w3.org/?0</out><out>http://saxon.sf.net/#1</out
-            ><out>http://www.w3.org/?2</out><out>http://saxon.sf.net/?3</out><out>http://www.w3.org/?4</out
-            ><out>http://saxon.sf.net/?0</out><out>http://www.w3.org/?1</out><out>http://saxon.sf.net/?2</out
-            ><out>http://www.w3.org/#3</out><out>http://saxon.sf.net/?4</out></Result>]]></assert-xml>
+         <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>
--- a/tests/insn/evaluate/eval003.xml	Sun Sep 14 19:20:21 2014 +0200
+++ b/tests/insn/evaluate/eval003.xml	Mon Sep 15 03:11:03 2014 +0200
@@ -1,9 +1,9 @@
 <doc>
-  <exp>2+2</exp>
+  <exp xmlns:eval="http://example.com/eval">2+2</exp>
   <exp>count(preceding-sibling::*)</exp>
   <exp>lower-case(substring-after(base-uri(), '/evaluate/'))</exp>
   <exp>lower-case(substring-after(static-base-uri(), '/evaluate/'))</exp>
   <exp xmlns:p="http://a/uri" p:att="17">string(@p:att)</exp>
-  <exp xmlns:saxon="http://saxon.sf.net/">saxon:evaluate-node(ancestor::doc/exp[1])</exp>
+  <exp xmlns:eval="http://example.com/eval">eval:node(ancestor::doc/exp[1])</exp>
   <exp>for $i in (1,2,3) return $i*$i</exp>
 </doc> 
\ No newline at end of file
--- a/tests/insn/evaluate/evaluate-006.xsl	Sun Sep 14 19:20:21 2014 +0200
+++ b/tests/insn/evaluate/evaluate-006.xsl	Mon Sep 15 03:11:03 2014 +0200
@@ -1,19 +1,19 @@
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="3.0"
-xmlns:f="f.uri"
-xmlns:fn="http://www.w3.org/2005/xpath-functions"
-xmlns:xs="http://www.w3.org/2001/XMLSchema"
-xmlns:math="java:java.lang.Math"
-exclude-result-prefixes="f fn xs math">
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="3.0" 
+  xmlns:f="f.uri"
+  xmlns:fn="http://www.w3.org/2005/xpath-functions" 
+  xmlns:xs="http://www.w3.org/2001/XMLSchema"
+  xmlns:math="http://www.w3.org/2005/xpath-functions/math" 
+  exclude-result-prefixes="f fn xs math">
 
-<!--  test availability of functions within xsl:evaluate -->
+  <!--  test availability of functions within xsl:evaluate -->
 
-<xsl:param name="e1">true()</xsl:param>
-<xsl:param name="e2">concat('a', 'b')</xsl:param>
-<xsl:param name="e3">fn:position()</xsl:param>
-<xsl:param name="e4">xs:integer('3')</xsl:param>
-<xsl:param name="e5">f:square(5)</xsl:param>
-<xsl:param name="e6">math:max(5,2)</xsl:param>
-    
+  <xsl:param name="e1">true()</xsl:param>
+  <xsl:param name="e2">concat('a', 'b')</xsl:param>
+  <xsl:param name="e3">fn:position()</xsl:param>
+  <xsl:param name="e4">xs:integer('3')</xsl:param>
+  <xsl:param name="e5">f:square(5)</xsl:param>
+  <xsl:param name="e6">math:pow(12,3)</xsl:param>
+
   <xsl:template name="main">
     <out>
       <a><xsl:evaluate xpath="($e1)"/></a>
@@ -23,14 +23,12 @@
       <a><xsl:evaluate xpath="($e5)"/></a>
       <a><xsl:evaluate xpath="($e6)"/></a>
     </out>
-      
+
   </xsl:template>
-  
+
   <xsl:function name="f:square" as="xs:integer">
     <xsl:param name="x" as="xs:integer"/>
     <xsl:sequence select="$x*$x"/>
   </xsl:function>
 
-
-  
 </xsl:stylesheet>
--- a/tests/insn/evaluate/evaluate-007.xsl	Sun Sep 14 19:20:21 2014 +0200
+++ b/tests/insn/evaluate/evaluate-007.xsl	Mon Sep 15 03:11:03 2014 +0200
@@ -2,8 +2,7 @@
 xmlns:f="f.uri"
 xmlns:fn="http://www.w3.org/2005/xpath-functions"
 xmlns:xs="http://www.w3.org/2001/XMLSchema"
-xmlns:math="java:java.lang.Math"
-exclude-result-prefixes="f fn xs math">
+exclude-result-prefixes="f fn xs">
 
 <!--  test calling current() within xsl:evaluate -->
 
--- a/tests/insn/evaluate/evaluate-008.xsl	Sun Sep 14 19:20:21 2014 +0200
+++ b/tests/insn/evaluate/evaluate-008.xsl	Mon Sep 15 03:11:03 2014 +0200
@@ -4,12 +4,14 @@
 <!-- bug 2859861 -->
 
 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-xmlns:Math="java:java.lang.Math" version="3.0">
+  xmlns:Math="java:java.lang.Math" version="3.0">
+  
   <xsl:output method="xml" encoding="UTF-8"/>
+  
   <xsl:template match="/" name="main">
     <Result>
       <xsl:evaluate xpath="'Math:abs(-1)'" use-when="function-available('Math:abs', 1)"/>
-      <xsl:sequence select="abs(-1)" use-when="not(function-available('Math:abs', 1))"/>
+      <xsl:evaluate xpath="'abs(-1)'" use-when="not(function-available('Math:abs', 1))"/>
     </Result>
   </xsl:template>
 </xsl:stylesheet> 
--- a/tests/insn/evaluate/evaluate-010.xsl	Sun Sep 14 19:20:21 2014 +0200
+++ b/tests/insn/evaluate/evaluate-010.xsl	Mon Sep 15 03:11:03 2014 +0200
@@ -24,7 +24,7 @@
       <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://saxon.sf.net/'}"
+            base-uri="{if (position() mod 2 = 0) then 'http://www.w3.org/' else 'http://example.com/'}"
                         schema-aware="{if (position() mod 3 = 0) then 'yes' else 'no'}">
              <xsl:with-param name="v" select="position() mod 5"/>
           </xsl:evaluate>
--- a/tests/insn/evaluate/evaluate-015.xsl	Sun Sep 14 19:20:21 2014 +0200
+++ b/tests/insn/evaluate/evaluate-015.xsl	Mon Sep 15 03:11:03 2014 +0200
@@ -1,4 +1,6 @@
-<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="3.0">
+<xsl:transform version="3.0"
+  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+  xmlns:eval="http://example.com/eval">
 
   <!-- Basic test of saxon:evaluate-node() -->
   <!-- Formerly saxon013 -->
@@ -18,5 +20,12 @@
   </xsl:template>
   
   <xsl:strip-space elements="*"/>
+  
+  <xsl:function name="eval:node">
+    <xsl:param name="node" as="element()" />
+    
+    <xsl:evaluate xpath="string($node)" base-uri="{base-uri($node)}" namespace-context="$node" />
+      
+  </xsl:function>
 
 </xsl:transform>
--- a/tests/insn/evaluate/evaluate-017.xsl	Sun Sep 14 19:20:21 2014 +0200
+++ b/tests/insn/evaluate/evaluate-017.xsl	Mon Sep 15 03:11:03 2014 +0200
@@ -3,24 +3,33 @@
 <!-- formerly test saxon037 -->
 
 <xsl:stylesheet version="3.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-xmlns:saxon="http://saxon.sf.net/" 
-xmlns:xs="http://www.w3.org/2001/XMLSchema" exclude-result-prefixes="saxon xs">
-
-<xsl:param name="exp" select="if (function-available('saxon:system-id', 0)) then 'saxon:system-id()' else 'string(())'"/>
-
-<xsl:variable name="id" as="xs:string">
-  <xsl:evaluate xpath="$exp" context-item="."/>
-</xsl:variable>
+   xmlns:saxon="http://saxon.sf.net/" 
+   xmlns:math="http://www.w3.org/2005/xpath-functions/math" 
+   xmlns:xs="http://www.w3.org/2001/XMLSchema" 
+   exclude-result-prefixes="saxon xs">
 
-<xsl:template match="/">
-<out>
-   <xsl:choose>
-   <xsl:when use-when="function-available('saxon:system-id', 0)" test="$id = saxon:system-id()">OK</xsl:when>
-   <xsl:when use-when="not(function-available('saxon:system-id', 0))" test="true()">OK</xsl:when>
-   <xsl:otherwise>TEST FAILED: <xsl:value-of select="saxon:system-id()"/></xsl:otherwise>
-   </xsl:choose>
-</out>
-</xsl:template>
+   <xsl:param name="exp" select="
+     if (function-available('saxon:system-id', 0))
+     then 'saxon:system-id()' 
+     else 'string(math:pow(12, 3))'"/>
+    
+   <xsl:variable name="id" as="xs:string">
+      <xsl:evaluate xpath="$exp" context-item="."/>
+   </xsl:variable>
+    
+   <xsl:template match="/" name="xsl:initial-template">
+
+      <out>      
+        <xsl:choose use-when="function-available('saxon:system-id', 0)">
+          <xsl:when test="$id = saxon:system-id()">OK</xsl:when>
+          <xsl:otherwise>TEST FAILED: <xsl:value-of select="saxon:system-id()"/></xsl:otherwise>
+        </xsl:choose>
+        <xsl:choose use-when="not(function-available('saxon:system-id', 0))">
+          <xsl:when test="'1728' = $id">OK</xsl:when>
+          <xsl:otherwise>TEST FAILED"/></xsl:otherwise>
+        </xsl:choose>
+      </out>
+   </xsl:template>
 
 </xsl:stylesheet>
 
--- a/tests/insn/evaluate/evaluate-022.xsl	Sun Sep 14 19:20:21 2014 +0200
+++ b/tests/insn/evaluate/evaluate-022.xsl	Mon Sep 15 03:11:03 2014 +0200
@@ -1,8 +1,11 @@
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="3.0" xmlns:f="f.uri"
-  xmlns:fn="http://www.w3.org/2005/xpath-functions" xmlns:xs="http://www.w3.org/2001/XMLSchema"
-  xmlns:math="java:java.lang.Math" exclude-result-prefixes="f fn xs math">
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="3.0" 
+  xmlns:f="f.uri"
+  xmlns:fn="http://www.w3.org/2005/xpath-functions"
+  xmlns:xs="http://www.w3.org/2001/XMLSchema"
+  xmlns:math="http://www.w3.org/2005/xpath-functions/math" 
+  exclude-result-prefixes="f fn xs math">
 
-  <!--  test type error on a function called within xsl:evaluate -->
+  <!--  test type error on function f:square called within xsl:evaluate -->
   <!-- formerly saxon9083-err -->
 
   <xsl:param name="e1">true()</xsl:param>
@@ -10,7 +13,7 @@
   <xsl:param name="e3">fn:position()</xsl:param>
   <xsl:param name="e4">xs:integer('3')</xsl:param>
   <xsl:param name="e5">f:square('5')</xsl:param>  <!-- type error -->
-  <xsl:param name="e6">math:max(5,2)</xsl:param>
+  <xsl:param name="e6">math:pow(12,3)</xsl:param>
 
   <xsl:template match="/">
     <out>
--- a/tests/insn/evaluate/evaluate-023.xsl	Sun Sep 14 19:20:21 2014 +0200
+++ b/tests/insn/evaluate/evaluate-023.xsl	Mon Sep 15 03:11:03 2014 +0200
@@ -1,6 +1,8 @@
 <?xml version="1.0"?>
-<xsl:stylesheet version="3.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-xmlns:xs="http://www.w3.org/2001/XMLSchema" exclude-result-prefixes="xs">
+<xsl:stylesheet version="3.0" 
+    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+    xmlns:xs="http://www.w3.org/2001/XMLSchema" 
+    exclude-result-prefixes="xs">
 
 <!-- Type error when xsl:evaluate returns wrong type  -->
 
--- a/tests/insn/evaluate/evaluate-024.xsl	Sun Sep 14 19:20:21 2014 +0200
+++ b/tests/insn/evaluate/evaluate-024.xsl	Mon Sep 15 03:11:03 2014 +0200
@@ -1,17 +1,13 @@
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="3.0"
-  xmlns:saxon="http://saxon.sf.net/" xmlns:f="f.uri"
-  xmlns:fn="http://www.w3.org/2005/xpath-functions" xmlns:xs="http://www.w3.org/2001/XMLSchema"
-  xmlns:math="java:java.lang.Math" exclude-result-prefixes="f fn xs math">
+<xsl:stylesheet version="3.0"
+  xmlns:fn="http://www.w3.org/2005/xpath-functions"
+  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+  xmlns:xs="http://www.w3.org/2001/XMLSchema" 
+  exclude-result-prefixes="xs fn">
 
   <!--  call position() when context item is undefined within xsl:evaluate -->
 
 
-  <xsl:param name="e1">true()</xsl:param>
-  <xsl:param name="e2">concat('a', 'b')</xsl:param>
   <xsl:param name="e3">fn:position()</xsl:param>
-  <xsl:param name="e4">xs:integer('3')</xsl:param>
-  <xsl:param name="e5">f:square('5')</xsl:param>
-  <xsl:param name="e6">math:max(5,2)</xsl:param>
 
   <xsl:template match="/">
     <out>
@@ -22,11 +18,4 @@
 
   </xsl:template>
 
-  <xsl:function name="f:square" as="xs:integer">
-    <xsl:param name="x" as="xs:integer"/>
-    <xsl:sequence select="$x*$x"/>
-  </xsl:function>
-
-
-
 </xsl:stylesheet>
--- a/tests/insn/evaluate/evaluate-025.xsl	Sun Sep 14 19:20:21 2014 +0200
+++ b/tests/insn/evaluate/evaluate-025.xsl	Mon Sep 15 03:11:03 2014 +0200
@@ -1,19 +1,8 @@
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="3.0"
-xmlns:f="f.uri"
-xmlns:fn="http://www.w3.org/2005/xpath-functions"
-xmlns:xs="http://www.w3.org/2001/XMLSchema"
-xmlns:math="java:java.lang.Math"
-exclude-result-prefixes="f fn xs math">
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="3.0">
 
 <!--  call @x when context item is undefined within xsl:evaluate -->
 
-
-<xsl:param name="e1">true()</xsl:param>
-<xsl:param name="e2">concat('a', 'b')</xsl:param>
 <xsl:param name="e3">@x</xsl:param>
-<xsl:param name="e4">xs:integer('3')</xsl:param>
-<xsl:param name="e5">f:square('5')</xsl:param>
-<xsl:param name="e6">math:max(5,2)</xsl:param>
     
   <xsl:template match="/">
     <out>
@@ -22,11 +11,4 @@
       
   </xsl:template>
   
-  <xsl:function name="f:square" as="xs:integer">
-    <xsl:param name="x" as="xs:integer"/>
-    <xsl:sequence select="$x*$x"/>
-  </xsl:function>
-
-
-  
 </xsl:stylesheet>
--- a/tests/insn/evaluate/evaluate-026.xsl	Sun Sep 14 19:20:21 2014 +0200
+++ b/tests/insn/evaluate/evaluate-026.xsl	Mon Sep 15 03:11:03 2014 +0200
@@ -1,19 +1,10 @@
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="3.0"
-xmlns:f="f.uri"
-xmlns:fn="http://www.w3.org/2005/xpath-functions"
-xmlns:xs="http://www.w3.org/2001/XMLSchema"
-xmlns:math="java:java.lang.Math"
-exclude-result-prefixes="f fn xs math">
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="3.0">
 
-<!--  set context item to a sequence of 2 items within xsl:evaluate -->
+  <!--  set context item to a sequence of 2 items within xsl:evaluate -->
 
 
-<xsl:param name="e1">true()</xsl:param>
-<xsl:param name="e2">concat('a', 'b')</xsl:param>
-<xsl:param name="e3">@x</xsl:param>
-<xsl:param name="e4">xs:integer('3')</xsl:param>
-<xsl:param name="e5">f:square('5')</xsl:param>
-<xsl:param name="e6">math:max(5,2)</xsl:param>
+  <xsl:param name="e1">true()</xsl:param>
+  <xsl:param name="e3">@x</xsl:param>
     
   <xsl:template match="/">
     <out>
@@ -22,11 +13,4 @@
       
   </xsl:template>
   
-  <xsl:function name="f:square" as="xs:integer">
-    <xsl:param name="x" as="xs:integer"/>
-    <xsl:sequence select="$x*$x"/>
-  </xsl:function>
-
-
-  
 </xsl:stylesheet>
--- a/tests/insn/evaluate/evaluate-027.xsl	Sun Sep 14 19:20:21 2014 +0200
+++ b/tests/insn/evaluate/evaluate-027.xsl	Mon Sep 15 03:11:03 2014 +0200
@@ -1,23 +1,25 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <xsl:stylesheet version="3.0" 
 				xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-				xmlns:saxon="http://saxon.sf.net/"
 				xmlns:xs="http://www.w3.org/2001/XMLSchema"
 				xmlns="http://www.w3.org/1999/xhtml"
-				exclude-result-prefixes="saxon xs #default"
-				xpath-default-namespace="http://saxon097.uri/">
+				exclude-result-prefixes="xs #default"
+				xpath-default-namespace="http://unknown.uri/should/not/interfere/with/test">
 				
-				<!-- test xsl:evaluate using a second argument supplying a namespace context -->
+	<!-- test xsl:evaluate using a second argument supplying a namespace context -->
 				
 	<xsl:template match="/">
         <out>
-            <xsl:variable name="context" as="element()">
+            
+        	<xsl:variable name="context" as="element()">
               <a:a xmlns:a="http://a.uri/" xmlns:b="http://b.uri/" xmlns:c="http://c.uri/">
                 <xsl:namespace name="">http://d.uri/</xsl:namespace>
               </a:a>
             </xsl:variable>
-            <xsl:evaluate xpath="'/a:a/b:b/c:c/d/string()'" namespace-context="$context"
-                          context-item="/"/>
+        	
+            <xsl:evaluate xpath="'/a:a/b:b/c:c/d/string()'"
+                namespace-context="$context"
+                context-item="/"/>
         </out>
 	</xsl:template>
 	
--- a/tests/insn/evaluate/evaluate-039.xsl	Sun Sep 14 19:20:21 2014 +0200
+++ b/tests/insn/evaluate/evaluate-039.xsl	Mon Sep 15 03:11:03 2014 +0200
@@ -24,7 +24,7 @@
       <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://saxon.sf.net/'}"
+                        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'}">
              <xsl:with-param name="v" select="position() mod 5"/>
           </xsl:evaluate>