summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorWilliam M. Brack <wbrack@src.gnome.org>2006-12-11 22:51:47 +0000
committerWilliam M. Brack <wbrack@src.gnome.org>2006-12-11 22:51:47 +0000
commit3af40cccee3f26de3948603e24736e6591234958 (patch)
tree539ecc2b4190c9079bf11001a2fe995f7967e29b /tests
parent50605fed229824b4a77135fe8b0a1973ca3e1b11 (diff)
downloadlibxslt-3af40cccee3f26de3948603e24736e6591234958.tar.gz
libxslt-3af40cccee3f26de3948603e24736e6591234958.tar.bz2
libxslt-3af40cccee3f26de3948603e24736e6591234958.zip
further enhancement to the original fix for bug #381319 (which was not
* libexslt/functions.c: further enhancement to the original fix for bug #381319 (which was not correct). * tests/exslt/functions: minor enhancement to function.9.xsl; function.10.[xsl,xml,out] added to regression tests to check recursive calls.
Diffstat (limited to 'tests')
-rw-r--r--tests/exslt/functions/Makefile.am3
-rw-r--r--tests/exslt/functions/function.10.err5
-rw-r--r--tests/exslt/functions/function.10.out2
-rw-r--r--tests/exslt/functions/function.10.xml5
-rw-r--r--tests/exslt/functions/function.10.xsl26
-rw-r--r--tests/exslt/functions/function.9.xsl4
6 files changed, 43 insertions, 2 deletions
diff --git a/tests/exslt/functions/Makefile.am b/tests/exslt/functions/Makefile.am
index d1787460..88e8c8d2 100644
--- a/tests/exslt/functions/Makefile.am
+++ b/tests/exslt/functions/Makefile.am
@@ -12,7 +12,8 @@ EXTRA_DIST = \
function.6.out function.6.xml function.6.xsl \
function.7.out function.7.xml function.7.xsl \
function.8.out function.8.xml function.8.xsl \
- function.9.out function.9.xml function.9.xsl
+ function.9.out function.9.xml function.9.xsl \
+ function.10.out function.10.xml function.10.xsl
all:
diff --git a/tests/exslt/functions/function.10.err b/tests/exslt/functions/function.10.err
new file mode 100644
index 00000000..d45035b1
--- /dev/null
+++ b/tests/exslt/functions/function.10.err
@@ -0,0 +1,5 @@
+using 5 and 1
+using 4 and 1
+using 3 and 1
+using 2 and 1
+using 1 and 1
diff --git a/tests/exslt/functions/function.10.out b/tests/exslt/functions/function.10.out
new file mode 100644
index 00000000..9eb1fda2
--- /dev/null
+++ b/tests/exslt/functions/function.10.out
@@ -0,0 +1,2 @@
+<?xml version="1.0"?>
+15
diff --git a/tests/exslt/functions/function.10.xml b/tests/exslt/functions/function.10.xml
new file mode 100644
index 00000000..e586af3f
--- /dev/null
+++ b/tests/exslt/functions/function.10.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0"?>
+<root>
+ <a>5</a>
+ <b>1</b>
+</root>
diff --git a/tests/exslt/functions/function.10.xsl b/tests/exslt/functions/function.10.xsl
new file mode 100644
index 00000000..089911ff
--- /dev/null
+++ b/tests/exslt/functions/function.10.xsl
@@ -0,0 +1,26 @@
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:func="http://exslt.org/functions"
+ xmlns:mg="mg"
+ extension-element-prefixes="func">
+
+ <xsl:template match="root">
+ <xsl:value-of select="mg:recurse(a, b)"/>
+ </xsl:template>
+
+ <func:function name="mg:recurse">
+ <xsl:param name="a"/>
+ <xsl:param name="b"/>
+ <xsl:choose>
+ <xsl:when test="$a > 0">
+ <xsl:message>using <xsl:value-of select="$a"/> and <xsl:value-of select="$b"/></xsl:message>
+ <func:result select="$a+mg:recurse($a - $b, $b)"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <func:result select="0"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </func:function>
+</xsl:stylesheet>
+
+
diff --git a/tests/exslt/functions/function.9.xsl b/tests/exslt/functions/function.9.xsl
index 72d9599c..f609280d 100644
--- a/tests/exslt/functions/function.9.xsl
+++ b/tests/exslt/functions/function.9.xsl
@@ -8,13 +8,15 @@
extension-element-prefixes="exsl func">
<xsl:template match="table">
- <xsl:variable name="cols" select="mg:function(.)"/>
+ <xsl:variable name="cols" select="mg:function(., .)"/>
<xsl:value-of select="$cols"/>
</xsl:template>
<func:function name="mg:function">
<xsl:param name="table"/>
+ <xsl:param name="t2" select="$table/tr[1]"/>
<xsl:param name="tr" select="$table/tr[1]"/>
+ <xsl:param name="trd" select="$tr/td[1]"/>
<func:result select="$tr"/>
</func:function>
</xsl:stylesheet>