Auto-merged heads.
authorMichael Kay <mike@saxonica.com>
Mon, 30 Mar 2015 08:50:58 +0100
changeset 889 04ec5ccfe4c4
parent 888 8b46519c1ab1 (current diff)
parent 887 88794d800d8f (diff)
child 890 ed40644d670a
Auto-merged heads.
--- a/tests/decl/output/_output-test-set.xml	Mon Mar 30 08:50:22 2015 +0100
+++ b/tests/decl/output/_output-test-set.xml	Mon Mar 30 08:50:58 2015 +0100
@@ -3,6 +3,17 @@
    xmlns="http://www.w3.org/2012/10/xslt-test-catalog" name="output">
 
    <description>Tests the xsl:output declaration, and hence serialization generally</description>
+   
+
+   <!-- 
+      NOTE: (ABr, 2015-03-30) added dependency on serialization feature for the whole
+      test-set, if tests are included here that should not need that feature, it 
+      should be overridden in the test, but I assumed that none exist because all 
+      tests here are about serialization
+   -->    
+   <dependencies>
+      <feature value="serialization" satisfied="true"/>
+   </dependencies>
 
    <environment name="output-01">
       <source role=".">
@@ -2276,9 +2287,14 @@
    </test-case>
 
    <test-case name="output-0177">
-      <description>Test for disabling output escaping in xsl:text</description>
+      <description>Test for disabling output escaping in xsl:text when not supported or switched off</description>
       <created by="Michael Kay" on="2012-10-30"/>
       <modified by="John Lumley" on="2014-09-02" change="Declared serialization requirement"/>
+      <modified by="Abel Braaksma" on="2015-03-30" change="
+         Bug 23896
+         - Fix to allow for optional recovery,
+         - changed to 2.0 only (error is not allowed in 3.0),
+         - added 3.0 version output-0177a"/>
       <environment ref="output-01"/>
       <dependencies>
          <spec value="XSLT20+"/>
@@ -2289,7 +2305,30 @@
          <output serialize="yes"/>
       </test>
       <result>
-         <error code="XTRE1620"/>
+         <any-of>
+            <!-- optional recovery option is to ignore it and not raise an error -->
+            <assert-serialization><![CDATA[<html xmlns="http://www.w3.org/1999/xhtml"><body>&lt;p&gt;&amp;nbsp;&lt;/p&gt;</body></html>]]></assert-serialization>
+            
+            <!-- or not recover and raise the error -->
+            <error code="XTRE1620"/>
+         </any-of>
+      </result>
+   </test-case>
+
+   <test-case name="output-0177a">
+      <description>Test for disabling output escaping in xsl:text for XSLT 3.0 when not supported or switched off (no error, must ignore d-o-e)</description>
+      <created by="Abel Braaksma" on="2015-03-30"/>
+      <environment ref="output-01"/>
+      <dependencies>
+         <spec value="XSLT30+"/>
+         <feature value="disabling_output_escaping" satisfied="false"/>
+      </dependencies>
+      <test>
+         <stylesheet file="output-0176.xsl"/>
+         <output serialize="yes"/>
+      </test>
+      <result>
+         <assert-serialization><![CDATA[<html xmlns="http://www.w3.org/1999/xhtml"><body>&lt;p&gt;&amp;nbsp;&lt;/p&gt;</body></html>]]></assert-serialization>
       </result>
    </test-case>
 
@@ -3990,9 +4029,14 @@
    </test-case>
 
    <test-case name="output-0402">
-      <description>Test for disabling output escaping in xsl:value-of</description>
+      <description>Test for disabling output escaping in xsl:value-of in XSLT 2.0</description>
       <created by="Michael Kay" on="2012-10-30"/>
       <modified by="John Lumley" on="2014-09-02" change="Declared serialization requirement"/>
+      <modified by="Abel Braaksma" on="2015-03-30" change="
+         Bug 23896
+         - Fix to allow for optional recovery,
+         - changed to 2.0 only (error is not allowed in 3.0),
+         - added 3.0 version output-0402a"/>
       <environment ref="output-04"/>
       <dependencies>
          <spec value="XSLT20+"/>
@@ -4003,7 +4047,31 @@
          <output serialize="yes"/>
       </test>
       <result>
-         <error code="XTRE1620"/>
+         <any-of>
+            <!-- recovery option: -->
+            <assert-serialization><![CDATA[<out xmlns="http://www.w3.org/1999/xhtml">&lt;p&gt;&amp;nbsp;&lt;/p&gt;</out>]]></assert-serialization>
+            <!-- or raise error -->
+            <error code="XTRE1620"/>
+         </any-of>
+      </result>
+   </test-case>
+
+   <test-case name="output-0402a">
+      <description>Test for disabling output escaping in XSLT 3.0 in xsl:value-of when feature is switched off or not available</description>
+      <created by="Abel Braaksma" on="2015-03-30"/>
+      <environment ref="output-04"/>
+      <dependencies>
+         <spec value="XSLT30+"/>
+         <feature value="disabling_output_escaping" satisfied="false"/>
+      </dependencies>
+      <test>
+         <stylesheet file="output-0401.xsl"/>
+         <output serialize="yes"/>
+      </test>
+      <result>
+         <any-of>
+            <assert-serialization><![CDATA[<out xmlns="http://www.w3.org/1999/xhtml">&lt;p&gt;&amp;nbsp;&lt;/p&gt;</out>]]></assert-serialization>
+         </any-of>
       </result>
    </test-case>
 
