Non-streaming tests for fn:innermost
authorMichael Kay <mike@saxonica.com>
Mon, 25 Jan 2016 14:50:25 +0000
changeset 1217 fe8e1b0da194
parent 1216 2d8a1f165877
child 1218 1c93120087e2
child 1230 09a187dec956
Non-streaming tests for fn:innermost
catalog.xml
tests/fn/innermost/_innermost-test-set.xml
tests/fn/innermost/innermost-001.xsl
tests/fn/innermost/innermost-901.xsl
--- a/catalog.xml	Mon Jan 25 14:50:02 2016 +0000
+++ b/catalog.xml	Mon Jan 25 14:50:25 2016 +0000
@@ -79,6 +79,7 @@
       <test-set name="format-number" file="tests/fn/format-number/_format-number-test-set.xml"/>
       <test-set name="function-available" file="tests/fn/function-available/_function-available-test-set.xml"/>         
       <test-set name="id" file="tests/fn/id/_id-test-set.xml"/>
+      <test-set name="innermost" file="tests/fn/innermost/_innermost-test-set.xml"/>
       <test-set name="json-to-xml" file="tests/fn/json-to-xml/_json-to-xml-test-set.xml"/>
       <test-set name="key" file="tests/fn/key/_key-test-set.xml"/>
       <test-set name="normalize-unicode" file="tests/fn/normalize-unicode/_normalize-unicode-test-set.xml"/> 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/fn/innermost/_innermost-test-set.xml	Mon Jan 25 14:50:25 2016 +0000
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<test-set xmlns="http://www.w3.org/2012/10/xslt-test-catalog" xmlns:xs="http://www.w3.org/2001/XMLSchema" name="innermost">
+   <description>innermost() function without streaming</description>
+
+   <dependencies>
+      <spec value="XSLT30+"/>
+   </dependencies>
+   
+   <test-case name="innermost-001">
+      <description> innermost() - grounded operand. Note: see bug 24125.</description>
+      <keywords>fn:snapshot bug-24125 leading-lone-slash PathExpr</keywords>
+      <created by="Michael Kay" on="2013-12-17"/>
+      <test>
+         <stylesheet file="innermost-001.xsl"/>
+         <initial-template name="r-001"/>
+      </test>
+      <result>
+         <assert-xml><![CDATA[<out>1.1 1.2.1 1.2.2 1.3</out>]]></assert-xml>
+      </result>
+   </test-case>
+   
+   <test-case name="innermost-901">
+      <description>Non-Streaming innermost() - non-grounded operand</description>
+      <keywords>XTSE3430 overlapping-nodes-with-transmission-usage leading-lone-slash crawling PathExpr</keywords>
+      <created by="Michael Kay" on="2013-12-17"/>
+      <test>
+         <stylesheet file="innermost-901.xsl"/>
+         <initial-template name="r-901"/>
+      </test>
+      <result>
+         <error code="XTSE3430"/>
+      </result>
+   </test-case>   
+
+
+
+</test-set>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/fn/innermost/innermost-001.xsl	Mon Jan 25 14:50:25 2016 +0000
@@ -0,0 +1,21 @@
+<xsl:stylesheet version="3.0" 
+    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+    xmlns:map="http://www.w3.org/2005/xpath-functions/map"
+    xmlns:xs="http://www.w3.org/2001/XMLSchema"
+    exclude-result-prefixes="map xs">
+    
+    <xsl:variable name="RUN" select="true()" static="yes"/>
+    <xsl:strip-space elements="*"/>
+    
+    <!-- Streaming innermost(): grounded operand -->
+    
+    <xsl:template name="r-001" use-when="$RUN">
+      <xsl:for-each select="doc('../../strm/docs/recursive.xml')">
+        <out>
+          <xsl:value-of select="innermost(snapshot(/chapter)//section)/@id"/>
+        </out>
+      </xsl:for-each>
+    </xsl:template>
+
+    
+</xsl:stylesheet>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/fn/innermost/innermost-901.xsl	Mon Jan 25 14:50:25 2016 +0000
@@ -0,0 +1,21 @@
+<xsl:stylesheet version="3.0" 
+    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+    xmlns:map="http://www.w3.org/2005/xpath-functions/map"
+    xmlns:xs="http://www.w3.org/2001/XMLSchema"
+    exclude-result-prefixes="map xs">
+    
+    <xsl:variable name="RUN" select="true()" static="yes"/>
+    <xsl:strip-space elements="*"/>
+    
+    <!-- Non-Streaming innermost(): non-grounded operand -->
+    
+    <xsl:template name="r-901" use-when="$RUN">
+      <xsl:for-each select="doc('../../strm/docs/recursive.xml')">
+        <out>
+          <xsl:value-of select="innermost(/chapter//section)/@id"/>
+        </out>
+      </xsl:for-each>
+    </xsl:template>
+
+    
+</xsl:stylesheet>
\ No newline at end of file