Automated merge with bundle:/var/folders/zf/wthbvqt14q53jh5n3clx1yqw0000gn/T/SourceTreeTemp.tOSx85
authorMichael Kay <mike@saxonica.com>
Mon, 18 Sep 2017 23:36:30 +0100
changeset 1766 d4e04498c9dd
parent 1754 49040b3db77c (current diff)
parent 1765 c5ea6298057d (diff)
child 1767 281019a3837d
Automated merge with bundle:/var/folders/zf/wthbvqt14q53jh5n3clx1yqw0000gn/T/SourceTreeTemp.tOSx85
--- a/tests/attr/as/_as-test-set.xml	Wed Sep 06 15:58:19 2017 +0100
+++ b/tests/attr/as/_as-test-set.xml	Mon Sep 18 23:36:30 2017 +0100
@@ -3540,7 +3540,10 @@
       <description>Test type of global xsl:variable without @select and @as="element(QName, user-defined-union-type)". Sequence constructor contains a typed element from input file, or explicitly created xsl:element or LRE. Item types in the union are: -built-in primitive, built-in derived, user-defined atomic, list, mix of the above</description>
       <keywords>xsl:import-schema strict-validation user-defined-atomic-type ElementTest ElementName TypeName complex-type</keywords>
       <created by="Michael Kay" on="2012-10-30"/>
-      <environment ref="as-31"/>
+      <environment name="as-31">
+         <source role="." file="as-31.xml" validation="strict"/>
+         <schema role="source-reference" file="list-unionSchemaAs.xsd"/>
+      </environment>
       <dependencies>
          <spec value="XSLT20+"/>
          <feature value="schema_aware"/>
--- a/tests/attr/match/_match-test-set.xml	Wed Sep 06 15:58:19 2017 +0100
+++ b/tests/attr/match/_match-test-set.xml	Mon Sep 18 23:36:30 2017 +0100
@@ -4728,7 +4728,7 @@
    
    <test-case name="match-256">
       <description>Purpose: A match pattern in the form of a variable reference will only match nodes.</description>
-      <created by="Michael Kay" on="2017-01-09"/>
+      <created by="Michael Kay" on="2017-07-16"/>
       <dependencies>
          <spec value="XSLT30+"/>
       </dependencies>
--- a/tests/attr/match/match-256.xsl	Wed Sep 06 15:58:19 2017 +0100
+++ b/tests/attr/match/match-256.xsl	Mon Sep 18 23:36:30 2017 +0100
@@ -4,6 +4,18 @@
     <xsl:variable name="atomic" select="93"/>
     
     <!-- A match pattern in the form of a variable reference will only match nodes -->
+    
+    <!-- Analysis (MHK 2017-09-15). The semantics of this pattern are that it will match an item N if:
+        
+        N is a node, and the result of evaluating the expression root(.)//($atomic) with a singleton focus 
+        based on N is a sequence that includes the node N.
+        
+        Now, if N is a node, the result of this expression will be a sequence consisting of multiple occurrences
+        of the integer 93. This sequence does not include N, therefore the pattern does not match. There is no
+        dynamic error, and no type error, so no rule in the specification is violated and the most the processor
+        can do is to issue a warning.
+    -->
+    
     <xsl:template match="$atomic">
         <wrong/>
     </xsl:template>
--- a/tests/decl/override/_override-test-set.xml	Wed Sep 06 15:58:19 2017 +0100
+++ b/tests/decl/override/_override-test-set.xml	Mon Sep 18 23:36:30 2017 +0100
@@ -536,6 +536,18 @@
       </result>
    </test-case>
    
+   <test-case name="override-f-033">
+      <description>Call an overridden functions from an overridden function</description>
+      <created by="Michael Kay" on="2017-09-07"/>
+      <test>
+         <package file="override-f-033a.xsl" role="principal"/>
+         <package file="override-f-033b.xsl" role="secondary"/>
+      </test>
+      <result>
+         <assert>/out = "29"</assert>
+      </result>
+   </test-case>
+   
    
    <test-case name="override-t-001">
       <description>Successful override of a named template, when called from overriding package</description>
@@ -1353,8 +1365,12 @@
    <test-case name="override-misc-007">
       <description>Streamed accumulators in different packages can have the same name</description>
       <created by="Michael Kay" on="2015-03-01"/>
-      <modified by="Michael Kay" on="2014-08-22" change="spec change, @new-value->@select"/>
+      <modified by="Michael Kay" on="2015-08-22" change="spec change, @new-value->@select"/>
+      <modified by="Michael Kay" on="2017-09-11" change="add dependency on streaming"/>
       <environment ref="override-misc-F"/>
+      <dependencies>
+         <feature value="streaming"/>
+      </dependencies>
       <test>
          <package file="override-misc-007.xsl" role="principal"/>
          <initial-template name="main"/>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/decl/override/override-f-033a.xsl	Mon Sep 18 23:36:30 2017 +0100
