Bug 28429, bug 28355, error XTDE0610 is no more in 3.0, fix for error-xxx tests
authorabraaksm
Tue, 07 Apr 2015 19:12:40 +0200
changeset 934 192f37162a9b
parent 933 fd2351c8c0d6
child 935 5986713e5c76
Bug 28429, bug 28355, error XTDE0610 is no more in 3.0, fix for error-xxx tests
tests/misc/error/_error-test-set.xml
tests/misc/error/error-0610b.xsl
tests/misc/error/error-0610c.xsl
--- a/tests/misc/error/_error-test-set.xml	Tue Apr 07 17:55:55 2015 +0200
+++ b/tests/misc/error/_error-test-set.xml	Tue Apr 07 19:12:40 2015 +0200
@@ -4244,19 +4244,21 @@
    </test-case>
 
    <test-case name="error-0610a">
-      <description>Generate error XTDE0610.
-Was error-code-259.
-If an optional parameter has no select attribute and has an empty
-                        sequence constructor, and
-                     if there is an as attribute, then the default value of the
-                     parameter is an empty sequence. If the empty sequence is not a valid instance
-                     of the required type defined in the as attribute, then the
-                     parameter is treated as a required parameter, which means that it is a non-recoverable dynamic error if the
-                     caller supplies no value for the parameter.</description>
-      <created by="Michael Kay" on="2012-11-07"/>
-      <environment ref="error001"/>
-      <dependencies>
-         <spec value="XSLT20+"/>
+      <description>
+            Generate error XTDE0610 for a template param.
+            Was error-code-259.
+               If an optional parameter has no select attribute and has an empty
+               sequence constructor, and
+               if there is an as attribute, then the default value of the
+               parameter is an empty sequence. If the empty sequence is not a valid instance
+               of the required type defined in the as attribute, then the
+               parameter is treated as a required parameter, which means that it is a non-recoverable dynamic error if the
+               caller supplies no value for the parameter.</description>
+      <created by="Michael Kay" on="2012-11-07"/>
+      <modified by="Abel Braaksma" on="2015-04-07" change="Bug 28429 and 28355, this error was dropped in 3.0, test forked"/>
+      <environment ref="error001"/>
+      <dependencies>
+         <spec value="XSLT20"/>
       </dependencies>
       <test>
          <stylesheet file="error-0610a.xsl"/>
@@ -4267,22 +4269,52 @@
       </result>
    </test-case>
 
+
    <test-case name="error-0610b">
-      <description>Generate error XTDE0610 for a global parameter.
-Was error-code-410.
-If an optional parameter has no select attribute and has an empty
-                        sequence constructor, and
-                     if there is an as attribute, then the default value of the
-                     parameter is an empty sequence. If the empty sequence is not a valid instance
-                     of the required type defined in the as attribute, then the
-                     parameter is treated as a required parameter, which means that it is a non-recoverable dynamic error if the
-                     caller supplies no value for the parameter.</description>
+      <description>
+            XSLT 3.0: this error was dropped in favor of XTDE0700, see Bug 28355
+            Generate error XTDE0610 (=XTDE0700 now) for a template param.
+            Was error-code-259.
+               If an optional parameter has no select attribute and has an empty
+               sequence constructor, and
+               if there is an as attribute, then the default value of the
+               parameter is an empty sequence. If the empty sequence is not a valid instance
+               of the required type defined in the as attribute, then the
+               parameter is treated as a required parameter, which means that it is a non-recoverable dynamic error if the
+               caller supplies no value for the parameter.</description>
+      <created by="Abel Braaksma" on="2015-04-07"/>
+      <environment ref="error001"/>
+      <dependencies>
+         <spec value="XSLT30+"/>
+      </dependencies>
+      <test>
+         <stylesheet file="error-0610a.xsl"/>
+         <initial-template name="main"/>
+      </test>
+      <result>
+         <error code="XTDE0700"/>
+      </result>
+   </test-case>
+
+   <test-case name="error-0610c">
+      <description>
+            Generate error XTDE0610 for a global parameter.
+            Was error-code-410, was error-0610b
+               If an optional parameter has no select attribute and has an empty
+               sequence constructor, and
+               if there is an as attribute, then the default value of the
+               parameter is an empty sequence. If the empty sequence is not a valid instance
+               of the required type defined in the as attribute, then the
+               parameter is treated as a required parameter, which means that it is a non-recoverable dynamic error if the
+               caller supplies no value for the parameter.
+      </description>
       <created by="Colin Adams" on="2012-11-07"/>
