New streaming xsl:iterate test
authorMichael Kay <mike@saxonica.com>
Mon, 18 Sep 2017 23:30:43 +0100
changeset 1759 97eef08c8f1d
parent 1758 6380162df04c
child 1760 748a74a64be2
New streaming xsl:iterate test
tests/strm/si-iterate/_si-iterate-test-set.xml
tests/strm/si-iterate/si-iterate-139.xml
tests/strm/si-iterate/si-iterate-139.xsl
--- a/tests/strm/si-iterate/_si-iterate-test-set.xml	Mon Sep 18 23:30:06 2017 +0100
+++ b/tests/strm/si-iterate/_si-iterate-test-set.xml	Mon Sep 18 23:30:43 2017 +0100
@@ -462,6 +462,20 @@
          </all-of>
       </result>
    </test-case>
+   
+   <test-case name="si-iterate-139">
+      <description>streaming xsl:iterate over overlapping snapshots, with xsl:break</description>
+      <created by="Michael Kay after David Rudel" on="2017-09-05"/>
+      <test>
+         <stylesheet file="si-iterate-139.xsl"/>
+      </test>
+      <result>
+         <all-of>
+            <assert>every $i in 1 to 101 satisfies exists(/data/out[@c=$i])</assert>
+            <assert>empty(/data/out[@c &gt; 101])</assert>
+         </all-of>
+      </result>
+   </test-case>
 
    <test-case name="si-iterate-806">
       <description>Use xsl:iterate within xsl:stream, //a/b is not guaranteed streamable in the spec, but streamable in Saxon</description>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/strm/si-iterate/si-iterate-139.xml	Mon Sep 18 23:30:43 2017 +0100