@@ -0,0 +1,28 @@
+<xsl:package 
+  name="http://www.w3.org/xslt30tests/override-f-033a"
+  package-version="1.0.0"
+  version="3.0"
+  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+  xmlns:xs="http://www.w3.org/2001/XMLSchema"
+  xmlns:p="http://www.w3.org/xslt30tests/override-f-033b"
+  expand-text="yes"
+  exclude-result-prefixes="#all">
+  
+  <xsl:use-package name="http://www.w3.org/xslt30tests/override-f-033b" package-version="1.0.0">
+    <xsl:override>
+      <xsl:function name="p:f" as="xs:integer" visibility="public">
+        <xsl:param name="in" as="xs:integer*"/>
+        <xsl:sequence select="p:g() + (if (empty($in)) then 23 else head($in) + p:h(tail($in)))"/>
+      </xsl:function>
+      
+      <xsl:function name="p:g" as="xs:integer" visibility="public">
+        <xsl:sequence select="if (current-date() lt xs:date('1900-01-01')) then p:g()+1 else 0"/>
+      </xsl:function>
+    </xsl:override>
+  </xsl:use-package>
+  
+  <xsl:template name="xsl:initial-template">
+    <out>{p:f((1,2,3))}</out>
+  </xsl:template>
+  
+</xsl:package>   
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/decl/override/override-f-033b.xsl	Mon Sep 18 23:36:30 2017 +0100
@@ -0,0 +1,27 @@
+<xsl:package 
+  name="http://www.w3.org/xslt30tests/override-f-033b"
+  package-version="1.0.0"
+  version="3.0"
+  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+  xmlns:xs="http://www.w3.org/2001/XMLSchema"
+  xmlns:p="http://www.w3.org/xslt30tests/override-f-033b"
+  exclude-result-prefixes="#all">
+  
+  
+  
+    <xsl:function name="p:f" as="xs:integer" visibility="public">
+      <xsl:param name="in" as="xs:integer*"/>
+      <xsl:sequence select="p:g() + (if (empty($in)) then 0 else head($in) + p:h(tail($in)))"/>
+    </xsl:function>
+  
+    <xsl:function name="p:g" as="xs:integer" visibility="public">
+      <xsl:sequence select="61"/>
+    </xsl:function>
+  
+    <xsl:function name="p:h" as="xs:integer" visibility="public">
+      <xsl:param name="in" as="xs:integer*"/>
+      <xsl:sequence select="p:f($in)"/>
+    </xsl:function>  
+ 
+  
+</xsl:package>   
\ No newline at end of file
--- a/tests/decl/package/_package-test-set.xml	Wed Sep 06 15:58:19 2017 +0100
+++ b/tests/decl/package/_package-test-set.xml	Mon Sep 18 23:36:30 2017 +0100
@@ -112,9 +112,13 @@
    <test-case name="package-008">
       <description>An empty package with an xsl:output declaration</description>
       <created by="Abel Braaksma" on="2015-10-22"/>
+      <modified by="Michael Kay" on="2017-09-11" change="add serialization dependency"/>
       <environment>
          <source file="package-000.xml" uri="package-000.xml" role="."/>
       </environment>
+      <dependencies>
+         <feature value="serialization" satisfied="true"/>
+      </dependencies>
       <test>
          <package file="package-008.xsl" role="principal"/>
       </test>
--- a/tests/fn/function-available/_function-available-test-set.xml	Wed Sep 06 15:58:19 2017 +0100
+++ b/tests/fn/function-available/_function-available-test-set.xml	Mon Sep 18 23:36:30 2017 +0100
@@ -188,9 +188,11 @@
       <keywords>fn:function-available maps</keywords>
       <created by="Michael Kay" on="2016-03-21"/>
       <modified by="Michael Kay" on="2017-04-30" change="correction: sort#3 depends on HOF feature, sort#2 does not"/>
+      <modified by="Michael Kay" on="2017-09-04" change="add dependency on HOF feature"/>
       <environment ref="function-available-10"/>
       <dependencies>
          <spec value="XSLT20+"/>
+         <feature value="higher_order_functions"/>
       </dependencies>
       <test>
          <stylesheet file="function-available-1018.xsl"/>
--- a/tests/insn/copy/_copy-test-set.xml	Wed Sep 06 15:58:19 2017 +0100
+++ b/tests/insn/copy/_copy-test-set.xml	Mon Sep 18 23:36:30 2017 +0100
@@ -1655,6 +1655,44 @@
          <assert-xml><![CDATA[<out attr1="Hello&#xA;        Success&#xA;        &#xA;      More"/>]]></assert-xml>
       </result>
    </test-case>