--- a/tests/misc/error/_error-test-set.xml	Mon Mar 30 08:50:22 2015 +0100
+++ b/tests/misc/error/_error-test-set.xml	Mon Mar 30 08:50:58 2015 +0100
@@ -8890,6 +8890,11 @@
                      disable-output-escaping attribute.
       </description>
       <created by="Michael Kay" on="2014-08-25"/>
+      <modified by="Abel Braaksma" on="2015-03-30" change="
+         Bug 23896
+         - Fix to allow for optional recovery,
+         - added serialize=yes
+         - added 3.0 version output-0402a"/>
       <dependencies>
          <spec value="XSLT20"/>
          <feature value="disabling_output_escaping" satisfied="false"/>
@@ -8897,9 +8902,34 @@
       <test>
          <stylesheet file="error-1620a.xsl"/>
          <initial-template name="main"/>
-      </test>
-      <result>
-         <error code="XTRE1620"/>
+         <output serialize="yes" />
+      </test>
+      <result>
+         <any-of>
+            <!-- recovery option -->
+            <assert-serialization><![CDATA[<out>&lt;a/&gt;</out>]]></assert-serialization>
+            <!-- or raise error -->
+            <error code="XTRE1620"/>
+         </any-of>
+      </result>
+   </test-case>
+
+   <test-case name="error-1620b">
+      <description>
+         Test that error XTRE1620 is NOT thrown in XSLT 3.0 when it does not support d-o-e and serialization is ON
+      </description>
+      <created by="Abel Braaksma" on="2015-03-30"/>
+      <dependencies>
+         <spec value="XSLT30+"/>
+         <feature value="disabling_output_escaping" satisfied="false"/>
+      </dependencies>
+      <test>
+         <stylesheet file="error-1620a.xsl"/>
+         <initial-template name="main"/>
+         <output serialize="yes" />
+      </test>
+      <result>
+         <assert-serialization><![CDATA[<out>&lt;a/&gt;</out>]]></assert-serialization>
       </result>
    </test-case>
 
@@ -8911,6 +8941,11 @@
                      disable-output-escaping attribute.
       </description>
       <created by="Michael Kay" on="2014-08-25"/>
+      <modified by="Abel Braaksma" on="2015-03-30" change="
+         Bug 23896
+         - Fix to allow for optional recovery,
+         - added serialize=no (was a TODO marking)
+         - added 3.0 version output-0402a"/>
       <dependencies>
          <spec value="XSLT20"/>
          <feature value="disabling_output_escaping" satisfied="false"/>
@@ -8918,10 +8953,34 @@
       <test>
          <stylesheet file="error-1630a.xsl"/>
          <initial-template name="main"/>
-      </test>
-      <!-- TODO: specify that the result of this stylesheet is not serialized -->
-      <result>
-         <error code="XTRE1630"/>
+         <output serialize="no"/>
+      </test>
+      <result>
+         <any-of>
+            <!-- recovery option -->
+            <assert-xml><![CDATA[<out>&lt;a/&gt;</out>]]></assert-xml>
+            <!-- or raise error -->
+            <error code="XTRE1630"/>
+         </any-of>
+      </result>
+   </test-case>
+
+   <test-case name="error-1630b">
+      <description>
+         Not an error (XSLT 3.0+ only), test that this error is NOT thrown when serializing is OFF and d-o-e is not supported.
+      </description>
+      <created by="Abel Braaksma" on="2015-03-30"/>
+      <dependencies>
+         <spec value="XSLT30+"/>
+         <feature value="disabling_output_escaping" satisfied="false"/>
+      </dependencies>
+      <test>
+         <stylesheet file="error-1630a.xsl"/>
+         <initial-template name="main"/>
+         <output serialize="no"/>
+      </test>
+      <result>
+         <assert-xml><![CDATA[<out>&lt;a/&gt;</out>]]></assert-xml>
       </result>
    </test-case>
 
--- a/tests/misc/error/error-1620a.xsl	Mon Mar 30 08:50:22 2015 +0100
+++ b/tests/misc/error/error-1620a.xsl	Mon Mar 30 08:50:58 2015 +0100
@@ -7,7 +7,7 @@
                   -->
    <xsl:template name="main">
       <out>
-         <xsl:value-of select="&lt;a/&gt;" disable-output-escaping="yes"/>
+         <xsl:value-of select="'&lt;a/&gt;'" disable-output-escaping="yes"/>
       </out>
    </xsl:template>
 </xsl:stylesheet>
--- a/tests/misc/error/error-1630a.xsl	Mon Mar 30 08:50:22 2015 +0100
+++ b/tests/misc/error/error-1630a.xsl	Mon Mar 30 08:50:58 2015 +0100
@@ -7,7 +7,7 @@
                   -->
    <xsl:template name="main">
       <out>
-         <xsl:value-of select="&lt;a/&gt;" disable-output-escaping="yes"/>
+         <xsl:value-of select="'&lt;a/&gt;'" disable-output-escaping="yes"/>
       </out>
    </xsl:template>
 </xsl:stylesheet>