Merge
authordebbie
Tue, 12 Aug 2014 17:19:55 +0100
changeset 611 bfaea3fa0825
parent 610 a011f2233862 (current diff)
parent 609 e22cfb3f8d09 (diff)
child 612 3c75608ebe25
Merge
--- a/catalog.xml	Tue Aug 12 17:18:55 2014 +0100
+++ b/catalog.xml	Tue Aug 12 17:19:55 2014 +0100
@@ -155,6 +155,7 @@
       <test-set name="sf-outermost" file="tests/strm/sf-outermost/_sf-outermost-test-set.xml"/>
       <test-set name="sf-remove" file="tests/strm/sf-remove/_sf-remove-test-set.xml"/>
       <test-set name="sf-reverse" file="tests/strm/sf-reverse/_sf-reverse-test-set.xml"/>
+      <test-set name="sf-snapshot" file="tests/strm/sf-snapshot/_sf-snapshot-test-set.xml"/>
       <test-set name="sf-string-join" file="tests/strm/sf-string-join/_sf-string-join-test-set.xml"/>
       <test-set name="sf-subsequence" file="tests/strm/sf-subsequence/_sf-subsequence-test-set.xml"/>
       <test-set name="sf-sum" file="tests/strm/sf-sum/_sf-sum-test-set.xml"/>
--- a/tests/attr/streamable/_streamable-test-set.xml	Tue Aug 12 17:18:55 2014 +0100
+++ b/tests/attr/streamable/_streamable-test-set.xml	Tue Aug 12 17:19:55 2014 +0100
@@ -499,6 +499,10 @@
       <keywords>fn:position xsl:result-document grounded-variable xsl:strip-space streamable-identity-transform motionless</keywords>
       <created by="Michael Kay" on="2012-11-07"/>
       <environment ref="loans"/>
+      <dependencies>
+         <feature value="schema_aware"/>
+         <feature value="streaming"/>
+      </dependencies>
       <test>
          <stylesheet file="streamable-021.xsl"/>
          <initial-template name="main"/>
@@ -1436,6 +1440,10 @@
       <keywords>fn:outermost xsl:for-each crawling-then-striding fn:position fn:upper-case ContextItemExpr nested-for-each</keywords>
       <created by="Michael Kay" on="2012-11-07"/>
       <environment ref="loans"/>
+      <dependencies>
+         <feature value="schema_aware"/>
+         <feature value="streaming"/>
+      </dependencies>
       <test>
          <stylesheet file="streamable-073.xsl"/>
          <initial-template name="main"/>
@@ -1510,6 +1518,10 @@
       <keywords>fn:count crawling xsl:for-each</keywords>
       <created by="Michael Kay" on="2012-11-07"/>
       <environment ref="loans"/>
+      <dependencies>
+         <feature value="schema_aware"/>
+         <feature value="streaming"/>
+      </dependencies>
       <test>
          <stylesheet file="streamable-077.xsl"/>
          <initial-template name="main"/>
@@ -1536,6 +1548,10 @@
       <keywords>xsl:for-each ancestor-axis climbing-then-grounded fn:name</keywords>
       <created by="Michael Kay" on="2012-11-07"/>
       <environment ref="loans"/>
+      <dependencies>
+         <feature value="schema_aware"/>
+         <feature value="streaming"/>
+      </dependencies>
       <test>
          <stylesheet file="streamable-078.xsl"/>
          <initial-template name="main"/>
@@ -1570,6 +1586,10 @@
       <keywords>ancestor-axis fn:name xsl:for-each climbing-then-grounded climbing-childless</keywords>
       <created by="Michael Kay" on="2012-11-07"/>
       <environment ref="loans"/>
+      <dependencies>
+         <feature value="schema_aware"/>
+         <feature value="streaming"/>
+      </dependencies>
       <test>
          <stylesheet file="streamable-080.xsl"/>
          <initial-template name="main"/>
@@ -1585,6 +1605,10 @@
       <keywords>fn:lang</keywords>
       <created by="Michael Kay" on="2012-11-07"/>
       <environment ref="loans"/>
+      <dependencies>
+         <feature value="schema_aware"/>
+         <feature value="streaming"/>
+      </dependencies>
       <test>
          <stylesheet file="streamable-081.xsl"/>
          <initial-template name="main"/>
@@ -1601,6 +1625,10 @@
       <keywords>fn:lang striding AxisStep</keywords>
       <created by="Michael Kay" on="2012-11-07"/>
       <environment ref="loans"/>
+      <dependencies>
+         <feature value="schema_aware"/>
+         <feature value="streaming"/>
+      </dependencies>
       <test>
          <stylesheet file="streamable-082.xsl"/>
          <initial-template name="main"/>
@@ -1616,6 +1644,10 @@
       <keywords>fn:lang choice-operand-group striding xsl:choose xsl:when xsl:otherwise AxisStep</keywords>
       <created by="Michael Kay" on="2012-11-07"/>
       <environment ref="loans"/>
+      <dependencies>
+         <feature value="schema_aware"/>
+         <feature value="streaming"/>
+      </dependencies>
       <test>
          <stylesheet file="streamable-083.xsl"/>
          <initial-template name="main"/>
@@ -1631,6 +1663,10 @@
       <keywords>IfExpr fn:lang choice-operand-group striding AxisStep</keywords>
       <created by="Michael Kay" on="2012-11-07"/>
       <environment ref="loans"/>
+      <dependencies>
+         <feature value="schema_aware"/>
+         <feature value="streaming"/>
+      </dependencies>
       <test>
          <stylesheet file="streamable-084.xsl"/>
          <initial-template name="main"/>
@@ -1646,6 +1682,10 @@
       <keywords>lre xsl:sequence striding AxisStep</keywords>
       <created by="Michael Kay" on="2012-11-07"/>
       <environment ref="loans"/>
+      <dependencies>
+         <feature value="schema_aware"/>
+         <feature value="streaming"/>
+      </dependencies>
       <test>
          <stylesheet file="streamable-085.xsl"/>
          <initial-template name="main"/>
@@ -1665,6 +1705,10 @@
       <keywords>fn:lang IfExpr choice-operand-group striding AxisStep lre</keywords>
       <created by="Michael Kay" on="2012-11-07"/>
       <environment ref="loans"/>
+      <dependencies>
+         <feature value="schema_aware"/>
+         <feature value="streaming"/>
+      </dependencies>
       <test>
          <stylesheet file="streamable-086.xsl"/>
          <initial-template name="main"/>
@@ -1680,6 +1724,10 @@
       <keywords>fn:lang IfExpr PathExpr choice-operand-group lre</keywords>
       <created by="Michael Kay" on="2012-11-07"/>
       <environment ref="loans"/>
+      <dependencies>
+         <feature value="schema_aware"/>
+         <feature value="streaming"/>
+      </dependencies>
       <test>
          <stylesheet file="streamable-087.xsl"/>
          <initial-template name="main"/>
@@ -1695,6 +1743,10 @@
       <keywords>_IMPROVE:fix-description ancestor-axis climbing-childless striding xsl:if GeneralComp</keywords>
       <created by="Michael Kay" on="2012-11-07"/>
       <environment ref="loans"/>
+      <dependencies>
+         <feature value="schema_aware"/>
+         <feature value="streaming"/>
+      </dependencies>
       <test>
          <stylesheet file="streamable-088.xsl"/>
          <initial-template name="main"/>
@@ -1710,6 +1762,10 @@
       <keywords>GeneralComp striding</keywords>
       <created by="Michael Kay" on="2012-11-07"/>
       <environment ref="loans"/>
+      <dependencies>
+         <feature value="schema_aware"/>
+         <feature value="streaming"/>
+      </dependencies>
       <test>
          <stylesheet file="streamable-089.xsl"/>
          <initial-template name="main"/>
@@ -1726,6 +1782,10 @@
       <keywords>GeneralComp striding</keywords>
       <created by="Michael Kay" on="2012-11-07"/>
       <environment ref="loans"/>
+      <dependencies>
+         <feature value="schema_aware"/>
+         <feature value="streaming"/>
+      </dependencies>
       <test>
          <stylesheet file="streamable-090.xsl"/>
          <initial-template name="main"/>
@@ -1742,6 +1802,10 @@
       <keywords>Expr striding PathExpr</keywords>
       <created by="Michael Kay" on="2012-11-07"/>
       <environment ref="loans"/>
+      <dependencies>
+         <feature value="schema_aware"/>
+         <feature value="streaming"/>
+      </dependencies>
       <test>
          <stylesheet file="streamable-091.xsl"/>
          <initial-template name="main"/>
@@ -1757,6 +1821,10 @@
       <keywords>xsl:value-of striding PathExpr</keywords>
       <created by="Michael Kay" on="2012-11-07"/>
       <environment ref="loans"/>
+      <dependencies>
+         <feature value="schema_aware"/>
+         <feature value="streaming"/>
+      </dependencies>
       <test>
          <stylesheet file="streamable-092.xsl"/>
          <initial-template name="main"/>
@@ -1772,6 +1840,10 @@
       <keywords>AxisStep xsl:sequence lre</keywords>
       <created by="Michael Kay" on="2012-11-07"/>
       <environment ref="loans"/>
