Test creating a sizeable node-valued static variable (just to see what happens)
authorMichael Kay <mike@saxonica.com>
Fri, 14 Dec 2018 23:29:05 +0000
changeset 1922 4f5c77b4f645
parent 1921 a79687e3ef66
child 1923 fdb0348dc0cc
Test creating a sizeable node-valued static variable (just to see what happens)
tests/attr/static/_static-test-set.xml
tests/attr/static/static-028.xsl
--- a/tests/attr/static/_static-test-set.xml	Fri Dec 14 23:27:55 2018 +0000
+++ b/tests/attr/static/_static-test-set.xml	Fri Dec 14 23:29:05 2018 +0000
@@ -838,6 +838,25 @@
       </result>
    </test-case>
    
+   <test-case name="static-028">
+      <description>
+         A sizeable node-valued static variable
+      </description>
+      <keywords>static-variable</keywords>
+      <created by="Michael Kay" on="2018-11-19"/>
+      <dependencies>
+         <spec value="XSLT30+"/>
+      </dependencies>
+      <test>
+         <stylesheet file="static-028.xsl"/>
+      </test>
+      <result>
+         <all-of>
+            <assert>/result/@count = '1000'</assert>
+         </all-of>
+      </result>
+   </test-case>
+   
 
 
 </test-set>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/attr/static/static-028.xsl	Fri Dec 14 23:29:05 2018 +0000
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="3.0">
+
+   <!-- Tests a sizeable node-valued static variable -->
+   
+   <xsl:variable name="tree" select="parse-xml('&lt;doc>' || string-join((1 to 1000)!('&lt;e>' || . || '&lt;/e>')) || '&lt;/doc>')" static="true"/>
+   
+   <xsl:template name="xsl:initial-template">
+      <result count="{count($tree//e)}"/>
+   </xsl:template>
+   
+</xsl:transform>