A couple more text-value-template tests
authorMichael Kay <mike@saxonica.com>
Wed, 01 Jul 2015 22:00:33 +0100
changeset 1000 b6be29c4be3b
parent 999 90d9655bfbf2
child 1001 bcb773e9e475
A couple more text-value-template tests
tests/attr/expand-text/_expand-text-test-set.xml
tests/attr/expand-text/cvt-029.xsl
tests/attr/expand-text/cvt-030.xsl
--- a/tests/attr/expand-text/_expand-text-test-set.xml	Wed Jul 01 14:39:32 2015 +0100
+++ b/tests/attr/expand-text/_expand-text-test-set.xml	Wed Jul 01 22:00:33 2015 +0100
@@ -479,7 +479,7 @@
          <spec value="XSLT30+"/>
       </dependencies>
       <test>
-         <stylesheet file="cvt-028.xsl"/>
+         <stylesheet file="cvt-029.xsl"/>
          <initial-template name="main"/>
       </test>
       <result>
@@ -488,6 +488,24 @@
          </all-of>   
       </result>
    </test-case>
+   
+   <test-case name="cvt-029b">
+      <description>TVT as result of function: must be a text node</description>
+      <keywords>expand-text-attribute</keywords>
+      <created by="Michael Kay" on="2015-07-01"/>
+      <dependencies>
+         <spec value="XSLT30+"/>
+      </dependencies>
+      <test>
+         <stylesheet file="cvt-030.xsl"/>
+         <initial-template name="main"/>
+      </test>
+      <result>
+         <all-of>
+            <assert>/out = "true"</assert>
+         </all-of>   
+      </result>
+   </test-case>
 
 
 
--- a/tests/attr/expand-text/cvt-029.xsl	Wed Jul 01 14:39:32 2015 +0100
+++ b/tests/attr/expand-text/cvt-029.xsl	Wed Jul 01 22:00:33 2015 +0100
@@ -17,4 +17,10 @@
         </out>
 </xsl:template>
 
+<xsl:template match="/" name="two">
+        <out>
+            <xsl:value-of select="f:sum(1,2) instance of text()"/>
+        </out>
+</xsl:template>
+
 </xsl:stylesheet>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/attr/expand-text/cvt-030.xsl	Wed Jul 01 22:00:33 2015 +0100
@@ -0,0 +1,21 @@
+<?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" xmlns:f="local-functions.uri" 
+    exclude-result-prefixes="xs f">
+
+<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
+
+<xsl:function name="f:sum" expand-text="yes">
+        <xsl:param name="x" as="xs:integer"/>
+        <xsl:param name="y" as="xs:integer"/>
+  {$x + $y}
+</xsl:function>
+
+
+<xsl:template match="/" name="main">
+        <out>
+            <xsl:value-of select="f:sum(1,2) instance of text()"/>
+        </out>
+</xsl:template>
+
+</xsl:stylesheet>
\ No newline at end of file