New streaming test case prompted by Saxon bug 2550
authorMichael Kay <mike@saxonica.com>
Mon, 28 Dec 2015 17:55:56 +0000
changeset 1196 1d6926487cf1
parent 1195 db4cdc265c27
child 1197 d300f98a5bb8
New streaming test case prompted by Saxon bug 2550
tests/strm/si-element/_si-element-test-set.xml
tests/strm/si-element/si-element-A.xsl
--- a/tests/strm/si-element/_si-element-test-set.xml	Mon Dec 28 17:55:03 2015 +0000
+++ b/tests/strm/si-element/_si-element-test-set.xml	Mon Dec 28 17:55:56 2015 +0000
@@ -351,6 +351,18 @@
       </result>
    </test-case>
    
+   <test-case name="si-element-049">
+      <description>Use xsl:element: reproduce Saxon bug 2550 in XSLT</description>
+      <created by="Michael Kay" on="2015-12-22"/>
+      <environment ref="si-element-A"/>
+      <test>
+         <initial-template name="cy-049"/>
+      </test>
+      <result>
+         <assert>/out/*:description[namespace-uri()='http://www.opengis.net/gml']</assert>
+      </result>
+   </test-case>
+   
    <test-case name="si-element-101">
       <description>Use xsl:element: schema-aware, validation=strict</description>
       <created by="Michael Kay" on="2013-12-19"/>
--- a/tests/strm/si-element/si-element-A.xsl	Mon Dec 28 17:55:03 2015 +0000
+++ b/tests/strm/si-element/si-element-A.xsl	Mon Dec 28 17:55:56 2015 +0000
@@ -442,6 +442,20 @@
       </xsl:stream>
     </out>
   </xsl:template>
+  
+  <!-- within xsl:stream, use xsl:element (XSLT equivalent of test case in Saxon bug 2550 -->
+  
+  <xsl:template name="cy-049" use-when="$RUN">
+    <out>
+      <xsl:stream href="../docs/citygml.xml">
+        <xsl:for-each select="*/*">
+          <xsl:element name="{name()}" namespace="{namespace-uri()}">
+            <xsl:copy-of select="node()"/>
+          </xsl:element>
+        </xsl:for-each>
+      </xsl:stream>
+    </out>
+  </xsl:template>