+      <dependencies>
+         <feature value="schema_aware"/>
+         <feature value="streaming"/>
+      </dependencies>
       <test>
          <stylesheet file="streamable-093.xsl"/>
          <initial-template name="main"/>
--- a/tests/fn/snapshot/_snapshot-test-set.xml	Tue Aug 12 17:18:55 2014 +0100
+++ b/tests/fn/snapshot/_snapshot-test-set.xml	Tue Aug 12 17:19:55 2014 +0100
@@ -2,7 +2,7 @@
 <test-set xmlns:xs="http://www.w3.org/2001/XMLSchema"
           xmlns="http://www.w3.org/2012/10/xslt-test-catalog"
           name="snapshot">
-   <description>Tests the snapshot() function</description>
+   <description>Tests the snapshot() function (unstreamed)</description>
 
    <environment name="snapshot-01">
       <source role=".">
@@ -32,11 +32,7 @@
       </source>
    </environment>
 
-   
-   <!--<environment name="snapshot-02">
-      <source role="." file="snapshot-02.xml"/>
-   </environment>-->
-   
+
    <dependencies>
       <spec value="XSLT30+"/>
    </dependencies>
@@ -154,201 +150,4 @@
       </result>
    </test-case> 
    
-   <test-case name="snapshot-0201">
-      <description>Test snapshot() applied to individual node in streamed input</description>
-      <created by="Michael Kay" on="2013-11-12"/>
-      <test>
-         <stylesheet file="snapshot-0201.xsl"/>
-         <initial-template name="main"/>
-      </test>
-      <result>
-         <all-of>
-            <assert>count(/out/emp) = 13</assert>
-            <assert-xml><![CDATA[<out>
-   <emp name="Jane Doe 1" dept="sales" nr="E101" hours="40"/>
-   <emp name="John Doe 2" dept="sales" nr="E102" hours="70 20"/>
-   <emp name="Jane Doe 3" dept="sales" nr="E103" hours="80"/>
-   <emp name="John Doe 4" dept="sales" nr="E104" hours="20 40"/>
-   <emp name="Jane Doe 5" dept="sales" nr="E105" hours="20 30"/>
-   <emp name="John Doe 6" dept="customer-support" nr="E106" hours="12"/>
-   <emp name="Jane Doe 7" dept="customer-support" nr="E201" hours="40"/>
-   <emp name="John Doe 8" dept="customer-support" nr="E202" hours="80"/>
-   <emp name="Jane Doe 9" dept="customer-support" nr="E301" hours="20"/>
-   <emp name="John Doe 10" dept="finance" nr="E302" hours="20"/>
-   <emp name="Jane Doe 11" dept="finance" nr="E401" hours="20"/>
-   <emp name="John Doe 12" dept="finance" nr="E402" hours="40"/>
-   <emp name="Jane Doe 13" dept="finance" nr="E403" hours="80"/>
-</out>
-]]></assert-xml>           
-         </all-of>
-      </result>
-   </test-case>  
-   
-   <test-case name="snapshot-0202">
-      <description>Test snapshot() applied to sequence of nodes in streamed input</description>
-      <created by="Michael Kay" on="2013-11-12"/>
-      <test>
-         <stylesheet file="snapshot-0202.xsl"/>
-         <initial-template name="main"/>
-      </test>
-      <result>
-         <all-of>
-            <assert>/out</assert>
-            <assert-xml><![CDATA[<out>
-   <emp name="Jane Doe 1" dept="sales" nr="E101" hours="40"/>
-   <emp name="John Doe 2" dept="sales" nr="E102" hours="70 20"/>
-   <emp name="Jane Doe 3" dept="sales" nr="E103" hours="80"/>
-   <emp name="John Doe 4" dept="sales" nr="E104" hours="20 40"/>
-   <emp name="Jane Doe 5" dept="sales" nr="E105" hours="20 30"/>
-   <emp name="John Doe 6" dept="customer-support" nr="E106" hours="12"/>
-   <emp name="Jane Doe 7" dept="customer-support" nr="E201" hours="40"/>
-   <emp name="John Doe 8" dept="customer-support" nr="E202" hours="80"/>
-   <emp name="Jane Doe 9" dept="customer-support" nr="E301" hours="20"/>
-   <emp name="John Doe 10" dept="finance" nr="E302" hours="20"/>
-   <emp name="Jane Doe 11" dept="finance" nr="E401" hours="20"/>
-   <emp name="John Doe 12" dept="finance" nr="E402" hours="40"/>
-   <emp name="Jane Doe 13" dept="finance" nr="E403" hours="80"/>
-</out>
-]]></assert-xml>
-         </all-of>
-      </result>
-   </test-case>  
-   
-   <test-case name="snapshot-0203">
-      <description>Test snapshot() applied to a sequence of attribute nodes</description>
-      <created by="Michael Kay" on="2013-11-17"/>
-      <test>
-         <stylesheet file="snapshot-0203.xsl"/>
-         <initial-template name="main"/>
-      </test>
-      <result>
-         <all-of>
-            <assert>/out</assert>
-            <assert-xml><![CDATA[<out>
-   <emp name="Jane Doe 1" gender="female" dept="sales"/>
-   <emp name="John Doe 2" gender="male" dept="sales"/>
-   <emp name="Jane Doe 3" gender="female" dept="sales"/>
-</out>
-]]></assert-xml>
-         </all-of>
-      </result>
-   </test-case>  
-
-   <test-case name="snapshot-0204">
-      <description>Test snapshot() applied to a sequence of text nodes</description>
-      <created by="Michael Kay" on="2013-11-17"/>
-      <test>
-         <stylesheet file="snapshot-0204.xsl"/>
-         <initial-template name="main"/>
-      </test>
-      <result>
-         <all-of>
-            <assert>/out</assert>
-            <assert-xml><![CDATA[<out>
-   <emp name="Jane Doe 1" dept="sales" num="E101" gender="female"/>
-   <emp name="John Doe 6" dept="customer-support" num="E106" gender="male"/>
-   <emp name="John Doe 10" dept="finance" num="E302" gender="male"/>
-</out>
-]]></assert-xml>
-         </all-of>
-      </result>
-   </test-case> 
-   
-   <test-case name="snapshot-0205">
-      <description>Test snapshot() applied to a sequence of attribute nodes: unstreamed</description>
-      <created by="Michael Kay" on="2013-11-18"/>
-      <test>
-         <stylesheet file="snapshot-0205.xsl"/>
-         <initial-template name="main"/>
-      </test>
-      <result>
-         <all-of>
-            <assert>/out</assert>
-            <assert-xml><![CDATA[<out>
-   <emp name="Jane Doe 1" gender="female" dept="sales"/>
-   <emp name="John Doe 2" gender="male" dept="sales"/>
-   <emp name="Jane Doe 3" gender="female" dept="sales"/>
-</out>
-]]></assert-xml>
-         </all-of>
-      </result>
-   </test-case> 
-   
-   <test-case name="snapshot-0206">
-      <description>Test snapshot() applied to a subsequence of a sequence of attribute nodes: streamed</description>
-      <created by="Michael Kay" on="2013-11-18"/>
-      <test>
-         <stylesheet file="snapshot-0206.xsl"/>
-         <initial-template name="main"/>
-      </test>
-      <result>
-         <all-of>
-            <assert>/out</assert>
-            <assert-xml><![CDATA[<out>
-   <emp name="Jane Doe 1" gender="female" dept="sales"/>
-   <emp name="John Doe 2" gender="male" dept="sales"/>
-   <emp name="Jane Doe 3" gender="female" dept="sales"/>
-</out>
-]]></assert-xml>
-         </all-of>
-      </result>
-   </test-case>
-   
-   <test-case name="snapshot-0207">
-      <description>Test snapshot() applied to a sequence of text nodes with one removed</description>
-      <created by="Michael Kay" on="2013-11-18"/>
-      <test>
-         <stylesheet file="snapshot-0207.xsl"/>
-         <initial-template name="main"/>
-      </test>
-      <result>
-         <all-of>
-            <assert>/out</assert>
-            <assert-xml><![CDATA[<out>
-   <emp name="Jane Doe 1" dept="sales" num="E101" gender="female"/>
-   <emp name="John Doe 10" dept="finance" num="E302" gender="male"/>
-</out>
-]]></assert-xml>
-         </all-of>
-      </result>
-   </test-case>    
-   
-   <test-case name="snapshot-0208">
-      <description>Test snapshot() applied to a sequence of text nodes with one removed</description>
-      <created by="Michael Kay" on="2013-11-18"/>
-      <test>
-         <stylesheet file="snapshot-0208.xsl"/>
-         <initial-template name="main"/>
-      </test>
-      <result>
-         <all-of>
-            <assert>/out</assert>
-            <assert-xml><![CDATA[<out>
-   <emp name="Jane Doe 1" dept="sales" num="E101" gender="female"/>
-   <emp name="John Doe 10" dept="finance" num="E302" gender="male"/>
-</out>
-]]></assert-xml>
-         </all-of>
-      </result>
-   </test-case>       
-   
-   <test-case name="snapshot-0209">
-      <description>Test snapshot() applied to a sequence of element nodes with one removed</description>
-      <created by="Michael Kay" on="2013-11-18"/>
-      <test>
-         <stylesheet file="snapshot-0209.xsl"/>
-         <initial-template name="main"/>
-      </test>
-      <result>
-         <all-of>
-            <assert>/out</assert>
-            <assert-xml><![CDATA[<out>
-   <emp name="Jane Doe 1" dept="sales" num="E101" gender="female"/>
-   <emp name="John Doe 10" dept="finance" num="E302" gender="male"/>
-</out>
-]]></assert-xml>
-         </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/strm/docs/works.xml	Tue Aug 12 17:19:55 2014 +0100
@@ -0,0 +1,82 @@
+<?xml version="1.0"?>
+ <works>
+  <department name="sales">
+  <employee name="Jane Doe 1" gender="female">
+   <empnum>E101</empnum>
+   <pnum>P1</pnum>
+   <hours>40</hours>
+  </employee>
+  <employee name = "John Doe 2" gender="male">
+   <empnum>E102</empnum>
+   <pnum>P2</pnum>
+   <hours>70</hours>
+   <hours>20</hours>Text data from Employee[2]
+  </employee>
+  <employee name = "Jane Doe 3" gender="female">
+   <empnum>E103</empnum>
+   <pnum>P3</pnum>
+   <hours>80</hours>
+  </employee>
+  <employee name= "John Doe 4" gender="male">
+   <empnum>E104</empnum>
+   <pnum>P4</pnum>
+   <hours>20</hours>
+   <hours>40</hours>
+  </employee>
+  <employee name= "Jane Doe 5" gender="female">
+   <empnum>E105</empnum>
+   <pnum>P5</pnum>
+   <hours>20</hours>
+   <hours>30</hours>   
+  </employee>
+  </department>
+  <department name="customer-support">
+  <employee name= "John Doe 6" gender="male">
+   <empnum>E106</empnum>
+   <pnum>P6</pnum>
+   <hours>12</hours>
+  </employee>
+  <employee name= "Jane Doe 7" gender="female">
+   <empnum>E201</empnum>
+   <pnum>P1</pnum>
+   <hours>40</hours>
+  </employee>
+  <employee name= "John Doe 8" gender="male">
+   <empnum>E202</empnum>
+   <pnum>P2</pnum>
+   <hours>80</hours>
+  </employee>
+  <employee name= "Jane Doe 9" gender="female">
+   <empnum>E301</empnum>
+   <pnum>P2</pnum>
+   <hours>20</hours>
+  </employee>
+  </department>
+  <department name="finance">
+  <employee name= "John Doe 10" gender="male">
+   <empnum>E302</empnum>
+   <pnum>P2</pnum>
+   <hours>20</hours>
+  </employee>
+  <employee name= "Jane Doe 11" gender="female">
+   <empnum>E401</empnum>
+   <pnum>P2</pnum>
+   <hours>20</hours>
+  </employee>
+  <employee name= "John Doe 12" gender="male">
+   <empnum>E402</empnum>
+   <pnum>P4</pnum>
+   <hours>40</hours>
+   <overtime>
+     <day>Monday</day>
+     <day>Tuesday</day>
+   </overtime>
+  </employee>
+  <employee name= "Jane Doe 13" gender="female" type="FT">
+   <empnum>E403</empnum>
+   <pnum>P5</pnum>
+   <hours>80</hours>
+   <status>active</status>
+  </employee>
+  </department>
+ </works>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/strm/sf-snapshot/_sf-snapshot-test-set.xml	Tue Aug 12 17:19:55 2014 +0100
@@ -0,0 +1,320 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<test-set xmlns:xs="http://www.w3.org/2001/XMLSchema"
+          xmlns="http://www.w3.org/2012/10/xslt-test-catalog"
+          name="sf-snapshot">
+   <description>Tests the snapshot() function under streaming</description>
+
+   <environment name="snapshot-01">
+      <source role=".">
+         <content><![CDATA[ 
+<br:Bridge xmlns:gml="http://www.opengis.net/gml/3.2"
+                  xmlns:br="http://www.bridge.org"
+                 gml:id="Iowa-IllinoisMemorialBridge">
+   <gml:description>
+       The Interstate 74 Bridge, originally known as the Iowa-Illinois Memorial Bridge,
+       and often called The Twin Bridges, or the I-74 Bridge, is a pair of suspension
+       bridges that cross the Mississippi River and connect Bettendorf, Iowa and Moline, Illinois.
+   </gml:description>
+   <gml:identifier codeSpace="http://iowadot.gov">#8205,OL074  8205,OR074</gml:identifier>    
+   <gml:name>I-74 Bridge</gml:name>    
+   <gml:name>Twin Bridge</gml:name>
+   <gml:boundedBy>   
+       <gml:Envelope srsName="http://earth-info.nga.mil/GandG/wgs84/index.html">
+           <gml:lowerCorner>41.512674 -90.513161</gml:lowerCorner>
+           <gml:upperCorner>41.524113 -90.51299</gml:upperCorner>
+       </gml:Envelope>
+   </gml:boundedBy>
+   <br:length>3,372 feet (1,028 m)</br:length>
+   <br:width>27 feet (8 m)</br:width>
+   <br:spans>Mississippi River</br:spans>
+</br:Bridge>
+]]></content>
+      </source>
+   </environment>
+
+
+   <dependencies>
+      <spec value="XSLT30+"/>
+      <feature value="streaming"/>
+   </dependencies>
+   
+   
+
+   <test-case name="sf-snapshot-0101a">
+      <description>snapshot() applied to document node</description>
+      <created by="Michael Kay" on="2013-11-10"/>
+      <environment ref="snapshot-01"/>      
+      <test>
+         <stylesheet file="sf-snapshot-0101.xsl"/>
+         <initial-template name="a"/>
+      </test>
+      <result>
+         <assert>/ok</assert>
+      </result>
+   </test-case>
+   
+   <test-case name="sf-snapshot-0101b">
+      <description>snapshot() applied to outermost element node</description>
+      <created by="Michael Kay" on="2012-12-10"/>
+      <environment ref="snapshot-01"/>      
+      <test>
+         <stylesheet file="sf-snapshot-0101.xsl"/>
+         <initial-template name="b"/>
+      </test>
+      <result>
+         <all-of>
+            <assert>/ok</assert>
+            <assert>/ok/@doc = 'true'</assert>
+         </all-of>   
+      </result>
+   </test-case>
+   
+   <test-case name="sf-snapshot-0101c">
+      <description>snapshot() applied to a deeper element node</description>
+      <created by="Michael Kay" on="2012-12-10"/>
+      <environment ref="snapshot-01"/>      
+      <test>
+         <stylesheet file="sf-snapshot-0101.xsl"/>
+         <initial-template name="c"/>
+      </test>
+      <result>
+         <assert-xml><![CDATA[
+<br:Bridge xmlns:gml="http://www.opengis.net/gml/3.2"
+           xmlns:br="http://www.bridge.org"
+           gml:id="Iowa-IllinoisMemorialBridge"
+><gml:identifier codeSpace="http://iowadot.gov">#8205,OL074  8205,OR074</gml:identifier></br:Bridge>
+]]></assert-xml>           
+      </result>
+   </test-case>
+   
+   <test-case name="sf-snapshot-0102">
+      <description>Compare actual snapshot() results with the implementation in the spec</description>
+      <created by="Michael Kay" on="2014-08-11"/>
+      <environment ref="snapshot-01"/>   
+      <test>
+         <stylesheet file="sf-snapshot-0102.xsl"/>
+         <initial-template name="main"/>
+      </test>
+      <result>
+         <all-of>
+            <assert>/out</assert>
+            <assert>not(/out/wrong)</assert>
+         </all-of>
+      </result>
+   </test-case>
+   
+   <test-case name="sf-snapshot-0105">
+      <description>snapshot() applied to an empty sequence
+      </description>
+      <created by="Michael Kay" on="2013-11-12"/>
+      <environment ref="snapshot-01"/>   
+      <test>
+         <stylesheet file="sf-snapshot-0105.xsl"/>
+         <initial-template name="main"/>
+      </test>
+      <result>
+         <all-of>
+            <assert>/out</assert>
+            <assert>not(/out/node())</assert>
+         </all-of>
+      </result>
+   </test-case> 
+   
+   <test-case name="sf-snapshot-0201">
+      <description>Test snapshot() applied to individual node in streamed input</description>
+      <created by="Michael Kay" on="2013-11-12"/>
+      <test>
+         <stylesheet file="sf-snapshot-0201.xsl"/>
+         <initial-template name="main"/>
+      </test>
+      <result>
+         <all-of>
+            <assert>count(/out/emp) = 13</assert>
+            <assert-xml><![CDATA[<out>
+   <emp name="Jane Doe 1" dept="sales" nr="E101" hours="40"/>
+   <emp name="John Doe 2" dept="sales" nr="E102" hours="70 20"/>
+   <emp name="Jane Doe 3" dept="sales" nr="E103" hours="80"/>
+   <emp name="John Doe 4" dept="sales" nr="E104" hours="20 40"/>
+   <emp name="Jane Doe 5" dept="sales" nr="E105" hours="20 30"/>
+   <emp name="John Doe 6" dept="customer-support" nr="E106" hours="12"/>
+   <emp name="Jane Doe 7" dept="customer-support" nr="E201" hours="40"/>
+   <emp name="John Doe 8" dept="customer-support" nr="E202" hours="80"/>
+   <emp name="Jane Doe 9" dept="customer-support" nr="E301" hours="20"/>
+   <emp name="John Doe 10" dept="finance" nr="E302" hours="20"/>
+   <emp name="Jane Doe 11" dept="finance" nr="E401" hours="20"/>
+   <emp name="John Doe 12" dept="finance" nr="E402" hours="40"/>
+   <emp name="Jane Doe 13" dept="finance" nr="E403" hours="80"/>
+</out>
+]]></assert-xml>           
+         </all-of>
+      </result>
+   </test-case>  
+   
+   <test-case name="sf-snapshot-0202">
+      <description>Test snapshot() applied to sequence of nodes in streamed input</description>
+      <created by="Michael Kay" on="2013-11-12"/>
+      <test>
+         <stylesheet file="sf-snapshot-0202.xsl"/>
+         <initial-template name="main"/>
+      </test>
+      <result>
+         <all-of>
+            <assert>/out</assert>
+            <assert-xml><![CDATA[<out>
+   <emp name="Jane Doe 1" dept="sales" nr="E101" hours="40"/>
+   <emp name="John Doe 2" dept="sales" nr="E102" hours="70 20"/>
+   <emp name="Jane Doe 3" dept="sales" nr="E103" hours="80"/>
+   <emp name="John Doe 4" dept="sales" nr="E104" hours="20 40"/>
+   <emp name="Jane Doe 5" dept="sales" nr="E105" hours="20 30"/>
+   <emp name="John Doe 6" dept="customer-support" nr="E106" hours="12"/>
+   <emp name="Jane Doe 7" dept="customer-support" nr="E201" hours="40"/>
+   <emp name="John Doe 8" dept="customer-support" nr="E202" hours="80"/>
+   <emp name="Jane Doe 9" dept="customer-support" nr="E301" hours="20"/>
+   <emp name="John Doe 10" dept="finance" nr="E302" hours="20"/>
+   <emp name="Jane Doe 11" dept="finance" nr="E401" hours="20"/>
+   <emp name="John Doe 12" dept="finance" nr="E402" hours="40"/>
+   <emp name="Jane Doe 13" dept="finance" nr="E403" hours="80"/>
+</out>
+]]></assert-xml>
+         </all-of>
+      </result>
+   </test-case>  
+   
+   <test-case name="sf-snapshot-0203">
+      <description>Test snapshot() applied to a sequence of attribute nodes</description>
+      <created by="Michael Kay" on="2013-11-17"/>
+      <test>
+         <stylesheet file="sf-snapshot-0203.xsl"/>
+         <initial-template name="main"/>
+      </test>
+      <result>
+         <all-of>
+            <assert>/out</assert>
+            <assert-xml><![CDATA[<out>
+   <emp name="Jane Doe 1" gender="female" dept="sales"/>
+   <emp name="John Doe 2" gender="male" dept="sales"/>
+   <emp name="Jane Doe 3" gender="female" dept="sales"/>
+</out>
+]]></assert-xml>
+         </all-of>
+      </result>
+   </test-case>  
+
+   <test-case name="sf-snapshot-0204">
+      <description>Test snapshot() applied to a sequence of text nodes</description>
+      <created by="Michael Kay" on="2013-11-17"/>
+      <test>
+         <stylesheet file="sf-snapshot-0204.xsl"/>
+         <initial-template name="main"/>
+      </test>
+      <result>
+         <all-of>
+            <assert>/out</assert>
+            <assert-xml><![CDATA[<out>
+   <emp name="Jane Doe 1" dept="sales" num="E101" gender="female"/>
+   <emp name="John Doe 6" dept="customer-support" num="E106" gender="male"/>
+   <emp name="John Doe 10" dept="finance" num="E302" gender="male"/>
+</out>
+]]></assert-xml>
+         </all-of>
+      </result>
+   </test-case> 
+   
+   <test-case name="sf-snapshot-0205">
+      <description>Test snapshot() applied to a sequence of attribute nodes: unstreamed</description>
+      <created by="Michael Kay" on="2013-11-18"/>
+      <test>
+         <stylesheet file="sf-snapshot-0205.xsl"/>
+         <initial-template name="main"/>
+      </test>
+      <result>
+         <all-of>
+            <assert>/out</assert>
+            <assert-xml><![CDATA[<out>
+   <emp name="Jane Doe 1" gender="female" dept="sales"/>
+   <emp name="John Doe 2" gender="male" dept="sales"/>
+   <emp name="Jane Doe 3" gender="female" dept="sales"/>
+</out>
+]]></assert-xml>
+         </all-of>
+      </result>
+   </test-case> 
+   
+   <test-case name="sf-snapshot-0206">
+      <description>Test snapshot() applied to a subsequence of a sequence of attribute nodes: streamed</description>
+      <created by="Michael Kay" on="2013-11-18"/>
+      <test>
+         <stylesheet file="sf-snapshot-0206.xsl"/>
+         <initial-template name="main"/>
+      </test>
+      <result>
+         <all-of>
+            <assert>/out</assert>
+            <assert-xml><![CDATA[<out>
+   <emp name="Jane Doe 1" gender="female" dept="sales"/>
+   <emp name="John Doe 2" gender="male" dept="sales"/>
+   <emp name="Jane Doe 3" gender="female" dept="sales"/>
+</out>
+]]></assert-xml>
+         </all-of>
+      </result>
+   </test-case>
+   
+   <test-case name="sf-snapshot-0207">
+      <description>Test snapshot() applied to a sequence of text nodes with one removed</description>
+      <created by="Michael Kay" on="2013-11-18"/>
+      <test>
+         <stylesheet file="sf-snapshot-0207.xsl"/>
+         <initial-template name="main"/>
+      </test>
+      <result>
+         <all-of>
+            <assert>/out</assert>
+            <assert-xml><![CDATA[<out>
+   <emp name="Jane Doe 1" dept="sales" num="E101" gender="female"/>
+   <emp name="John Doe 10" dept="finance" num="E302" gender="male"/>
+</out>
+]]></assert-xml>
+         </all-of>
+      </result>
+   </test-case>    
+   
+   <test-case name="sf-snapshot-0208">
+      <description>Test snapshot() applied to a sequence of text nodes with one removed</description>
+      <created by="Michael Kay" on="2013-11-18"/>
+      <test>
+         <stylesheet file="sf-snapshot-0208.xsl"/>
+         <initial-template name="main"/>
+      </test>
+      <result>
+         <all-of>
+            <assert>/out</assert>
+            <assert-xml><![CDATA[<out>
+   <emp name="Jane Doe 1" dept="sales" num="E101" gender="female"/>
+   <emp name="John Doe 10" dept="finance" num="E302" gender="male"/>
+</out>
+]]></assert-xml>
+         </all-of>
+      </result>
+   </test-case>       
+   
+   <test-case name="sf-snapshot-0209">
+      <description>Test snapshot() applied to a sequence of element nodes with one removed</description>
+      <created by="Michael Kay" on="2013-11-18"/>
+      <test>
+         <stylesheet file="sf-snapshot-0209.xsl"/>
+         <initial-template name="main"/>
+      </test>
+      <result>
+         <all-of>
+            <assert>/out</assert>
+            <assert-xml><![CDATA[<out>
+   <emp name="Jane Doe 1" dept="sales" num="E101" gender="female"/>
+   <emp name="John Doe 10" dept="finance" num="E302" gender="male"/>
+</out>
+]]></assert-xml>
+         </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/strm/sf-snapshot/sf-snapshot-01.xml	Tue Aug 12 17:19:55 2014 +0100
@@ -0,0 +1,21 @@
+<br:Bridge xmlns:gml="http://www.opengis.net/gml/3.2"
+                  xmlns:br="http://www.bridge.org"
+                 gml:id="Iowa-IllinoisMemorialBridge">
+   <gml:description>
+       The Interstate 74 Bridge, originally known as the Iowa-Illinois Memorial Bridge,
+       and often called The Twin Bridges, or the I-74 Bridge, is a pair of suspension
+       bridges that cross the Mississippi River and connect Bettendorf, Iowa and Moline, Illinois.
+   </gml:description>
+   <gml:identifier codeSpace="http://iowadot.gov">#8205,OL074  8205,OR074</gml:identifier>    
+   <gml:name>I-74 Bridge</gml:name>    
+   <gml:name>Twin Bridge</gml:name>
+   <gml:boundedBy>   
+       <gml:Envelope srsName="http://earth-info.nga.mil/GandG/wgs84/index.html">
+           <gml:lowerCorner>41.512674 -90.513161</gml:lowerCorner>
+           <gml:upperCorner>41.524113 -90.51299</gml:upperCorner>
+       </gml:Envelope>
+   </gml:boundedBy>
+   <br:length>3,372 feet (1,028 m)</br:length>
+   <br:width>27 feet (8 m)</br:width>
+   <br:spans>Mississippi River</br:spans>
+</br:Bridge>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/strm/sf-snapshot/sf-snapshot-0101.xsl	Tue Aug 12 17:19:55 2014 +0100
@@ -0,0 +1,31 @@
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="3.0">
+
+<xsl:template name="a">
+<xsl:stream href="sf-snapshot-01.xml">
+  <xsl:variable name="v" select="snapshot(/)"/>
+  <xsl:choose>
+    <xsl:when test="deep-equal(doc('sf-snapshot-01.xml'), $v)"><ok/></xsl:when>
+    <xsl:otherwise><xsl:sequence select="$v"/></xsl:otherwise>
+  </xsl:choose>
+</xsl:stream>    
+</xsl:template>
+
+<xsl:template name="b">
+<xsl:stream href="sf-snapshot-01.xml">
+  <xsl:variable name="v" select="snapshot(/*)"/>
+  <xsl:choose>
+    <xsl:when test="deep-equal(doc('sf-snapshot-01.xml')/*, $v)"><ok doc="{exists($v/..)}"/></xsl:when>
+    <xsl:otherwise><xsl:sequence select="$v"/></xsl:otherwise>
+  </xsl:choose>
+</xsl:stream>    
+</xsl:template>
+
+<xsl:template name="c">
+<xsl:stream href="sf-snapshot-01.xml">
+  <xsl:sequence select="snapshot(//*:identifier)/self::*:identifier/ancestor::node()[last()]"/>
+</xsl:stream>  
+</xsl:template>
+
+
+
+</xsl:stylesheet>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/strm/sf-snapshot/sf-snapshot-0102.xsl	Tue Aug 12 17:19:55 2014 +0100
@@ -0,0 +1,102 @@
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="3.0"
+ xmlns:f="http://example.com/functions" 
+ xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ exclude-result-prefixes="f xs">
+ 
+<!-- Test that the results of the fn:snapshot function are equivalent to the 
+ implementation given in the XSLT spec --> 
+ 
+<xsl:template name="main">
+ <xsl:stream href="sf-snapshot-01.xml">
+  <out>
+   <xsl:for-each select="snapshot(//*)">
+    <xsl:variable name="p" select="position()" as="xs:integer"/>
+    <xsl:variable name="s" select="."/>
+    <xsl:variable name="t" select="f:snapshot((doc('sf-snapshot-01.xml')//*)[$p])"/>
+    <xsl:if test="not(deep-equal($s, $t) and deep-equal($s/root(), $t/root()))"> 
+      <wrong position="{$p}" node="{generate-id(.)}" path="{string-join(ancestor-or-self::*/name(), '/')}">
+        <actual name="{name($s)}"><xsl:sequence select="$s/root()"/></actual>
+        <expected name="{name($t)}"><xsl:sequence select="$t/root()"/></expected>
+      </wrong>
+    </xsl:if>
+   </xsl:for-each>
+  </out>
+ </xsl:stream>   
+</xsl:template> 
+
+
+ 
+
+
+<!-- Following functions are the non-streamable implementation of fn:snapshot defined in the XSLT 3.0 spec -->
+
+<xsl:function name="f:snapshot" as="node()?" identity-sensitive="no">
+  <xsl:param name="origin" as="node()?"/>
+  
+  <!-- create a copy of the tree containing the supplied node, retaining only
+       * the supplied node with its attributes and namespaces
+       * the ancestors of the supplied node with their attributes and namespaces
+       * the descendants of the supplied node with their attributes and namespaces
+       -->
+  <xsl:variable name="root-copy" as="node()">
+    <xsl:apply-templates select="root($origin)" mode="snapshot">
+      <xsl:with-param name="origin" select="$origin" tunnel="yes"/>
+    </xsl:apply-templates>
+  </xsl:variable>
+  
+  <!-- find and return the node in the copied tree that corresponds to the origin node
+       --> 
+  <xsl:sequence select="$root-copy/descendant-or-self::node()/(.|@*|namespace::*)
+      [f:corresponds(., $origin)]"/>
+</xsl:function>
+
+<xsl:template match="." mode="snapshot">
+  <xsl:param name="origin" as="node()" tunnel="yes"/>
+  <xsl:choose>
+    <xsl:when test=". is $origin">
+      <xsl:copy-of select="." validation="preserve"/>
+    </xsl:when>
+    <xsl:when test=". intersect $origin/ancestor::node()">
+      <xsl:copy validation="strip">
+        <xsl:copy-of select="@*" validation="preserve"/>
+        <xsl:apply-templates mode="snapshot"/>
+      </xsl:copy>
+    </xsl:when>
+    <xsl:otherwise/>
+  </xsl:choose>
+</xsl:template>
+
+<!-- f:corresponds compares two nodes and returns true if all the following are true:
+     * they are at the same depth in their respective trees
+     * they have the same name (or none)
+     * they have the same node kind
+     The tests on node name and node kind are needed only when the origin node is an
+     attribute or namespace.
+     -->
+<xsl:function name="f:corresponds" as="xs:boolean">
+  <xsl:param name="node1" as="node()"/>
+  <xsl:param name="node2" as="node()"/>
+  <xsl:sequence select="
+    count($node1/ancestor::node()) = count($node2/ancestor::node()) and
+    deep-equal(node-name($node1), node-name($node2)) and
+    f:node-kind($node1) = f:node-kind($node2)"/>    
+</xsl:function>
+
+<!-- f:node-kind returns a string identifying the node kind of the supplied node
+     -->
+<xsl:function name="f:node-kind" as="xs:string">
+  <xsl:param name="node" as="node()"/>
+  <xsl:choose>
+    <xsl:when test="$node instance of document-node()">D</xsl:when>
+    <xsl:when test="$node instance of element(*)">E</xsl:when>
+    <xsl:when test="$node instance of attribute(*)">A</xsl:when>
+    <xsl:when test="$node instance of text()">T</xsl:when>
+    <xsl:when test="$node instance of comment()">C</xsl:when>
+    <xsl:when test="$node instance of processing-instruction()">P</xsl:when>
+    <xsl:when test="$node instance of namespace-node()">N</xsl:when>
+  </xsl:choose>
+</xsl:function>
+
+
+
+</xsl:stylesheet>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/strm/sf-snapshot/sf-snapshot-0105.xsl	Tue Aug 12 17:19:55 2014 +0100
@@ -0,0 +1,16 @@
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="3.0"
+ xmlns:f="http://example.com/functions" 
+ xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ exclude-result-prefixes="f xs">
+ 
+
+<xsl:template name="main">
+ <xsl:stream href="sf-snapshot-01.xml">
+   <out>
+    <xsl:sequence select="snapshot(/a/b/c/d/e)"/>
+   </out>
+ </xsl:stream>  
+</xsl:template> 
+ 
+
+</xsl:stylesheet>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/strm/sf-snapshot/sf-snapshot-0201.xsl	Tue Aug 12 17:19:55 2014 +0100
@@ -0,0 +1,14 @@
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="3.0">
+
+<xsl:template name="main">
+  <out>
+  <xsl:stream href="../docs/works.xml">
+     <xsl:for-each select="works/department/employee/snapshot(.)">
+        <emp name="{@name}" dept="{../@name}" nr="{empnum}" hours="{hours}"/>
+     </xsl:for-each>
+  </xsl:stream>
+  </out>
+</xsl:template>
+
+
+</xsl:stylesheet>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/strm/sf-snapshot/sf-snapshot-0202.xsl	Tue Aug 12 17:19:55 2014 +0100
@@ -0,0 +1,14 @@
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="3.0">
+
+<xsl:template name="main">
+  <out>
+  <xsl:stream href="../docs/works.xml">
+     <xsl:for-each select="snapshot(works/department/employee)">
+        <emp name="{@name}" dept="{../@name}" nr="{empnum}" hours="{hours}"/>
+     </xsl:for-each>
+  </xsl:stream>
+  </out>
+</xsl:template>
+
+
+</xsl:stylesheet>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/strm/sf-snapshot/sf-snapshot-0203.xsl	Tue Aug 12 17:19:55 2014 +0100
@@ -0,0 +1,14 @@
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="3.0">
+
+<xsl:template name="main">
+  <out>
+  <xsl:stream href="../docs/works.xml">
+     <xsl:for-each select="subsequence(snapshot(works/department/employee/@name), 1, 3)">
+        <emp name="{.}" gender="{../@gender}" dept="{../../@name}"/>
+     </xsl:for-each>
+  </xsl:stream>
+  </out>
+</xsl:template>
+
+
+</xsl:stylesheet>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/strm/sf-snapshot/sf-snapshot-0204.xsl	Tue Aug 12 17:19:55 2014 +0100
@@ -0,0 +1,14 @@
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="3.0">
+
+<xsl:template name="main">
+  <out>
+  <xsl:stream href="../docs/works.xml">
+     <xsl:for-each select="snapshot(works/department/employee[1]/empnum/text())">
+        <emp num="{.}" name="{../../@name}" gender="{../../@gender}" dept="{../../../@name}"/>
+     </xsl:for-each>
+  </xsl:stream>
+  </out>
+</xsl:template>
+
+
+</xsl:stylesheet>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/strm/sf-snapshot/sf-snapshot-0205.xsl	Tue Aug 12 17:19:55 2014 +0100
@@ -0,0 +1,14 @@
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="3.0">
+
+<xsl:template name="main">
+  <out>
+  <xsl:for-each select="doc('../docs/works.xml')">
+     <xsl:for-each select="snapshot(works/department/employee/@name)[position() = (1 to 3)]">
+        <emp name="{.}" gender="{../@gender}" dept="{../../@name}"/>
+     </xsl:for-each>
+  </xsl:for-each>
+  </out>
+</xsl:template>
+
+
+</xsl:stylesheet>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/strm/sf-snapshot/sf-snapshot-0206.xsl	Tue Aug 12 17:19:55 2014 +0100
@@ -0,0 +1,14 @@
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="3.0">
+
+<xsl:template name="main">
+  <out>
+  <xsl:stream href="../docs/works.xml">
+     <xsl:for-each select="snapshot(subsequence(works/department/employee/@name, 1, 3))">
+        <emp name="{.}" gender="{../@gender}" dept="{../../@name}"/>
+     </xsl:for-each>
+  </xsl:stream>
+  </out>
+</xsl:template>
+
+
+</xsl:stylesheet>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/strm/sf-snapshot/sf-snapshot-0207.xsl	Tue Aug 12 17:19:55 2014 +0100
@@ -0,0 +1,14 @@
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="3.0">
+
+<xsl:template name="main">
+  <out>
+  <xsl:stream href="../docs/works.xml">
+     <xsl:for-each select="remove(snapshot(works/department/employee[1]/empnum/text()), 2)">
+        <emp num="{.}" name="{../../@name}" gender="{../../@gender}" dept="{../../../@name}"/>
+     </xsl:for-each>
+  </xsl:stream>
+  </out>
+</xsl:template>
+
+
+</xsl:stylesheet>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/strm/sf-snapshot/sf-snapshot-0208.xsl	Tue Aug 12 17:19:55 2014 +0100
@@ -0,0 +1,14 @@
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="3.0">
+
+<xsl:template name="main">
+  <out>
+  <xsl:stream href="../docs/works.xml">
+     <xsl:for-each select="snapshot(remove(works/department/employee[1]/empnum/text(), 2))">
+        <emp num="{.}" name="{../../@name}" gender="{../../@gender}" dept="{../../../@name}"/>
+     </xsl:for-each>
+  </xsl:stream>
+  </out>
+</xsl:template>
+
+
+</xsl:stylesheet>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/strm/sf-snapshot/sf-snapshot-0209.xsl	Tue Aug 12 17:19:55 2014 +0100
@@ -0,0 +1,14 @@
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="3.0">
+
+<xsl:template name="main">
+  <out>
+  <xsl:stream href="../docs/works.xml">
+     <xsl:for-each select="snapshot(remove(works/department/employee[1]/empnum, 2))">
+        <emp num="{.}" name="{../@name}" gender="{../@gender}" dept="{../../@name}"/>
+     </xsl:for-each>
+  </xsl:stream>
+  </out>
+</xsl:template>
+
+
+</xsl:stylesheet>
\ No newline at end of file
--- a/tests/strm/si-attribute/_si-attribute-test-set.xml	Tue Aug 12 17:18:55 2014 +0100
+++ b/tests/strm/si-attribute/_si-attribute-test-set.xml	Tue Aug 12 17:19:55 2014 +0100
@@ -568,6 +568,78 @@
       </result>
    </test-case>
    