+   
+   <test-case name="copy-3802">
+      <description>Test deep-equal on the result of a copy including comments, namespaces, etc</description>
+      <created by="Michael Kay" on="2017-09-15"/>
+      <environment ref="copy-38"/>
+      <dependencies>
+         <spec value="XSLT20+"/>
+      </dependencies>
+      <test>
+         <stylesheet file="copy-3802.xsl"/>
+      </test>
+      <result>
+         <all-of>
+            <assert>/out/a = "true"</assert>
+            <assert>/out/b = "true"</assert>
+         </all-of>
+      </result>
+   </test-case>
+   
+   <test-case name="copy-3803">
+      <description>Test parent and sibling axes work after deep copy</description>
+      <created by="Michael Kay" on="2017-09-15"/>
+      <environment ref="copy-38"/>
+      <dependencies>
+         <spec value="XSLT20+"/>
+      </dependencies>
+      <test>
+         <stylesheet file="copy-3803.xsl"/>
+      </test>
+      <result>
+         <all-of>
+            <assert>/out/a = "true"</assert>
+            <assert>/out/b = "true"</assert>
+            <assert>/out/c = "true"</assert>
+         </all-of>
+      </result>
+   </test-case>
+   
 
    <test-case name="copy-3901">
       <description>FileName: copy57 Document: http://www.w3.org/TR/xslt DocVersion: 19991116
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/insn/copy/copy-3802.xsl	Mon Sep 18 23:36:30 2017 +0100
@@ -0,0 +1,31 @@
+<?xml version="1.0"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
+
+<!-- Test deep-equal on the result of a copy including comments, whitespace, etc -->
+
+<xsl:output method="xml" indent="no" encoding="UTF-8"/>
+  
+  <xsl:variable name="deep-equal" static="yes" xmlns:saxon="http://saxon.sf.net/"
+    select="if (function-available('saxon:deep-equal', 4)) then saxon:deep-equal(?, ?, (), '?') else deep-equal#2"/>
+
+<xsl:template match="/">
+  <xsl:variable name="temp">
+    <z1>
+      <z2>
+        <z3>
+          <xsl:copy-of select="."/>
+        </z3>
+        <z4>
+          <xsl:copy-of select="./*"/>
+        </z4>
+      </z2>
+    </z1>
+  </xsl:variable>
+  <out>
+    <z><xsl:copy-of select="$temp"/></z>
+    <a><xsl:value-of select="$deep-equal($temp//z3/*, ./*)"/></a>
+    <b><xsl:value-of select="$deep-equal($temp//z4/*, ./*)"/></b>
+  </out>
+</xsl:template>
+
+</xsl:stylesheet>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/insn/copy/copy-3803.xsl	Mon Sep 18 23:36:30 2017 +0100
@@ -0,0 +1,30 @@
+<?xml version="1.0"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
+
+<!-- Test siblings and parent axes work after deep copy -->
+
+<xsl:output method="xml" indent="no" encoding="UTF-8"/>
+  
+  <xsl:variable name="deep-equal" static="yes" xmlns:saxon="http://saxon.sf.net/"
+    select="if (function-available('saxon:deep-equal', 4)) then saxon:deep-equal(?, ?, (), '?') else deep-equal#2"/>
+
+<xsl:template match="/">
+  <xsl:variable name="temp">
+    <z1>
+      <z2>
+        <z3/>
+        <xsl:copy-of select="."/>
+        <z4/>
+        <xsl:copy-of select="./*"/>
+      </z2>
+    </z1>
+  </xsl:variable>
+  <out>
+    <z><xsl:value-of select="$temp//z3/following-sibling::node()/('['||local-name(.)||']')"/></z>
+    <a><xsl:value-of select="deep-equal($temp//z3/following-sibling::node()/local-name(.), ('docs', 'z4', 'docs')) "/></a>
+    <b><xsl:value-of select="every $n in $temp//z2/node() satisfies $n/parent::* is $temp//z2"/></b>
+    <c><xsl:value-of select="deep-equal($temp//z2/node()[last()]!reverse(preceding-sibling::node()/local-name(.)), ('z4', 'docs', 'z3'))"/></c>
+  </out>
+</xsl:template>
+
+</xsl:stylesheet>
\ No newline at end of file
--- a/tests/insn/sort/_sort-test-set.xml	Wed Sep 06 15:58:19 2017 +0100
+++ b/tests/insn/sort/_sort-test-set.xml	Mon Sep 18 23:36:30 2017 +0100
@@ -1463,4 +1463,18 @@
       </result>
    </test-case>
    
+   <test-case name="sort-080">
+      <description>Attempt to sort a sequence containing untyped attributes and typed dates</description>
+      <created by="Michael Kay" on="2017-09-18"/>
+      <dependencies>
+         <spec value="XSLT30+"/>
+      </dependencies>
+      <test>
+         <stylesheet file="sort-080.xsl"/>
+      </test>
+      <result>
+         <error code="XTDE1030"/>
+      </result>
+   </test-case>
+   
 </test-set>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/insn/sort/sort-080.xsl	Mon Sep 18 23:36:30 2017 +0100
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="3.0" xmlns:f="http://f.com/"
+   xmlns:xs="http://www.w3.org/2001/XMLSchema" exclude-result-prefixes="#all" expand-text="true">
+   <!-- Purpose: Attempt to sort a sequence containing untyped attribute nodes and dates.-->
+   <!-- Should fail because "lt" comparison between xs:untypedAtomic and xs:date is not allowed. -->
+   
+   <xsl:variable name="in">
+      <e at="2017-01-05"/>
+      <e at="2014-01-02"/>
+      <e at="2016-03-02"/>     
+   </xsl:variable>
+
+   <xsl:template name="xsl:initial-template">
+      <out>
+         <xsl:for-each select="$in/e/@at, xs:date('2011-12-31')">
+            <xsl:sort select="."/>
+            <item>{.}</item>
+         </xsl:for-each>
+      </out>
+   </xsl:template>
+
+</xsl:transform>
--- a/tests/insn/source-document/_source-document-test-set.xml	Wed Sep 06 15:58:19 2017 +0100
+++ b/tests/insn/source-document/_source-document-test-set.xml	Mon Sep 18 23:36:30 2017 +0100
@@ -408,6 +408,28 @@
       </result>
    </test-case>
    