-      <dependencies>
-         <spec value="XSLT20+"/>
-      </dependencies>
-      <test>
-         <stylesheet file="error-0610b.xsl"/>
+      <modified by="Abel Braaksma" on="2015-04-07" change="Bug 28429 and 28355, this error was dropped in 3.0"/>
+      <dependencies>
+         <spec value="XSLT20"/>
+      </dependencies>
+      <test>
+         <stylesheet file="error-0610c.xsl"/>
          <initial-template name="initial"/>
       </test>
       <result>
@@ -4290,6 +4322,32 @@
       </result>
    </test-case>
 
+   <test-case name="error-0610d">
+      <description>
+            XSLT 3.0: this error was dropped in favor of XTDE0700, see Bug 28355
+            Generate error XTDE0610 (=XTDE0700 now) for a global parameter.
+            Was error-code-410, was error-0610b
+               If an optional parameter has no select attribute and has an empty
+               sequence constructor, and
+               if there is an as attribute, then the default value of the
+               parameter is an empty sequence. If the empty sequence is not a valid instance
+               of the required type defined in the as attribute, then the
+               parameter is treated as a required parameter, which means that it is a non-recoverable dynamic error if the
+               caller supplies no value for the parameter.
+      </description>
+      <created by="Abel Braaksma" on="2015-04-07" />
+      <dependencies>
+         <spec value="XSLT30+"/>
+      </dependencies>
+      <test>
+         <stylesheet file="error-0610c.xsl"/>
+         <initial-template name="initial"/>
+      </test>
+      <result>
+         <error code="XTDE0700"/>
+      </result>
+   </test-case>
+
    <test-case name="error-0620a">
       <description>Error: xsl:variable - select attribute plus content.
 Was error-code-141.
--- a/tests/misc/error/error-0610b.xsl	Tue Apr 07 17:55:55 2015 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--If an optional parameter has no select attribute and has an empty
-                        sequence constructor, and
-                     if there is an as attribute, then the default value of the
-                     parameter is an empty sequence. If the empty sequence is not a valid instance
-                     of the required type defined in the as attribute, then the
-                     parameter is treated as a required parameter, which means that it is a non-recoverable dynamic error if the
-                     caller supplies no value for the parameter.-->
-<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-               xmlns:xs="http://www.w3.org/2001/XMLSchema"
-               version="2.0"
-               exclude-result-prefixes="xs">
-  <!-- Generate a data file with $records elements -->
-
-  <xsl:param name="records" as="xs:integer"/>
-
-  <xsl:template name="initial">
-      <xsl:result-document href="{$records}.xml">
-         <booklist>
-            <xsl:for-each select="(1 to $records)">
-               <book author="Frank Herbert030" title="Dune"/>
-            </xsl:for-each>
-         </booklist>
-      </xsl:result-document>
-  </xsl:template>
-</xsl:transform>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/misc/error/error-0610c.xsl	Tue Apr 07 19:12:40 2015 +0200
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--If an optional parameter has no select attribute and has an empty
+                        sequence constructor, and
+                     if there is an as attribute, then the default value of the
+                     parameter is an empty sequence. If the empty sequence is not a valid instance
+                     of the required type defined in the as attribute, then the
+                     parameter is treated as a required parameter, which means that it is a non-recoverable dynamic error if the
+                     caller supplies no value for the parameter.-->
+<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+               xmlns:xs="http://www.w3.org/2001/XMLSchema"
+               version="2.0"
+               exclude-result-prefixes="xs">
+  <!-- Generate a data file with $records elements -->
+
+  <xsl:param name="records" as="xs:integer"/>
+
+  <xsl:template name="initial">
+      <xsl:result-document href="{$records}.xml">
+         <booklist>
+            <xsl:for-each select="(1 to $records)">
+               <book author="Frank Herbert030" title="Dune"/>
+            </xsl:for-each>
+         </booklist>
+      </xsl:result-document>
+  </xsl:template>
+</xsl:transform>