+   <test-case name="si-attribute-070">
+      <description>xsl:attribute; striding element nodes</description>
+      <created by="Michael Kay" on="2014-08-11"/>
+      <environment ref="si-attribute-A"/>
+      <test>
+         <initial-template name="s-070"/>
+      </test>
+      <result>
+         <assert>/out/@a = "4.95|6.58|4.95|4.95|16.47|16.47"</assert>
+      </result>
+   </test-case>   
+   
+   <test-case name="si-attribute-071">
+      <description>xsl:attribute; crawling element nodes</description>
+      <created by="Michael Kay" on="2014-08-11"/>
+      <environment ref="si-attribute-A"/>
+      <test>
+         <initial-template name="s-071"/>
+      </test>
+      <result>
+         <assert>/out/@a = "4.95|6.58|4.95|4.95|16.47|16.47"</assert>
+      </result>
+   </test-case>
+   
+   <test-case name="si-attribute-072">
+      <description>xsl:attribute; crawling nested element nodes</description>
+      <created by="Michael Kay" on="2014-08-11"/>
+      <environment ref="si-attribute-A"/>
+      <test>
+         <initial-template name="s-072"/>
+      </test>
+      <result>
+         <assert>/out/@a = "12345|1|2|3|4|5"</assert>
+      </result>
+   </test-case>  
+   
+   <test-case name="si-attribute-073">
+      <description>xsl:attribute; zero-length text nodes</description>
+      <created by="Michael Kay" on="2014-08-11"/>
+      <environment ref="si-attribute-A"/>
+      <test>
+         <initial-template name="s-073"/>
+      </test>
+      <result>
+         <assert>/out/@a = "12345|1|2|3|4|5"</assert>
+      </result>
+   </test-case>
+   
+   <test-case name="si-attribute-074">
+      <description>xsl:attribute; adjacent text nodes</description>
+      <created by="Michael Kay" on="2014-08-11"/>
+      <environment ref="si-attribute-A"/>
+      <test>
+         <initial-template name="s-074"/>
+      </test>
+      <result>
+         <assert>/out/@a = "~12345~"</assert>
+      </result>
+   </test-case>  
+   
+   <test-case name="si-attribute-075">
+      <description>xsl:attribute; mix in atomic values</description>
+      <created by="Michael Kay" on="2014-08-11"/>
+      <environment ref="si-attribute-A"/>
+      <test>
+         <initial-template name="s-075"/>
+      </test>
+      <result>
+         <assert>/out/@a = "1|2|3|12345|1|2|3"</assert>
+      </result>
+   </test-case>   
+   
    
    
    
