More tests for secondary output sent to same URI as primary output
authorMichael Kay <mike@saxonica.com>
Wed, 27 Jun 2018 13:12:00 +0100
changeset 1862 901a01a62c7d
parent 1861 c33673636f1c
child 1863 c9ae740a896e
More tests for secondary output sent to same URI as primary output
tests/insn/result-document/_result-document-test-set.xml
tests/insn/result-document/multresult2.out
tests/insn/result-document/result-document-1004.xsl
tests/insn/result-document/result-document-1005.xsl
tests/insn/result-document/result-document-1006.xsl
--- a/tests/insn/result-document/_result-document-test-set.xml	Wed Jun 27 13:11:11 2018 +0100
+++ b/tests/insn/result-document/_result-document-test-set.xml	Wed Jun 27 13:12:00 2018 +0100
@@ -2126,7 +2126,7 @@
       </test>
       <result>
          <any-of>
-            <error code="XTRE1495"/>
+            <error code="XTRE1495"/> <!-- dropped in 3.0 -->
             <error code="XTDE1490"/>
          </any-of>
       </result>
@@ -2145,7 +2145,7 @@
       </test>
       <result>
          <any-of>
-            <error code="XTRE1495"/>
+            <error code="XTRE1495"/> <!-- dropped in 3.0 -->
             <error code="XTDE1490"/>
          </any-of>
       </result>
@@ -2164,7 +2164,61 @@
       </test>
       <result>
          <any-of>
-            <error code="XTRE1495"/>
+            <error code="XTRE1495"/> <!-- dropped in 3.0 -->
+            <error code="XTDE1490"/>
+         </any-of>
+      </result>
+   </test-case>
+   
+   <test-case name="result-document-1004">
+      <description> Test for two xsl:result-document instructions both using the principal output URI </description>
+      <created by="Michael Kay" on="2018-06-15"/>
+      <environment ref="result-document-02"/>
+      <dependencies>
+         <spec value="XSLT20+"/>
+      </dependencies>
+      <test>
+         <stylesheet file="result-document-1004.xsl"/>
+      </test>
+      <result>
+         <any-of>
+            <error code="XTRE1495"/> <!-- dropped in 3.0 -->
+            <error code="XTDE1490"/>
+         </any-of>
+      </result>
+   </test-case>
+   
+   <test-case name="result-document-1005">
+      <description> Test for nested xsl:result-document instructions implicitly using the principal output URI </description>
+      <created by="Michael Kay" on="2018-06-15"/>
+      <environment ref="result-document-02"/>
+      <dependencies>
+         <spec value="XSLT20+"/>
+      </dependencies>
+      <test>
+         <stylesheet file="result-document-1005.xsl"/>
+      </test>
+      <result>
+         <any-of>
+            <error code="XTRE1495"/> <!-- dropped in 3.0 -->
+            <error code="XTDE1490"/>
+         </any-of>
+      </result>
+   </test-case>
+   
+   <test-case name="result-document-1006">
+      <description> Test for nested xsl:result-document instructions explicitly using the principal output URI </description>
+      <created by="Michael Kay" on="2018-06-17"/>
+      <environment ref="result-document-02"/>
+      <dependencies>
+         <spec value="XSLT20+"/>
+      </dependencies>
+      <test>
+         <stylesheet file="result-document-1006.xsl"/>
+      </test>
+      <result>
+         <any-of>
+            <error code="XTRE1495"/> <!-- dropped in 3.0 -->
             <error code="XTDE1490"/>
          </any-of>
       </result>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/insn/result-document/multresult2.out	Wed Jun 27 13:12:00 2018 +0100
@@ -0,0 +1,1 @@
+This should come out as plain text.
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/insn/result-document/result-document-1004.xsl	Wed Jun 27 13:12:00 2018 +0100
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<t:transform xmlns:t="http://www.w3.org/1999/XSL/Transform" version="2.0">
+<!-- Purpose: Test for two xsl:result-document instructions both using the principal output URI -->
+
+   <t:output method="xhtml"/>
+
+   <t:template match="/">
+      <t:result-document>
+         <html>
+            <head/>
+            <body>First HTML doc in implict xsl:result-document</body>
+         </html>
+      </t:result-document>
+      <t:result-document href="">
+         <html>
+            <head/>
+            <body>Second HTML doc in explicit xsl:result-document</body>
+         </html>
+      </t:result-document>
+   </t:template>
+</t:transform>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/insn/result-document/result-document-1005.xsl	Wed Jun 27 13:12:00 2018 +0100
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<t:transform xmlns:t="http://www.w3.org/1999/XSL/Transform" version="2.0">
+<!-- Purpose: Test for nested xsl:result-document instruction using the principal output URI -->
+
+   <t:output method="xhtml"/>
+
+   <t:template match="/">
+      <out>
+         <t:result-document href="one.xml">
+            <one>
+               <t:result-document>
+                  <two/>
+               </t:result-document>
+            </one>
+         </t:result-document>
+      </out>
+   </t:template>
+</t:transform>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/insn/result-document/result-document-1006.xsl	Wed Jun 27 13:12:00 2018 +0100
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<t:transform xmlns:t="http://www.w3.org/1999/XSL/Transform" version="2.0">
+<!-- Purpose: Test for nested xsl:result-document instruction using the principal output URI -->
+
+   <t:output method="xhtml"/>
+
+   <t:template match="/">
+      <t:variable name="base-out" select="current-output-uri()"/>
+      <out>
+         <t:result-document href="one.xml">
+            <one>
+               <t:result-document href="{$base-out}">
+                  <two/>
+               </t:result-document>
+            </one>
+         </t:result-document>
+      </out>
+   </t:template>
+</t:transform>