Stream ability issue with with-param identified by a Saxon user
authorMichael Kay <mike@saxonica.com>
Mon, 18 Sep 2017 23:35:20 +0100
changeset 1764 08291e5c3d8d
parent 1763 e1aee0df1de7
child 1765 c5ea6298057d
Stream ability issue with with-param identified by a Saxon user
tests/insn/source-document/_source-document-test-set.xml
tests/insn/source-document/stream-205.xml
tests/insn/source-document/stream-205.xsl
tests/insn/source-document/stream-206.xsl
--- a/tests/insn/source-document/_source-document-test-set.xml	Mon Sep 18 23:34:45 2017 +0100
+++ b/tests/insn/source-document/_source-document-test-set.xml	Mon Sep 18 23:35:20 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:35:20 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:35:20 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:35:20 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