--- a/tests/strm/si-attribute/si-attribute-A.xsl	Tue Aug 12 17:18:55 2014 +0100
+++ b/tests/strm/si-attribute/si-attribute-A.xsl	Tue Aug 12 17:19:55 2014 +0100
@@ -528,6 +528,75 @@
       </xsl:stream>
     </xsl:template>
     
+    <!-- Streaming xsl:attribute: striding element nodes -->
+    
+    <xsl:template name="s-070" use-when="$RUN">
+      <xsl:stream href="../docs/books.xml">
+        <out>
+          <xsl:attribute name="a" select="/BOOKLIST/BOOKS/ITEM/PRICE" separator="|"/>
+        </out>
+      </xsl:stream>
+    </xsl:template>
+    
+    <!-- Streaming xsl:attribute: crawling element nodes -->
+    
+    <xsl:template name="s-071" use-when="$RUN">
+      <xsl:stream href="../docs/books.xml">
+        <out>
+          <xsl:attribute name="a" select="//PRICE" separator="|"/>
+        </out>
+      </xsl:stream>
+    </xsl:template>
+    
+    <!-- Streaming xsl:attribute: crawling nested element nodes -->
+    
+    <xsl:template name="s-072" use-when="$RUN">
+      <xsl:stream href="../docs/nested-numbers.xml">
+        <out>
+          <xsl:attribute name="a" select="//n" separator="|"/>
+        </out>
+      </xsl:stream>
+    </xsl:template>
+    
+    <!-- Streaming xsl:attribute: zero-length text nodes -->
+    
+    <xsl:template name="s-073" use-when="$RUN">
+      <xsl:variable name="etn" as="text()">
+        <xsl:value-of select="''"/>
+      </xsl:variable>
+      <xsl:stream href="../docs/nested-numbers.xml">
+        <out>
+          <xsl:attribute name="a" select="$etn, //n, $etn" separator="|"/>
+        </out>
+      </xsl:stream>
+    </xsl:template>
+    
+    <!-- Streaming xsl:attribute: adjacent text nodes -->
+    
+    <xsl:template name="s-074" use-when="$RUN">
+      <xsl:variable name="gtn" as="text()">
+        <xsl:value-of select="'~'"/>
+      </xsl:variable>
+      <xsl:stream href="../docs/nested-numbers.xml">
+        <out>
+          <xsl:attribute name="a" select="$gtn, //text(), $gtn" separator="|"/>
+        </out>
+      </xsl:stream>
+    </xsl:template>
+    
+    <!-- Streaming xsl:attribute: mix in atomic values -->
+    
+    <xsl:template name="s-075" use-when="$RUN">
+      <xsl:variable name="av" as="xs:integer*" select="1 to 3"/>
+      <xsl:stream href="../docs/nested-numbers.xml">
+        <out>
+          <xsl:attribute name="a" select="$av, //text(), $av" separator="|"/>
+        </out>
+      </xsl:stream>
+    </xsl:template>
+    
+
+    
 
                                               
     