+   <test-case name="stream-205">
+      <description>Streamability issue with xsl:with-param</description>
+      <created by="Michael Kay after David Rudel" on="2017-08-31"/>
+      <test>
+         <stylesheet file="stream-205.xsl"/>
+      </test>
+      <result>
+         <assert-xml><![CDATA[<tba/>]]></assert-xml>
+      </result>
+   </test-case>
+   
+   <test-case name="stream-206">
+      <description>Streamability issue with xsl:with-param</description>
+      <created by="Michael Kay after David Rudel" on="2017-08-31"/>
+      <test>
+         <stylesheet file="stream-205.xsl"/>
+      </test>
+      <result>
+         <assert-xml><![CDATA[<tba/>]]></assert-xml>
+      </result>
+   </test-case>
+   
    <test-case name="stream-210">
       <description>xsl:source-document (streamable="yes")  reading the same input file more than once</description>
       <created by="Michael Kay after Martin Honnen" on="2016-02-19"/>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/insn/source-document/stream-205.xml	Mon Sep 18 23:36:30 2017 +0100
@@ -0,0 +1,183 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Data>
+    <school Genre="Comedy" 
+        Condition="New" 
+        Format="Paperback" 
+        Title="foo" 
+        Count="1"/>
+    <school Genre="Comedy" 
+        Condition="Old" 
+        Format="Paperback" 
+        Title="foo" 
+        Count="1"/>
+    <school Genre="Comedy" 
+        Condition="New" 
+        Format="Hardback" 
+        Title="foo" 
+        Count="1"/>
+    <school Genre="Comedy" 
+        Condition="Old" 
+        Format="Hardback" 
+        Title="foo" 
+        Count="1"/>
+    <school Genre="Drama" 
+        Condition="New" 
+        Format="Paperback" 
+        Title="foo" 
+        Count="1"/>
+    <school Genre="Drama" 
+        Condition="Old" 
+        Format="Paperback" 
+        Title="foo" 
+        Count="1"/>
+    <school Genre="Drama" 
+        Condition="New" 
+        Format="Hardback" 
+        Title="foo" 
+        Count="1"/>
+    <school Genre="Drama" 
+        Condition="Old" 
+        Format="Hardback" 
+        Title="foo" 
+        Count="1"/>
+    <school Genre="Fantasy" 
+        Condition="New" 
+        Format="Paperback" 
+        Title="foo" 
+        Count="1"/>
+    <school Genre="Fantasy" 
+        Condition="Old" 
+        Format="Paperback" 
+        Title="foo" 
+        Count="1"/>
+    <school Genre="Fantasy" 
+        Condition="New" 
+        Format="Hardback" 
+        Title="foo" 
+        Count="1"/>
+    <school Genre="Fantasy" 
+        Condition="Old" 
+        Format="Hardback" 
+        Title="foo" 
+        Count="1"/>
+    <school Genre="Comedy" 
+        Condition="New" 
+        Format="Paperback" 
+        Title="foo" 
+        Count="1"/>
+    <school Genre="Comedy" 
+        Condition="Old" 
+        Format="Paperback" 
+        Title="foo" 
+        Count="1"/>
+    <school Genre="Comedy" 
+        Condition="New" 
+        Format="Hardback" 
+        Title="foo" 
+        Count="1"/>
+    <school Genre="Comedy" 
+        Condition="Old" 
+        Format="Hardback" 
+        Title="foo" 
+        Count="1"/>
+    <school Genre="Drama" 
+        Condition="New" 
+        Format="Paperback" 
+        Title="foo" 
+        Count="1"/>
+    <school Genre="Drama" 
+        Condition="Old" 
+        Format="Paperback" 
+        Title="foo" 
+        Count="1"/>
+    <school Genre="Drama" 
+        Condition="New" 
+        Format="Hardback" 
+        Title="foo" 
+        Count="1"/>
+    <school Genre="Drama" 
+        Condition="Old" 
+        Format="Hardback" 
+        Title="foo" 
+        Count="1"/>
+    <school Genre="Fantasy" 
+        Condition="New" 
+        Format="Paperback" 
+        Title="foo" 
+        Count="1"/>
+    <school Genre="Fantasy" 
+        Condition="Old" 
+        Format="Paperback" 
+        Title="foo" 
+        Count="1"/>
+    <school Genre="Fantasy" 
+        Condition="New" 
+        Format="Hardback" 
+        Title="foo" 
+        Count="1"/>
+    <school Genre="Fantasy" 
+        Condition="Old" 
+        Format="Hardback" 
+        Title="foo" 
+        Count="1"/>
+    <school Genre="Comedy" 
+        Condition="New" 
+        Format="Paperback" 
+        Title="foo" 
+        Count="1"/>
+    <school Genre="Comedy" 
+        Condition="Old" 
+        Format="Paperback" 
+        Title="foo" 
+        Count="1"/>
+    <school Genre="Comedy" 
+        Condition="New" 
+        Format="Hardback" 
+        Title="foo" 
+        Count="1"/>
+    <school Genre="Comedy" 
+        Condition="Old" 
+        Format="Hardback" 
+        Title="foo" 
+        Count="1"/>
+    <school Genre="Drama" 
+        Condition="New" 
+        Format="Paperback" 
+        Title="foo" 
+        Count="1"/>
+    <school Genre="Drama" 
+        Condition="Old" 
+        Format="Paperback" 
+        Title="foo" 
+        Count="1"/>
+    <school Genre="Drama" 
+        Condition="New" 
+        Format="Hardback" 
+        Title="foo" 
+        Count="1"/>
+    <school Genre="Drama" 
+        Condition="Old" 
+        Format="Hardback" 
+        Title="foo" 
+        Count="1"/>
+    <school Genre="Fantasy" 
+        Condition="New" 
+        Format="Paperback" 
+        Title="foo" 
+        Count="1"/>
+    <school Genre="Fantasy" 
+        Condition="Old" 
+        Format="Paperback" 
+        Title="foo" 
+        Count="1"/>
+    <school Genre="Fantasy" 
+        Condition="New" 
+        Format="Hardback" 
+        Title="foo" 
+        Count="1"/>
+    <school Genre="Fantasy" 
+        Condition="Old" 
+        Format="Hardback" 
+        Title="foo" 
+        Count="1"/>
+</Data>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/insn/source-document/stream-205.xsl	Mon Sep 18 23:36:30 2017 +0100
@@ -0,0 +1,36 @@
+<?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:map="http://www.w3.org/2005/xpath-functions/map" xmlns:mf="http://example.com/mf" 
+    exclude-result-prefixes="#all" version="3.0">
+    
+    <xsl:variable name="segregation.map" as="map(*)">
+        <xsl:map>
+            <xsl:map-entry key="1" select="17"/>
+            <xsl:map-entry key="2" select="23"/>
+        </xsl:map>
+    </xsl:variable>
+    
+ <xsl:template name="xsl:initial-template">
+        <data>
+             <xsl:for-each select="map:keys($segregation.map)">
+                 <xsl:variable name="grade" select="."/>
+                 <xsl:for-each select="$segregation.map(.)">
+                     <xsl:variable name="assignment" select="."/>
+                     <xsl:source-document href="stream-205.xml" streamable="yes">
+                         <xsl:apply-templates select=".//school/copy-of(.)">
+                             <xsl:with-param name="grade" select="$grade"/>
+                             <xsl:with-param name="assignment" select="$assignment"/>
+                         </xsl:apply-templates>	
+                     </xsl:source-document>
+                 </xsl:for-each>
+             </xsl:for-each>
+         </data>          
+ </xsl:template>
+    
+    <xsl:template match="school">
+        <xsl:param name="grade"/>
+        <xsl:param name="assignment"/>
+        <a/>
+    </xsl:template>
+</xsl:stylesheet>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/insn/source-document/stream-206.xsl	Mon Sep 18 23:36:30 2017 +0100
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet version="3.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema"
+    >
+    
+    <xsl:template match="/" name="xsl:initial-template">
+        <data>
+            <xsl:for-each select="1">
+                <xsl:variable name="var" select="."/>
+                <xsl:source-document href="{'stream-205.xml'}" streamable="yes">
+                    <xsl:apply-templates select="/Data/school/copy-of(.)">
+                        <xsl:with-param name="assignment" select="$var"/>
+                    </xsl:apply-templates>	
+                </xsl:source-document>
+            </xsl:for-each>
+        </data>     
+    </xsl:template>
+    
+    <xsl:template match="a"/>
+    
+</xsl:stylesheet>
\ No newline at end of file
--- a/tests/misc/error/_error-test-set.xml	Wed Sep 06 15:58:19 2017 +0100
+++ b/tests/misc/error/_error-test-set.xml	Mon Sep 18 23:36:30 2017 +0100
@@ -5968,14 +5968,14 @@
    <test-case name="error-0905a">
       <description>Generate error XTDE0905.
 Was error-code-296.
