Add a couple of streaming xsl:for-each-tests (Saxon bug cases)
authorMichael Kay <mike@saxonica.com>
Mon, 06 Jul 2015 11:43:41 +0100
changeset 1006 86a3eaa47e10
parent 1005 800d6241ce19
child 1007 22208a321c2a
Add a couple of streaming xsl:for-each-tests (Saxon bug cases)
tests/strm/si-for-each/_si-for-each-test-set.xml
tests/strm/si-for-each/si-for-each-801.xml
tests/strm/si-for-each/si-for-each-801.xsl
tests/strm/si-for-each/si-for-each-802.xsl
--- a/tests/strm/si-for-each/_si-for-each-test-set.xml	Thu Jul 02 22:34:32 2015 +0100
+++ b/tests/strm/si-for-each/_si-for-each-test-set.xml	Mon Jul 06 11:43:41 2015 +0100
@@ -159,6 +159,37 @@
            <assert-xml><![CDATA[<out xmlns="http://loan.shark.com/"><myroot/><ACERequest version="2.1"/><Deal/><Pool id="22"/><Loan/></out>]]></assert-xml>  
       </result>
    </test-case>
+   
+   <test-case name="si-for-each-801">
+      <description>Use streaming xsl:for-each referring to a global variable (Saxon bug 2412)</description>
+      <created by="Michael Kay" on="2015-07-04"/>
+      <environment>
+         <source file="si-for-each-801.xml" role="." streaming="true"/>
+      </environment>
+      <test>
+         <stylesheet file="si-for-each-801.xsl"/>
+         <param name="node-name" select="'record'"/>
+      </test>
+      <result>
+         <assert-xml><![CDATA[<root><found/><found/></root>]]></assert-xml>
+      </result>
+   </test-case>
+   
+   <test-case name="si-for-each-802">
+      <description>
+        Use streaming xsl:for-each referring to a global variable (Saxon bug 2412)
+        Same as -801 but using xsl:stream
+      </description>
+      <created by="Michael Kay" on="2015-07-04"/>
+      <test>
+         <stylesheet file="si-for-each-802.xsl"/>
+         <initial-template name="main"/>
+         <param name="node-name" select="'record'"/>
+      </test>
+      <result>
+         <assert-xml><![CDATA[<root><found/><found/></root>]]></assert-xml>
+      </result>
+   </test-case>
 
 
    <test-case name="si-for-each-806">
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/strm/si-for-each/si-for-each-801.xml	Mon Jul 06 11:43:41 2015 +0100
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<data>
+    <record>
+        <a>abc</a>
+        <b>def</b>
+    </record>
+    <record>
+        <a>abc</a>
+        <b>def</b>
+    </record>
+</data>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/strm/si-for-each/si-for-each-801.xsl	Mon Jul 06 11:43:41 2015 +0100
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
+    version="3.0">
+    <xsl:param name="node-name" required="yes"/>
+    <xsl:mode streamable="yes"/>
+    <xsl:template match="/">
+        <root>
+            <xsl:for-each select="//node()[name() = $node-name]">
+                <found/>
+            </xsl:for-each>
+        </root>
+    </xsl:template>
+</xsl:stylesheet>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/strm/si-for-each/si-for-each-802.xsl	Mon Jul 06 11:43:41 2015 +0100
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
+    version="3.0">
+    <xsl:param name="node-name" required="yes"/>
+    <xsl:mode streamable="yes"/>
+    <xsl:template name="main">
+      <xsl:stream href="si-for-each-801.xml">
+        <root>
+            <xsl:for-each select="//node()[name() = $node-name]">
+                <found/>
+            </xsl:for-each>
+        </root>
+      </xsl:stream>  
+    </xsl:template>
+</xsl:stylesheet>
\ No newline at end of file