--- a/tests/strm/si-copy-of/_si-copy-of-test-set.xml	Tue Aug 12 17:18:55 2014 +0100
+++ b/tests/strm/si-copy-of/_si-copy-of-test-set.xml	Tue Aug 12 17:19:55 2014 +0100
@@ -399,6 +399,7 @@
   <test-case name="si-copy-of-110">
       <description>Use xsl:copy-of: schema-aware, validation by type, invalid, caught</description>
       <created by="Michael Kay" on="2012-12-18"/>
+      <modified by="Michael Kay" on="2014-08-12" change="correct expected error code"/>
       <environment ref="si-copy-of-B"/>
       <dependencies>
         <feature value="schema_aware"/>
@@ -407,7 +408,7 @@
          <initial-template name="cy-110"/>
       </test>
       <result>
-         <assert>/out = "XTTE1510"</assert>
+         <assert>/out = "XTTE1540"</assert>
       </result>
    </test-case>
    
--- a/tests/strm/si-copy/_si-copy-test-set.xml	Tue Aug 12 17:18:55 2014 +0100
+++ b/tests/strm/si-copy/_si-copy-test-set.xml	Tue Aug 12 17:19:55 2014 +0100
@@ -4,10 +4,6 @@
           name="si-copy">
    <description>xsl:copy with streaming</description>
    