-It is a non-recoverable dynamic
-                     error if the string value of the new namespace
+It is a non-recoverable dynamic error if the string value of the new namespace
                      node is not valid in the lexical space of the datatype xs:anyURI,
                      or if it is the string http://www.w3.org/2000/xmlns/.</description>
       <created by="Michael Kay" on="2012-11-07"/>
       <environment ref="error001"/>
       <dependencies>
          <spec value="XSLT20+"/>
+         <feature value="XSD_1.1" satisfied="false"/>
       </dependencies>
       <test>
          <stylesheet file="error-0905a.xsl"/>
@@ -5985,6 +5985,45 @@
          <error code="XTDE0905"/>
       </result>
    </test-case>
+   
+   <test-case name="error-0905b">
+      <description>No error XTDE0905 for XSD 1.1 (see bug 30180).
+         It is a non-recoverable dynamic error if the string value of the new namespace
+         node is not valid in the lexical space of the datatype xs:anyURI,
+         or if it is the string http://www.w3.org/2000/xmlns/.</description>
+      <created by="Michael Kay" on="2017-09-11"/>
+      <environment ref="error001"/>
+      <dependencies>
+         <spec value="XSLT20+"/>
+         <feature value="XSD_1.1" satisfied="true"/>
+      </dependencies>
+      <test>
+         <stylesheet file="error-0905a.xsl"/>
+         <initial-template name="main"/>
+      </test>
+      <result>
+         <assert>/*:out/namespace::ns="####"</assert>
+      </result>
+   </test-case>
+   
+   <test-case name="error-0905c">
+      <description>Generate error XTDE0905.
+         It is a non-recoverable dynamic error if the string value of the new namespace
+         node is not valid in the lexical space of the datatype xs:anyURI,
+         or if it is the string http://www.w3.org/2000/xmlns/.</description>
+      <created by="Michael Kay" on="2012-11-07"/>
+      <environment ref="error001"/>
+      <dependencies>
+         <spec value="XSLT20+"/>
+      </dependencies>
+      <test>
+         <stylesheet file="error-0905c.xsl"/>
+         <initial-template name="main"/>
+      </test>
+      <result>
+         <error code="XTDE0905"/>
+      </result>
+   </test-case>
 
    <test-case name="error-0910a">
       <description>Generate error XTSE0910.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/misc/error/error-0905c.xsl	Mon Sep 18 23:36:30 2017 +0100
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--It is a non-recoverable dynamic
+                     error if the string value of the new namespace
+                     node is not valid in the lexical space of the datatype xs:anyURI,
+                     or if it is the string http://www.w3.org/2000/xmlns/.-->
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                xmlns:xs="http://www.w3.org/2001/XMLSchema"
+                xmlns:my="http://my.com/"
+                version="2.0">
+
+<?error XTDE0905?>
+
+   <xsl:param name="p" select="'ns'"/>
+
+  <xsl:template name="main">
+      <my:out>
+        <xsl:namespace name="ns">http://www.w3.org/2000/xmlns/</xsl:namespace>
+      </my:out>
+  </xsl:template>
+  
+
+
+
+</xsl:stylesheet>
--- a/tests/strm/si-fork/_si-fork-test-set.xml	Wed Sep 06 15:58:19 2017 +0100
+++ b/tests/strm/si-fork/_si-fork-test-set.xml	Mon Sep 18 23:36:30 2017 +0100
@@ -636,6 +636,63 @@
       </result>
    </test-case>
    
+   <test-case name="si-fork-809">
+      <description>Streamable xsl:fork containing xsl:for-each-group (Saxon bug 3399)</description>
+      <created by="Michael Kay after Martin Honnen" on="2017-08-31"/>
+      <environment>
+         <source role="." file="si-fork-809.xml" streaming="true"/>
+      </environment>
+      <test>
+         <stylesheet file="si-fork-809.xsl"/>
+      </test>
+      <result>
+         <all-of>
+            <assert>count(/out/text()) = 12</assert>
+            <assert>/out/text()[1] = "Comedy, New, Paperback, 3"</assert>
+            <assert>/out/text()[2] = "Comedy, Old, Paperback, 3"</assert>
+            <assert>/out/text()[3] = "Comedy, New, Hardback, 3"</assert>
+            <assert>/out/text()[4] = "Comedy, Old, Hardback, 3"</assert>
+            <assert>/out/text()[5] = "Drama, New, Paperback, 3"</assert>
+         </all-of>
+      </result>
+   </test-case>
+   
+   <test-case name="si-fork-810">
+      <description>Streamable xsl:fork containing xsl:for-each-group (Saxon bug 3375) - simplified version of -808</description>
+      <created by="Michael Kay after Martin Honnen" on="2017-08-31"/>
+      <environment>
+         <source role="." file="si-fork-808.xml" streaming="true"/>
+      </environment>
+      <test>
+         <stylesheet file="si-fork-810.xsl"/>
+      </test>
+      <result>
+         <all-of>
+            <assert>/root/orderlist/item[@num="(a)"]/rest/@size = "2"</assert>
+            <assert>/root/orderlist/item[@num="(b)"]/rest/@size = "1"</assert>
+            <assert>/root/orderlist/item[@num="(c)"]/rest/@size = "7"</assert>
+         </all-of>
+      </result>
+   </test-case>
+   
+   <test-case name="si-fork-811">
+      <description>Streamable xsl:fork containing xsl:for-each-group (Saxon bug 3375) - simplified version of -808</description>
+      <created by="Michael Kay after Martin Honnen" on="2017-08-31"/>
+      <environment>
+         <source role="." file="si-fork-808.xml" streaming="true"/>
+      </environment>
+      <test>
+         <stylesheet file="si-fork-811.xsl"/>
+      </test>
+      <result>
+         <all-of>
+            <assert>/root/orderlist/item[@num="(a)"]/rest/@size = "1"</assert>
+            <assert>/root/orderlist/item[@num="(b)"]/rest/@size = "0"</assert>
+            <assert>/root/orderlist/item[@num="(c)"]/rest/@size = "6"</assert>
+         </all-of>
+      </result>
+   </test-case>
+   
    <test-case name="si-fork-901">
       <description>Non-streamable xsl:fork - returns streamed nodes</description>
       <keywords>multiple-xsl-sequence-children AxisStep striding XTSE3430 illegally-returning-streamed-nodes</keywords>
--- a/tests/strm/si-fork/si-fork-808.xsl	Wed Sep 06 15:58:19 2017 +0100
+++ b/tests/strm/si-fork/si-fork-808.xsl	Mon Sep 18 23:36:30 2017 +0100
@@ -16,7 +16,7 @@
         _streamability="{if ($STREAMABLE) then 'absorbing' else 'unclassified'}">
         <xsl:param name="input" as="node()*"/>
         <xsl:param name="level" as="xs:integer"/>
-        <xsl:where-populated>
+        <!--<xsl:where-populated>-->
             <orderlist type="manual">
                 <xsl:for-each-group select="$input" 
                     group-starting-with="*[@class = $prefix || $level]">
@@ -30,13 +30,12 @@
                                     <xsl:apply-templates select="node()[position() gt 2]"/>
                                 </para>                               
                             </xsl:sequence>
-                            <xsl:sequence select="mf:nest(current-group()[position() gt 1], $level + 1)" 
-                            />
+                            <xsl:sequence select="mf:nest(current-group()[position() gt 1], $level + 1)"/>                            
                         </xsl:fork>                     
                     </item>
                 </xsl:for-each-group>
             </orderlist>
-        </xsl:where-populated>
+        <!--</xsl:where-populated>-->
     </xsl:function>
     
     <xsl:template match="root">
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/strm/si-fork/si-fork-809.xml	Mon Sep 18 23:36:30 2017 +0100
@@ -0,0 +1,183 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Data>
+    <Entry Genre="Comedy" 
+        Condition="New" 
+        Format="Paperback" 
+        Title="foo" 
+        Count="1"/>
+    <Entry Genre="Comedy" 
+        Condition="Old" 
+        Format="Paperback" 
+        Title="foo" 
+        Count="1"/>
+    <Entry Genre="Comedy" 
+        Condition="New" 
+        Format="Hardback" 
+        Title="foo" 
+        Count="1"/>
+    <Entry Genre="Comedy" 
+        Condition="Old" 
+        Format="Hardback" 
+        Title="foo" 
+        Count="1"/>
+    <Entry Genre="Drama" 
+        Condition="New" 
+        Format="Paperback" 
+        Title="foo" 
+        Count="1"/>
+    <Entry Genre="Drama" 
+        Condition="Old" 
+        Format="Paperback" 
+        Title="foo" 
+        Count="1"/>
+    <Entry Genre="Drama" 
+        Condition="New" 
+        Format="Hardback" 
+        Title="foo" 
+        Count="1"/>
+    <Entry Genre="Drama" 
+        Condition="Old" 
+        Format="Hardback" 
+        Title="foo" 
+        Count="1"/>
+    <Entry Genre="Fantasy" 
+        Condition="New" 
+        Format="Paperback" 
+        Title="foo" 
+        Count="1"/>
+    <Entry Genre="Fantasy" 
+        Condition="Old" 
+        Format="Paperback" 
+        Title="foo" 
+        Count="1"/>
+    <Entry Genre="Fantasy" 
+        Condition="New" 
+        Format="Hardback" 
+        Title="foo" 
+        Count="1"/>
+    <Entry Genre="Fantasy" 
+        Condition="Old" 
+        Format="Hardback" 
+        Title="foo" 
+        Count="1"/>
+    <Entry Genre="Comedy" 
+        Condition="New" 
+        Format="Paperback" 
+        Title="foo" 
+        Count="1"/>
+    <Entry Genre="Comedy" 
+        Condition="Old" 
+        Format="Paperback" 
+        Title="foo" 
+        Count="1"/>
+    <Entry Genre="Comedy" 
+        Condition="New" 
+        Format="Hardback" 
+        Title="foo" 
+        Count="1"/>
+    <Entry Genre="Comedy" 
+        Condition="Old" 
+        Format="Hardback" 
+        Title="foo" 
+        Count="1"/>
+    <Entry Genre="Drama" 
+        Condition="New" 
+        Format="Paperback" 
+        Title="foo" 
+        Count="1"/>
+    <Entry Genre="Drama" 
+        Condition="Old" 
+        Format="Paperback" 
+        Title="foo" 
+        Count="1"/>
+    <Entry Genre="Drama" 
+        Condition="New" 
+        Format="Hardback" 
+        Title="foo" 
+        Count="1"/>
+    <Entry Genre="Drama" 
+        Condition="Old" 
+        Format="Hardback" 
+        Title="foo" 
+        Count="1"/>
+    <Entry Genre="Fantasy" 
+        Condition="New" 
+        Format="Paperback" 
+        Title="foo" 
+        Count="1"/>
+    <Entry Genre="Fantasy" 
+        Condition="Old" 
+        Format="Paperback" 
+        Title="foo" 
+        Count="1"/>
+    <Entry Genre="Fantasy" 
+        Condition="New" 
+        Format="Hardback" 
+        Title="foo" 
+        Count="1"/>
+    <Entry Genre="Fantasy" 
+        Condition="Old" 
+        Format="Hardback" 
+        Title="foo" 
+        Count="1"/>
+    <Entry Genre="Comedy" 
+        Condition="New" 
+        Format="Paperback" 
+        Title="foo" 
+        Count="1"/>
+    <Entry Genre="Comedy" 
+        Condition="Old" 
+        Format="Paperback" 
+        Title="foo" 
+        Count="1"/>
+    <Entry Genre="Comedy" 
+        Condition="New" 
+        Format="Hardback" 
+        Title="foo" 
+        Count="1"/>
+    <Entry Genre="Comedy" 
+        Condition="Old" 
+        Format="Hardback" 
+        Title="foo" 
+        Count="1"/>
+    <Entry Genre="Drama" 
+        Condition="New" 
+        Format="Paperback" 
+        Title="foo" 
+        Count="1"/>
+    <Entry Genre="Drama" 
+        Condition="Old" 
+        Format="Paperback" 
+        Title="foo" 
+        Count="1"/>
+    <Entry Genre="Drama" 
+        Condition="New" 
+        Format="Hardback" 
+        Title="foo" 
+        Count="1"/>
+    <Entry Genre="Drama" 
+        Condition="Old" 
+        Format="Hardback" 
+        Title="foo" 
+        Count="1"/>
+    <Entry Genre="Fantasy" 
+        Condition="New" 
+        Format="Paperback" 
+        Title="foo" 
+        Count="1"/>
+    <Entry Genre="Fantasy" 
+        Condition="Old" 
+        Format="Paperback" 
+        Title="foo" 
+        Count="1"/>
+    <Entry Genre="Fantasy" 
+        Condition="New" 
+        Format="Hardback" 
+        Title="foo" 
+        Count="1"/>
+    <Entry Genre="Fantasy" 
+        Condition="Old" 
+        Format="Hardback" 
+        Title="foo" 
+        Count="1"/>
+</Data>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/strm/si-fork/si-fork-809.xsl	Mon Sep 18 23:36:30 2017 +0100
@@ -0,0 +1,24 @@
+<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:param name="STREAMABLE" as="xs:boolean" static="yes" select="true()"/>
+    
+    <xsl:mode _streamable="{$STREAMABLE}"/>
+    
+    <xsl:output method="text"/>
+    
+    <xsl:template match="/">
+        <out>
+          <xsl:fork>
+            <xsl:for-each-group select="Data/Entry" composite="yes" group-by="@Genre, @Condition, @Format">
+                <xsl:value-of select="current-grouping-key(), sum(current-group()/@Count)" separator=", "/>
+                <br/>
+            </xsl:for-each-group>
+          </xsl:fork>
+        </out>
+    </xsl:template>
+    
+</xsl:stylesheet>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/strm/si-fork/si-fork-810.xsl	Mon Sep 18 23:36:30 2017 +0100
@@ -0,0 +1,53 @@
+<?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" xmlns:mf="http://example.com/mf" 
+    exclude-result-prefixes="xs math mf" version="3.0">
+    
+    <xsl:param name="STREAMABLE" static="yes" as="xs:boolean" select="true()"/>
+    
+    <xsl:param name="prefix" as="xs:string" select="'l'"/>
+    
+    <xsl:mode _streamable="{$STREAMABLE}" on-no-match="shallow-copy"/>
+    
+    <xsl:mode name="num" _streamable="{$STREAMABLE}"/>
+    
+    <xsl:function name="mf:nest" as="node()*" 
+        _streamability="{if ($STREAMABLE) then 'absorbing' else 'unclassified'}">
+        <xsl:param name="input" as="node()*"/>
+        <xsl:param name="level" as="xs:integer"/>
+        <xsl:where-populated>
+            <orderlist type="manual">
+                <xsl:for-each-group select="$input" 
+                    group-starting-with="*[@class = $prefix || $level]">
+                    <item>
+                        <xsl:fork>
+                            <xsl:sequence>
+                                <xsl:apply-templates select="node()[1]" mode="num"/>
+                            </xsl:sequence>
+                            <xsl:sequence>
+                                <para>
+                                    <xsl:apply-templates select="node()[position() gt 2]"/>
+                                </para>                               
+                            </xsl:sequence>
+                            <xsl:sequence>
+                                <rest size="{count(current-group())}"/>
+                            </xsl:sequence>
+                        </xsl:fork>                     
+                    </item>
+                </xsl:for-each-group>
+            </orderlist>
+        </xsl:where-populated>
+    </xsl:function>
+    
+    <xsl:template match="root">
+        <xsl:copy>
+            <xsl:sequence select="mf:nest(*, 1)"/>
+        </xsl:copy>
+    </xsl:template>
+    
+    <xsl:template match="*[matches(@class, $prefix || '[0-9]+')]/node()" mode="num">
+        <xsl:attribute name="num" select="replace(., '^\s+', '')"/>
+    </xsl:template>
+    
+</xsl:stylesheet>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/strm/si-fork/si-fork-811.xsl	Mon Sep 18 23:36:30 2017 +0100
@@ -0,0 +1,53 @@
+<?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" xmlns:mf="http://example.com/mf" 
+    exclude-result-prefixes="xs math mf" version="3.0">
+    
+    <xsl:param name="STREAMABLE" static="yes" as="xs:boolean" select="true()"/>
+    
+    <xsl:param name="prefix" as="xs:string" select="'l'"/>
+    
+    <xsl:mode _streamable="{$STREAMABLE}" on-no-match="shallow-copy"/>
+    
+    <xsl:mode name="num" _streamable="{$STREAMABLE}"/>
+    
+    <xsl:function name="mf:nest" as="node()*" 
+        _streamability="{if ($STREAMABLE) then 'absorbing' else 'unclassified'}">
+        <xsl:param name="input" as="node()*"/>
+        <xsl:param name="level" as="xs:integer"/>
+        <xsl:where-populated>
+            <orderlist type="manual">
+                <xsl:for-each-group select="$input" 
+                    group-starting-with="*[@class = $prefix || $level]">
+                    <item>
+                        <xsl:fork>
+                            <xsl:sequence>
+                                <xsl:apply-templates select="node()[1]" mode="num"/>
+                            </xsl:sequence>
+                            <xsl:sequence>
+                                <para>
+                                    <xsl:apply-templates select="node()[position() gt 2]"/>
+                                </para>                               
+                            </xsl:sequence>
+                            <xsl:sequence>
+                                <rest size="{count(current-group()[position() gt 1])}"/>
+                            </xsl:sequence>
+                        </xsl:fork>                     
+                    </item>
+                </xsl:for-each-group>
+            </orderlist>
+        </xsl:where-populated>
+    </xsl:function>
+    
+    <xsl:template match="root">
+        <xsl:copy>
+            <xsl:sequence select="mf:nest(*, 1)"/>
+        </xsl:copy>
+    </xsl:template>
+    
+    <xsl:template match="*[matches(@class, $prefix || '[0-9]+')]/node()" mode="num">
+        <xsl:attribute name="num" select="replace(., '^\s+', '')"/>
+    </xsl:template>
+    
+</xsl:stylesheet>
\ No newline at end of file
--- a/tests/strm/si-iterate/_si-iterate-test-set.xml	Wed Sep 06 15:58:19 2017 +0100
+++ b/tests/strm/si-iterate/_si-iterate-test-set.xml	Mon Sep 18 23:36:30 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:36:30 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:36:30 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