diff options
author | Daniel Veillard <veillard@src.gnome.org> | 2001-10-02 15:13:45 +0000 |
---|---|---|
committer | Daniel Veillard <veillard@src.gnome.org> | 2001-10-02 15:13:45 +0000 |
commit | 0ccc122e5aa6b75eee8e74a0dec0f029f3139397 (patch) | |
tree | 918636150b0df01717c8319225b528392d3bed9b /tests/extensions | |
parent | e95c99be9e5719479fb6b226ec135f4ed238675b (diff) | |
download | libxslt-0ccc122e5aa6b75eee8e74a0dec0f029f3139397.tar.gz libxslt-0ccc122e5aa6b75eee8e74a0dec0f029f3139397.tar.bz2 libxslt-0ccc122e5aa6b75eee8e74a0dec0f029f3139397.zip |
applied patch from Darren Graves adding support for Saxon's evaluate &
* libxslt/extra.[ch] tests/extensions/list.*
tests/extensions/evaluate.*: applied patch from Darren Graves
adding support for Saxon's evaluate & expression extension functions
http://users.iclway.co.uk/mhkay/saxon/saxon6.3/extensions.html
Daniel
Diffstat (limited to 'tests/extensions')
-rw-r--r-- | tests/extensions/evaluate.out | 2 | ||||
-rw-r--r-- | tests/extensions/evaluate.xml | 11 | ||||
-rw-r--r-- | tests/extensions/evaluate.xsl | 26 | ||||
-rw-r--r-- | tests/extensions/list.out | 8 | ||||
-rw-r--r-- | tests/extensions/list.xml | 2 | ||||
-rw-r--r-- | tests/extensions/list.xsl | 14 |
6 files changed, 60 insertions, 3 deletions
diff --git a/tests/extensions/evaluate.out b/tests/extensions/evaluate.out new file mode 100644 index 00000000..b4e4c7c6 --- /dev/null +++ b/tests/extensions/evaluate.out @@ -0,0 +1,2 @@ +<?xml version="1.0"?> +one4onetwofour-onefour-two diff --git a/tests/extensions/evaluate.xml b/tests/extensions/evaluate.xml new file mode 100644 index 00000000..bddd5281 --- /dev/null +++ b/tests/extensions/evaluate.xml @@ -0,0 +1,11 @@ +<doc> + <one>one</one> + <two>two</two> + <three>/doc/one</three> + <four> + <doc> + <one>four-one</one> + <two>four-two</two> + </doc> + </four> +</doc>
\ No newline at end of file diff --git a/tests/extensions/evaluate.xsl b/tests/extensions/evaluate.xsl new file mode 100644 index 00000000..a58470f6 --- /dev/null +++ b/tests/extensions/evaluate.xsl @@ -0,0 +1,26 @@ +<?xml version='1.0'?> +<xsl:stylesheet + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:libxslt="http://xmlsoft.org/XSLT/namespace" + version='1.0'> + +<xsl:variable name="expression" select="libxslt:expression('doc/two')"/> + + <xsl:template match="/"> + <xsl:variable name="string">doc/one</xsl:variable> + <xsl:value-of select="libxslt:evaluate($string)"/> + <xsl:value-of select="count(libxslt:evaluate('/doc/one')/../*)"/> + <xsl:value-of select="libxslt:evaluate(/doc/three)"/> + <xsl:value-of select="libxslt:eval($expression)"/> + <xsl:apply-templates/> + </xsl:template> + + <xsl:template match="four"> + <xsl:variable name="string">doc/one</xsl:variable> + <xsl:value-of select="libxslt:evaluate($string)"/> + <xsl:value-of select="libxslt:eval($expression)"/> + </xsl:template> + + <xsl:template match="text()"/> + +</xsl:stylesheet> diff --git a/tests/extensions/list.out b/tests/extensions/list.out index 44843632..c910ba08 100644 --- a/tests/extensions/list.out +++ b/tests/extensions/list.out @@ -30,8 +30,14 @@ saxon:output available xalanredirect:write available xt:document available libxslt:debug available - === 3 Extension functions: + === 9 Extension functions: libxslt:node-set() available saxon:node-set() available xt:node-set() available +libxslt:evaluate() available +saxon:evaluate() available +libxslt:expression() available +saxon:expression() available +libxslt:eval() available +saxon:eval() available diff --git a/tests/extensions/list.xml b/tests/extensions/list.xml index 69d62f2c..ff29a913 100644 --- a/tests/extensions/list.xml +++ b/tests/extensions/list.xml @@ -1 +1 @@ -<doc/> +<doc/>
\ No newline at end of file diff --git a/tests/extensions/list.xsl b/tests/extensions/list.xsl index ffb03bad..d4fc6693 100644 --- a/tests/extensions/list.xsl +++ b/tests/extensions/list.xsl @@ -69,7 +69,7 @@ </xsl:if> <xsl:if test="element-available('libxslt:debug')">libxslt:debug available </xsl:if> -<xsl:text> === 3 Extension functions: +<xsl:text> === 9 Extension functions: </xsl:text> <xsl:if test="function-available('libxslt:node-set')">libxslt:node-set() available </xsl:if> @@ -77,6 +77,18 @@ </xsl:if> <xsl:if test="function-available('xt:node-set')">xt:node-set() available </xsl:if> +<xsl:if test="function-available('libxslt:evaluate')">libxslt:evaluate() available +</xsl:if> +<xsl:if test="function-available('saxon:evaluate')">saxon:evaluate() available +</xsl:if> +<xsl:if test="function-available('libxslt:expression')">libxslt:expression() available +</xsl:if> +<xsl:if test="function-available('saxon:expression')">saxon:expression() available +</xsl:if> +<xsl:if test="function-available('libxslt:eval')">libxslt:eval() available +</xsl:if> +<xsl:if test="function-available('saxon:eval')">saxon:eval() available +</xsl:if> </xsl:template> </xsl:stylesheet> |