-   <!--
-     TODO: tests for on-empty
-    -->
-   
    <environment name="si-copy-A">
      <stylesheet file="si-copy-A.xsl"/>
    </environment>
@@ -392,12 +388,13 @@
    <test-case name="si-copy-048">
       <description>Use xsl:copy: with on-empty (empty document constructed)</description>
       <created by="Michael Kay" on="2012-12-19"/>
+      <modified by="Michael Kay" on="2014-08-09" change="on-empty is now ignored for document nodes: see bug 24378"/>
       <environment ref="si-copy-A"/>
       <test>
          <initial-template name="cy-048"/>
       </test>
       <result>
-         <assert>/out/a</assert>
+         <assert>/out</assert>
       </result>
    </test-case>
    
@@ -539,6 +536,7 @@
   <test-case name="si-copy-110">
       <description>Use xsl:copy: schema-aware, validation by type, invalid, caught</description>
       <created by="Michael Kay" on="2012-12-19"/>
+      <modified by="Michael Kay" on="2014-08-09" change="Expected error code is 1540, not 1510"/>
       <environment ref="si-copy-B"/>
       <dependencies>
         <feature value="schema_aware"/>
@@ -547,7 +545,7 @@
          <initial-template name="cy-110"/>
       </test>
       <result>
-         <assert>/out = "XTTE1510"</assert>
+         <assert>/out = "XTTE1540"</assert>
       </result>
    </test-case>
    
