Bug 26543, added XSLT20 (with recovery option) and XSLT30+ version
authorabraaksm
Mon, 30 Mar 2015 20:35:06 +0200
changeset 898 d24fc7befec7
parent 897 bff5fe982eb5
child 899 334bf50b39d3
Bug 26543, added XSLT20 (with recovery option) and XSLT30+ version
tests/decl/override/override-f-017.xsl
tests/misc/error/_error-test-set.xml
tests/misc/error/error-0640e.xsl
--- a/tests/decl/override/override-f-017.xsl	Mon Mar 30 20:09:46 2015 +0200
+++ b/tests/decl/override/override-f-017.xsl	Mon Mar 30 20:35:06 2015 +0200
@@ -37,7 +37,7 @@
       <xsl:sequence select="'*' || $f($in, $count) || '*'"/>
     </xsl:function>
    
-    <xsl:template name="main">
+    <xsl:template name="xsl:initial-template">
       <xsl:choose>
         <xsl:when test="p:f('x', 5) = '*xxxxx*'"><ok/></xsl:when>
         <xsl:otherwise><wrong value="{p:f('x', 5)}"/></xsl:otherwise>
--- a/tests/misc/error/_error-test-set.xml	Mon Mar 30 20:09:46 2015 +0200
+++ b/tests/misc/error/_error-test-set.xml	Mon Mar 30 20:35:06 2015 +0200
@@ -4456,15 +4456,41 @@
       </result>
    </test-case>
 
-   <test-case name="error-0640e">
+   <test-case name="error-0640e-1">
       <description>Test use of variables in a key match pattern (XSLT 2.0) causing a circularity.
-      Result disputed for XSLT 3.0: see bug 26543.
-Was error-code-195.
-In general, a circularity in a stylesheet is a non-recoverable dynamic error.</description>
-      <created by="Michael Kay" on="2012-11-07"/>
+         See bug 26543 (in XSLT 2.0 this error can still be 'recovered').
+         Was error-code-195.
+         In general, a circularity in a stylesheet is a non-recoverable dynamic error.
+      </description>
+      <created by="Michael Kay" on="2012-11-07"/>
+      <modified by="Abel Braaksma" on="2015-03-30" change="Bug 26543, error not disputed anymore, but in XSLT 2.0 it may be ignored"/>
       <environment ref="error214"/>
       <dependencies>
-         <spec value="XSLT20+"/>
+         <spec value="XSLT20"/>
+      </dependencies>
+      <test>
+         <stylesheet file="error-0640e.xsl"/>
+      </test>
+      <result>
+         <any-of>
+            <!-- recovery action is to not match the pattern when an error occurs: -->
+            <assert-xml><![CDATA[<out total="0"/>]]></assert-xml>
+            <!-- or to report the error -->
+            <error code="XTDE0640"/>
+          </any-of>
+      </result>
+   </test-case>
+
+   <test-case name="error-0640e-2">
+      <description>Test use of variables in a key match pattern (XSLT 2.0) causing a circularity.
+         See bug 26543 (not disputed anymore for XSLT 3.0).
+         Was error-code-195.
+         In general, a circularity in a stylesheet is a non-recoverable dynamic error.
+      </description>
+      <created by="Abel Braaksma" on="2015-03-30"/>
+      <environment ref="error214"/>
+      <dependencies>
+         <spec value="XSLT30+"/>
       </dependencies>
       <test>
          <stylesheet file="error-0640e.xsl"/>
--- a/tests/misc/error/error-0640e.xsl	Mon Mar 30 20:09:46 2015 +0200
+++ b/tests/misc/error/error-0640e.xsl	Mon Mar 30 20:35:06 2015 +0200
@@ -10,6 +10,7 @@
   <xsl:param name="p" select="key('k', '2')"/>
 
   <xsl:template match="/">
+      <!-- in 2.0, the key match may recover by not matching anything, resulting in 0 -->
       <out total="{sum(key('k', '2')/@value)}"/>
   </xsl:template>