@@ -0,0 +1,243 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<a level="1">
+    <a level="2">
+        <a level="3"/>
+    </a>
+    <a level="2">
+        <a level="3"/>
+    </a>
+    <a level="2">
+        <a level="3"/>
+    </a>
+    <a level="2">
+        <a level="3"/>
+    </a>
+    <a level="2">
+        <a level="3"/>
+    </a>
+    <a level="2">
+        <a level="3"/>
+    </a>
+    <a level="2">
+        <a level="3"/>
+    </a>
+    <a level="2">
+        <a level="3"/>
+    </a>
+    <a level="2">
+        <a level="3"/>
+    </a>
+    <a level="2">
+        <a level="3"/>
+    </a>
+    <a level="2">
+        <a level="3"/>
+    </a>
+    <a level="2">
+        <a level="3"/>
+    </a>
+    <a level="2">
+        <a level="3"/>
+    </a>
+    <a level="2">
+        <a level="3"/>
+    </a>
+    <a level="2">
+        <a level="3"/>
+    </a>
+    <a level="2">
+        <a level="3"/>
+    </a>
+    <a level="2">
+        <a level="3"/>
+    </a>
+    <a level="2">
+        <a level="3"/>
+    </a>
+    <a level="2">
+        <a level="3"/>
+    </a>
+    <a level="2">
+        <a level="3"/>
+    </a>
+    <a level="2">
+        <a level="3"/>
+    </a>
+    <a level="2">
+        <a level="3"/>
+    </a>
+    <a level="2">
+        <a level="3"/>
+    </a>
+    <a level="2">
+        <a level="3"/>
+    </a>
+    <a level="2">
+        <a level="3"/>
+    </a>
+    <a level="2">
+        <a level="3"/>
+    </a>
+    <a level="2">
+        <a level="3"/>
+    </a>
+    <a level="2">
+        <a level="3"/>
+    </a>
+    <a level="2">
+        <a level="3"/>
+    </a>
+    <a level="2">
+        <a level="3"/>
+    </a>
+    <a level="2">
+        <a level="3"/>
+    </a>
+    <a level="2">
+        <a level="3"/>
+    </a>
+    <a level="2">
+        <a level="3"/>
+    </a>
+    <a level="2">
+        <a level="3"/>
+    </a>
+    <a level="2">
+        <a level="3"/>
+    </a>
+    <a level="2">
+        <a level="3"/>
+    </a>
+    <a level="2">
+        <a level="3"/>
+    </a>
+    <a level="2">
+        <a level="3"/>
+    </a>
+    <a level="2">
+        <a level="3"/>
+    </a>
+    <a level="2">
+        <a level="3"/>
+    </a>
+    <a level="2">
+        <a level="3"/>
+    </a>
+    <a level="2">
+        <a level="3"/>
+    </a>
+    <a level="2">
+        <a level="3"/>
+    </a>
+    <a level="2">
+        <a level="3"/>
+    </a>
+    <a level="2">
+        <a level="3"/>
+    </a>
+    <a level="2">
+        <a level="3"/>
+    </a>
+    <a level="2">
+        <a level="3"/>
+    </a>
+    <a level="2">
+        <a level="3"/>
+    </a>
+    <a level="2">
+        <a level="3"/>
+    </a>
+    <a level="2">
+        <a level="3"/>
+    </a>
+    <a level="2">
+        <a level="3"/>
+    </a>
+    <a level="2">
+        <a level="3"/>
+    </a>
+    <a level="2">
+        <a level="3"/>
+    </a>
+    <a level="2">
+        <a level="3"/>
+    </a>
+    <a level="2">
+        <a level="3"/>
+    </a>
+    <a level="2">
+        <a level="3"/>
+    </a>
+    <a level="2">
+        <a level="3"/>
+    </a>
+    <a level="2">
+        <a level="3"/>
+    </a>
+    <a level="2">
+        <a level="3"/>
+    </a>
+    <a level="2">
+        <a level="3"/>
+    </a>
+    <a level="2">
+        <a level="3"/>
+    </a>
+    <a level="2">
+        <a level="3"/>
+    </a>
+    <a level="2">
+        <a level="3"/>
+    </a>
+    <a level="2">
+        <a level="3"/>
+    </a>
+    <a level="2">
+        <a level="3"/>
+    </a>
+    <a level="2">
+        <a level="3"/>
+    </a>
+    <a level="2">
+        <a level="3"/>
+    </a>
+    <a level="2">
+        <a level="3"/>
+    </a>
+    <a level="2">
+        <a level="3"/>
+    </a>
+    <a level="2">
+        <a level="3"/>
+    </a>
+    <a level="2">
+        <a level="3"/>
+    </a>
+    <a level="2">
+        <a level="3"/>
+    </a>
+    <a level="2">
+        <a level="3"/>
+    </a>
+    <a level="2">
+        <a level="3"/>
+    </a>
+    <a level="2">
+        <a level="3"/>
+    </a>
+    <a level="2">
+        <a level="3"/>
+    </a>
+    <a level="2">
+        <a level="3"/>
+    </a>
+    <a level="2">
+        <a level="3"/>
+    </a>
+    <a level="2">
+        <a level="3"/>
+    </a>
+    <a level="2">
+        <a level="3"/>
+    </a>
+</a>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/strm/si-iterate/si-iterate-139.xsl	Mon Sep 18 23:30:43 2017 +0100
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
+    xmlns:xs="http://www.w3.org/2001/XMLSchema" 
+    xmlns:math="http://www.w3.org/2005/xpath-functions/math" 
+    exclude-result-prefixes="xs math" 
+    version="3.0">
+    
+    <xsl:template name="xsl:initial-template">
+            <data>
+                <xsl:source-document href="si-iterate-139.xml" streamable="true">
+                    <xsl:iterate select="snapshot(//a)">
+                        <xsl:param name="count" select="1"/>
+                        <out c="{$count}"/>
+                        <xsl:apply-templates select="."/>
+                        <xsl:choose>
+                            <xsl:when test="$count le 100">
+                                <xsl:next-iteration>
+                                    <xsl:with-param name="count" select="$count + 1"/>
+                                </xsl:next-iteration>
+                            </xsl:when>
+                            <xsl:otherwise>
+                                <xsl:break/>
+                            </xsl:otherwise>
+                        </xsl:choose>
+                    </xsl:iterate>
+                </xsl:source-document>
+            </data>
+
+    </xsl:template>
+    
+</xsl:stylesheet>
\ No newline at end of file