@@ -776,6 +774,36 @@
       </result>
    </test-case>
    
+   <test-case name="si-copy-129">
+      <description>Use xsl:copy: schema-aware, validation=strict, element node; passes xsl:variable/@as test</description>
+      <created by="Michael Kay" on="2014-08-10"/>
+      <environment ref="si-copy-B"/>
+      <dependencies>
+        <feature value="schema_aware"/>
+      </dependencies>
+      <test>
+         <initial-template name="cy-129"/>
+      </test>
+      <result>
+         <assert>/out = "true"</assert>
+      </result>
+   </test-case>
+   
+   <test-case name="si-copy-130">
+      <description>Use xsl:copy: schema-aware, validation=strict, element node; fails xsl:variable/@as test</description>
+      <created by="Michael Kay" on="2014-08-10"/>
+      <environment ref="si-copy-B"/>
+      <dependencies>
+        <feature value="schema_aware"/>
+      </dependencies>
+      <test>
+         <initial-template name="cy-130"/>
+      </test>
+      <result>
+         <error code="XPTY0004"/>
+      </result>
+   </test-case>      
+   
    
    <test-case name="si-copy-901">
       <description>Use xsl:copy, uses non-streamable attribute set</description>
--- a/tests/strm/si-copy/si-copy-B.xsl	Tue Aug 12 17:18:55 2014 +0100
+++ b/tests/strm/si-copy/si-copy-B.xsl	Tue Aug 12 17:19:55 2014 +0100
@@ -269,7 +269,7 @@
     </out>
   </xsl:template>
   
-<!-- within xsl:stream, use xsl:copy: schema-aware, validation=strict, element node -->
+  <!-- within xsl:stream, use xsl:copy: schema-aware, validation=strict, element node -->
   
   <xsl:template name="cy-121" use-when="$RUN">
     <out>
@@ -387,7 +387,37 @@
         <xsl:value-of select="$copy instance of element(*, myroot)"/>
       </xsl:stream>
     </out>
-  </xsl:template>    
+  </xsl:template>
+  
+  <!-- within xsl:stream, use xsl:copy: schema-aware, validation=strict, element node, passes xsl:variable/@as -->
+  
+  <xsl:template name="cy-129" use-when="$RUN">
+    <out>
+      <xsl:stream href="../docs/loans-noNS.xml">
+        <xsl:variable name="copy" as="element(*, myroot)">
+          <xsl:copy select="*" validation="strict">
+            <xsl:copy-of select="child::node()"/>
+          </xsl:copy>
+        </xsl:variable>
+        <xsl:value-of select="$copy instance of element(*, myroot)"/>
+      </xsl:stream>
+    </out>
+  </xsl:template>
+  
+<!-- within xsl:stream, use xsl:copy: schema-aware, validation=strict, element node, fails xsl:variable/@as -->
+  
+  <xsl:template name="cy-130" use-when="$RUN">
+    <out>
+      <xsl:stream href="../docs/loans-noNS.xml">
+        <xsl:variable name="copy" as="element(*, xs:integer)">
+          <xsl:copy select="*" validation="strict">
+            <xsl:copy-of select="child::node()"/>
+          </xsl:copy>
+        </xsl:variable>
+        <xsl:value-of select="empty($copy/comment())"/>
+      </xsl:stream>
+    </out>
+  </xsl:template>        
    
   
   
--- a/tests/strm/si-try/_si-try-test-set.xml	Tue Aug 12 17:18:55 2014 +0100
+++ b/tests/strm/si-try/_si-try-test-set.xml	Tue Aug 12 17:19:55 2014 +0100
@@ -20,6 +20,7 @@
    <test-case name="si-try-001">
       <description>Test of xsl:stream/xsl:try instruction with "treat as": count descendant nodes</description>
       <created by="Michael Kay" on="2013-12-28"/>
+      <modified by="Michael Kay" on="2014-08-12" change="change test to throw the expected error"/>
       <environment ref="si-try-A"/>
       <test>
          <initial-template name="c-001"/>
@@ -114,8 +115,9 @@
    </test-case> 
    
    <test-case name="si-try-009">
-      <description>xsl:stream/xsl:try with "treat as" with a striding(?) union</description>
+      <description>xsl:stream/xsl:try with "treat as" with a striding expression</description>
       <created by="Michael Kay" on="2013-12-28"/>
+      <modified by="Michael Kay" on="2014-08-12" change="remove dependency on non-streamable union"/>
       <environment ref="si-try-A"/>
       <test>
          <initial-template name="c-009"/>
--- a/tests/strm/si-try/si-try-A.xsl	Tue Aug 12 17:18:55 2014 +0100
+++ b/tests/strm/si-try/si-try-A.xsl	Tue Aug 12 17:19:55 2014 +0100
@@ -13,7 +13,7 @@
     <xsl:template name="c-001" use-when="$RUN">
       <xsl:stream href="../docs/books.xml">
         <out>
-          <xsl:try><xsl:value-of select="outermost(.//node()) treat as element()*"/><xsl:catch errors="*:XPDY0050" select="'caught'"/></xsl:try>
+          <xsl:try><xsl:value-of select="outermost(.//node()) treat as comment()*"/><xsl:catch errors="*:XPDY0050" select="'caught'"/></xsl:try>
         </out>
       </xsl:stream>
     </xsl:template>
@@ -93,7 +93,7 @@
     <xsl:template name="c-009" use-when="$RUN">
       <xsl:stream href="../docs/books.xml">
         <out>
-          <xsl:try><xsl:value-of select="(BOOKLIST/(BOOKS | CATEGORIES)) treat as element(BOOKS)+"/><xsl:catch errors="*:XPDY0050" select="'caught'"/></xsl:try>
+          <xsl:try><xsl:value-of select="(BOOKLIST/*[self::BOOKS or self::CATEGORIES]) treat as element(BOOKS)+"/><xsl:catch errors="*:XPDY0050" select="'caught'"/></xsl:try>
         </out>
       </xsl:stream>
     </xsl:template> 
--- a/tests/strm/si-value-of/_si-value-of-test-set.xml	Tue Aug 12 17:18:55 2014 +0100
+++ b/tests/strm/si-value-of/_si-value-of-test-set.xml	Tue Aug 12 17:19:55 2014 +0100
@@ -361,7 +361,77 @@
       </result>
    </test-case>
    
