Bug 28421 and Bug 28422 plus some minor unreported fixes in the error-test-set.
authorabraaksm
Tue, 07 Apr 2015 07:33:26 +0200
changeset 927 8a0748001536
parent 926 5723baa5e5eb
child 928 8fe1cd834631
Bug 28421 and Bug 28422 plus some minor unreported fixes in the error-test-set.
tests/misc/error/_error-test-set.xml
tests/misc/error/error-1660a.xsl
tests/misc/error/error-1665a.xsl
tests/misc/error/error-2220a.xsl
--- a/tests/misc/error/_error-test-set.xml	Tue Apr 07 06:44:38 2015 +0200
+++ b/tests/misc/error/_error-test-set.xml	Tue Apr 07 07:33:26 2015 +0200
@@ -8402,12 +8402,17 @@
    </test-case>
 
    <test-case name="error-1495a">
-      <description>Error: It is a recoverable dynamic error
+      <description>
+         NOTE: this error has disappeared from the spec, in 2.0 it was a recoverable error XTRE1495.
+         See also: https://lists.w3.org/Archives/Member/w3c-xsl-wg/2012Oct/0038.html
+         
+         Error: It is a recoverable dynamic error
                      for a transformation to generate two or more final result trees with URIs that
                      identify the same physical resource. The optional recovery action is
                         implementation-dependent, since it may be impossible for the
                      processor to detect the error.</description>
       <created by="Michael Kay" on="2014-08-25"/>
+      <modified by="Abel Braaksma" on="2015-04-07" change="The test threw XTDE1495 through an xsl:message, but test expected XTRE1495. Error is not in the spec anymore."/>
       <dependencies>
          <spec value="XSLT30+"/>
       </dependencies>
@@ -8416,7 +8421,7 @@
          <initial-template name="main"/>
       </test>
       <result>
-         <error code="XTRE1495"/>
+         <error code="XTDE1495"/>
       </result>
    </test-case>
 
@@ -8741,8 +8746,10 @@
                            refers to a complex type definition and one or more of the items being copied
                            is an attribute node.</description>
       <created by="Michael Kay" on="2014-08-25"/>
-      <dependencies>
-         <spec value="XSLT30+"/>
+      <modified by="Abel Braaksma" on="2015-04-07" change="Test should be schema-aware"/>
+      <dependencies>
+         <spec value="XSLT30+"/>
+         <feature value="schema_aware"/>
       </dependencies>
       <test>
          <stylesheet file="error-1535a.xsl"/>
@@ -8752,6 +8759,29 @@
          <error code="XTTE1535"/>
       </result>
    </test-case>
+   
+
+   <test-case name="error-1535b">
+      <description>
+         Variant of prev. test for non-schema-aware processors (other error expected: XTSE1650)
+         Error: It is a type error if the
+                           value of the type attribute of an
+                           xsl:copy or xsl:copy-of instruction 
+                           refers to a complex type definition and one or more of the items being copied
+                           is an attribute node.</description>
+      <created by="Abel Braaksma" on="2015-04-07"/>
+      <dependencies>
+         <spec value="XSLT30+"/>
+         <feature value="schema_aware" satisfied="false" />
+      </dependencies>
+      <test>
+         <stylesheet file="error-1535a.xsl"/>
+         <initial-template name="main"/>
+      </test>
+      <result>
+         <error code="XTSE1650"/>
+      </result>
+   </test-case>
 
    <test-case name="error-1540a">
       <description>Generate error XTTE1540.
@@ -9183,6 +9213,7 @@
                      [xsl:]validation or default-validation attribute
                      with a value other than strip, preserve, or lax.</description>
       <created by="Michael Kay" on="2014-08-25"/>
+      <modified by="Abel Braaksma" on="2015-04-07" change="Error in stylesheet, namespace prefix not declared, fixed" />
       <dependencies>
          <spec value="XSLT30+"/>
          <feature value="schema_aware" satisfied="false"/>
@@ -9204,6 +9235,7 @@
                      atomic value of a type other than those which a basic XSLT processor
                      supports.</description>
       <created by="Michael Kay" on="2014-08-25"/>
+      <modified by="Abel Braaksma" on="2015-04-07" change="Bug 28421, no source specified, and this error is unraisable in a processor-independent way, fixed with xsl:assert"/>
       <dependencies>
          <spec value="XSLT30+"/>
          <feature value="schema_aware" satisfied="false"/>
@@ -9271,6 +9303,7 @@
                      instruction, unless the attribute sort-before-merge is present
                   with the value yes.</description>
       <created by="Michael Kay" on="2014-08-25"/>
+      <modified by="Abel Braaksma" on="2015-04-07" change="Bug 28422, merge source was not referenced, which may result in not raising the error. Fixed with current-merge-group"/>
       <dependencies>
          <spec value="XSLT30+"/>
       </dependencies>
--- a/tests/misc/error/error-1660a.xsl	Tue Apr 07 06:44:38 2015 +0200
+++ b/tests/misc/error/error-1660a.xsl	Tue Apr 07 07:33:26 2015 +0200
@@ -1,5 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="3.0"><!--A non-schema-aware processor
+<xsl:stylesheet 
+   xmlns:xs="http://www.w3.org/2001/XMLSchema"
+   xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="3.0">
+   <!--A non-schema-aware processor
                      must signal a static
                         error if the stylesheet
                      includes an [xsl:]type attribute, or an
--- a/tests/misc/error/error-1665a.xsl	Tue Apr 07 06:44:38 2015 +0200
+++ b/tests/misc/error/error-1665a.xsl	Tue Apr 07 07:33:26 2015 +0200
@@ -1,5 +1,10 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="3.0"><!--A non-schema-aware processor
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="3.0">
+   
+   <!--
+      NOTE: test deliberately throws an error by hand, because it is not possible to test this in a processor-independent way
+      
+         A non-schema-aware processor
                      must raise a non-recoverable dynamic error if the input to the processor
                      includes a node with a type annotation
                      other than xs:untyped or xs:untypedAtomic, or an
@@ -7,6 +12,7 @@
                      supports.-->
    <xsl:template name="main">
       <out>
+         <xsl:assert error-code="Q{{http://www.w3.org/2005/xqt-errors}}XTDE1665" test="false()" />
          <x/>
       </out>
    </xsl:template>
--- a/tests/misc/error/error-2220a.xsl	Tue Apr 07 06:44:38 2015 +0200
+++ b/tests/misc/error/error-2220a.xsl	Tue Apr 07 07:33:26 2015 +0200
@@ -20,8 +20,8 @@
            <xsl:merge-source name="b" select="reverse(1 to 50)">
              <xsl:merge-key select="."/>
            </xsl:merge-source>
-           <xsl:merge-action>
-             22
+           <xsl:merge-action expand-text="yes">
+             {current-merge-group()}
            </xsl:merge-action>
          </xsl:merge>
       </out>