-
-
+   <test-case name="si-value-of-070">
+      <description>xsl:value-of; striding element nodes</description>
+      <created by="Michael Kay" on="2014-08-11"/>
+      <environment ref="si-value-of-A"/>
+      <test>
+         <initial-template name="s-070"/>
+      </test>
+      <result>
+         <assert>/out = "4.95|6.58|4.95|4.95|16.47|16.47"</assert>
+      </result>
+   </test-case>   
+   
+   <test-case name="si-value-of-071">
+      <description>xsl:value-of; crawling element nodes</description>
+      <created by="Michael Kay" on="2014-08-11"/>
+      <environment ref="si-value-of-A"/>
+      <test>
+         <initial-template name="s-071"/>
+      </test>
+      <result>
+         <assert>/out = "4.95|6.58|4.95|4.95|16.47|16.47"</assert>
+      </result>
+   </test-case>
+   
+   <test-case name="si-value-of-072">
+      <description>xsl:value-of; crawling nested element nodes</description>
+      <created by="Michael Kay" on="2014-08-11"/>
+      <environment ref="si-value-of-A"/>
+      <test>
+         <initial-template name="s-072"/>
+      </test>
+      <result>
+         <assert>/out = "12345|1|2|3|4|5"</assert>
+      </result>
+   </test-case>  
+   
+   <test-case name="si-value-of-073">
+      <description>xsl:value-of; zero-length text nodes</description>
+      <created by="Michael Kay" on="2014-08-11"/>
+      <environment ref="si-value-of-A"/>
+      <test>
+         <initial-template name="s-073"/>
+      </test>
+      <result>
+         <assert>/out = "12345|1|2|3|4|5"</assert>
+      </result>
+   </test-case>
+   
+   <test-case name="si-value-of-074">
+      <description>xsl:value-of; adjacent text nodes</description>
+      <created by="Michael Kay" on="2014-08-11"/>
+      <environment ref="si-value-of-A"/>
+      <test>
+         <initial-template name="s-074"/>
+      </test>
+      <result>
+         <assert>/out = "~12345~"</assert>
+      </result>
+   </test-case>  
+   
+   <test-case name="si-value-of-075">
+      <description>xsl:value-of; mix in atomic values</description>
+      <created by="Michael Kay" on="2014-08-11"/>
+      <environment ref="si-value-of-A"/>
+      <test>
+         <initial-template name="s-075"/>
+      </test>
+      <result>
+         <assert>/out = "1|2|3|12345|1|2|3"</assert>
+      </result>
+   </test-case>   
+   
 
 </test-set>
\ No newline at end of file
--- a/tests/strm/si-value-of/si-value-of-A.xsl	Tue Aug 12 17:18:55 2014 +0100
+++ b/tests/strm/si-value-of/si-value-of-A.xsl	Tue Aug 12 17:19:55 2014 +0100
@@ -51,7 +51,7 @@
     
     <!-- Test of xsl:stream with xsl:value-of, filtered with a positional predicate -->
     
-    <xsl:template name="s-007" use-when="false()">
+    <xsl:template name="s-007" use-when="$RUN">
       <xsl:stream href="../docs/books.xml">
         <out>
           <xsl:value-of select="/BOOKLIST/BOOKS/*:ITEM[position() lt 4]/PRICE"/>
@@ -309,6 +309,73 @@
       </xsl:stream>
     </xsl:template>
     
+    <!-- Streaming xsl:value-of: striding element nodes -->
+    
+    <xsl:template name="s-070" use-when="$RUN">
+      <xsl:stream href="../docs/books.xml">
+        <out>
+          <xsl:value-of select="/BOOKLIST/BOOKS/ITEM/PRICE" separator="|"/>
+        </out>
+      </xsl:stream>
+    </xsl:template>
+    
+    <!-- Streaming xsl:value-of: crawling element nodes -->
+    
+    <xsl:template name="s-071" use-when="$RUN">
+      <xsl:stream href="../docs/books.xml">
+        <out>
+          <xsl:value-of select="//PRICE" separator="|"/>
+        </out>
+      </xsl:stream>
+    </xsl:template>
+    
+    <!-- Streaming xsl:value-of: crawling nested element nodes -->
+    
+    <xsl:template name="s-072" use-when="$RUN">
+      <xsl:stream href="../docs/nested-numbers.xml">
+        <out>
+          <xsl:value-of select="//n" separator="|"/>
+        </out>
+      </xsl:stream>
+    </xsl:template>
+    
+    <!-- Streaming xsl:value-of: zero-length text nodes -->
+    
+    <xsl:template name="s-073" use-when="$RUN">
+      <xsl:variable name="etn" as="text()">
+        <xsl:value-of select="''"/>
+      </xsl:variable>
+      <xsl:stream href="../docs/nested-numbers.xml">
+        <out>
+          <xsl:value-of select="$etn, //n, $etn" separator="|"/>
+        </out>
+      </xsl:stream>
+    </xsl:template>
+    
+    <!-- Streaming xsl:value-of: adjacent text nodes -->
+    
+    <xsl:template name="s-074" use-when="$RUN">
+      <xsl:variable name="gtn" as="text()">
+        <xsl:value-of select="'~'"/>
+      </xsl:variable>
+      <xsl:stream href="../docs/nested-numbers.xml">
+        <out>
+          <xsl:value-of select="$gtn, //text(), $gtn" separator="|"/>
+        </out>
+      </xsl:stream>
+    </xsl:template>
+    
+    <!-- Streaming xsl:value-of: mix in atomic values -->
+    
+    <xsl:template name="s-075" use-when="$RUN">
+      <xsl:variable name="av" as="xs:integer*" select="1 to 3"/>
+      <xsl:stream href="../docs/nested-numbers.xml">
+        <out>
+          <xsl:value-of select="$av, //text(), $av" separator="|"/>
+        </out>
+      </xsl:stream>
+    </xsl:template>
+    
 
                                                 
     
--- a/tests/strm/sx-CommaExpr/_sx-CommaExpr-test-set.xml	Tue Aug 12 17:18:55 2014 +0100
+++ b/tests/strm/sx-CommaExpr/_sx-CommaExpr-test-set.xml	Tue Aug 12 17:19:55 2014 +0100
@@ -523,12 +523,13 @@
       <description>comma expression (streaming arg 2) - climbing operand, inspection usage</description>
       <keywords>ParenthesizedExpr mixed-posture striding-then-climbing fn:name leading-lone-slash PathExpr positional-predicate SimpleMapExpr ancestor-axis</keywords>
       <created by="Michael Kay" on="2013-11-25"/>
+      <modified by="Michael Kay" on="2014-08-09" change="correct expected results"/>
       <environment ref="sx-comma-B"/>
       <test>
          <initial-template name="r-030"/>
       </test>
       <result>
-         <assert>/out = "BOOKLIST BOOKS ITEM a b"</assert>
+         <assert>/out = "a b BOOKLIST BOOKS ITEM"</assert>
       </result>
    </test-case>
    
@@ -536,12 +537,13 @@
       <description>comma expression (streaming arg 2) - climbing operand, inspection usage, removal of duplicates</description>
       <keywords>ParenthesizedExpr mixed-posture leading-lone-slash striding-then-climbing fn:name PathExpr SimpleMapExpr ancestor-axis</keywords>
       <created by="Michael Kay" on="2013-11-25"/>
+      <modified by="Michael Kay" on="2014-08-09" change="correct expected results"/>
       <environment ref="sx-comma-B"/>
       <test>
          <initial-template name="r-031"/>
       </test>
       <result>
-         <assert>/out = "BOOKLIST BOOKS ITEM ITEM ITEM ITEM ITEM ITEM a b"</assert>
+         <assert>/out = "a b BOOKLIST BOOKS ITEM ITEM ITEM ITEM ITEM ITEM"</assert>
       </result>
    </test-case> 
    
--- a/tests/strm/sx-TreatExpr/_sx-TreatExpr-test-set.xml	Tue Aug 12 17:18:55 2014 +0100
+++ b/tests/strm/sx-TreatExpr/_sx-TreatExpr-test-set.xml	Tue Aug 12 17:19:55 2014 +0100
@@ -16,12 +16,13 @@
    <test-case name="sx-treat-001">
       <description>Test of xsl:stream instruction with "treat as": count descendant nodes</description>
       <created by="Michael Kay" on="2012-11-07"/>
+      <modified by="Michael Kay" on="2014-08-12" change="change the test and the expected result to be useful"/>
       <environment ref="sx-treat-A"/>
       <test>
          <initial-template name="c-001"/>
       </test>
       <result>
-         <error code="XPDY0050"/>
+         <assert>/out = "BOOKS CATEGORIES"</assert>
       </result>
    </test-case>
 
@@ -148,12 +149,13 @@
    <test-case name="sx-treat-012">
       <description>"treat as" filtered grounded sequence</description>
       <created by="Michael Kay" on="2013-11-18"/>
+      <modified by="Michael Kay" on="2014-08-12" change="correct the expected result"/>
       <environment ref="sx-treat-A"/>
       <test>
          <initial-template name="c-012"/>
       </test>
       <result>
-         <error code="XPDY0050"/>
+         <assert>/out = "8.3 5.7 1.1 1.0 5.2 7.8 7.8 5.2 0.9 22.5 18.0 3.5 7.8 5.0 0.9"</assert>
       </result>
    </test-case>
    
--- a/tests/strm/sx-TreatExpr/sx-treat-A.xsl	Tue Aug 12 17:18:55 2014 +0100
+++ b/tests/strm/sx-TreatExpr/sx-treat-A.xsl	Tue Aug 12 17:19:55 2014 +0100
@@ -12,7 +12,7 @@
     <xsl:template name="c-001" use-when="$RUN">
       <xsl:stream href="../docs/books.xml">
         <out>
-          <xsl:value-of select="outermost(.//node()) treat as element()*"/>
+          <xsl:value-of select="(/*/* treat as element()*) ! name(.)"/>
         </out>
       </xsl:stream>
     </xsl:template>