summaryrefslogtreecommitdiff
path: root/tests/extensions
diff options
context:
space:
mode:
authorDaniel Veillard <veillard@src.gnome.org>2001-07-08 20:21:05 +0000
committerDaniel Veillard <veillard@src.gnome.org>2001-07-08 20:21:05 +0000
commit451c656c3b1553c3c7caf4785d67c628bdb8f425 (patch)
tree5e3039a6af2659a4a24e84b04bee9e413c6ccf58 /tests/extensions
parented83d63eccd241ec138d5b88e55d5a907c8238b1 (diff)
downloadlibxslt-451c656c3b1553c3c7caf4785d67c628bdb8f425.tar.gz
libxslt-451c656c3b1553c3c7caf4785d67c628bdb8f425.tar.bz2
libxslt-451c656c3b1553c3c7caf4785d67c628bdb8f425.zip
Norm pointed out that element-available() didn't work, implemented it
* libxslt/extra.c libxslt/functions.c libxslt/transform.[ch] libxslt/variables.h: Norm pointed out that element-available() didn't work, implemented it * tests/extensions/Makefile.am tests/extensions/list.*: added a test for all registered xslt element, function and default extensions. Daniel
Diffstat (limited to 'tests/extensions')
-rw-r--r--tests/extensions/Makefile.am3
-rw-r--r--tests/extensions/list.out37
-rw-r--r--tests/extensions/list.xml1
-rw-r--r--tests/extensions/list.xsl82
4 files changed, 122 insertions, 1 deletions
diff --git a/tests/extensions/Makefile.am b/tests/extensions/Makefile.am
index 2bf71a93..8db24e26 100644
--- a/tests/extensions/Makefile.am
+++ b/tests/extensions/Makefile.am
@@ -4,7 +4,8 @@ $(top_builddir)/libxslt/xsltproc:
@(cd ../../libxslt ; make xsltproc)
EXTRA_DIST = \
- module.xml module.xsl module.out
+ module.xml module.xsl module.out \
+ list.xml list.xsl list.out
all: test
diff --git a/tests/extensions/list.out b/tests/extensions/list.out
new file mode 100644
index 00000000..44843632
--- /dev/null
+++ b/tests/extensions/list.out
@@ -0,0 +1,37 @@
+<?xml version="1.0"?>
+ === 24 Standard elements:
+xsl:apply-templates available
+xsl:apply-imports available
+xsl:call-template available
+xsl:element available
+xsl:attribute available
+xsl:text available
+xsl:processing-instruction available
+xsl:comment available
+xsl:copy available
+xsl:value-of available
+xsl:number available
+xsl:for-each available
+xsl:if available
+xsl:choose available
+xsl:sort available
+xsl:copy-of available
+xsl:message available
+xsl:variable available
+xsl:param available
+xsl:with-param available
+xsl:decimal-format available
+xsl:when available
+xsl:otherwise available
+xsl:fallback available
+ === 5 Extension elements:
+xsl:element available
+saxon:output available
+xalanredirect:write available
+xt:document available
+libxslt:debug available
+ === 3 Extension functions:
+libxslt:node-set() available
+saxon:node-set() available
+xt:node-set() available
+
diff --git a/tests/extensions/list.xml b/tests/extensions/list.xml
new file mode 100644
index 00000000..69d62f2c
--- /dev/null
+++ b/tests/extensions/list.xml
@@ -0,0 +1 @@
+<doc/>
diff --git a/tests/extensions/list.xsl b/tests/extensions/list.xsl
new file mode 100644
index 00000000..ffb03bad
--- /dev/null
+++ b/tests/extensions/list.xsl
@@ -0,0 +1,82 @@
+<?xml version='1.0'?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:saxon="http://icl.com/saxon"
+ xmlns:xalanredirect="org.apache.xalan.xslt.extensions.Redirect"
+ xmlns:xt="http://www.jclark.com/xt"
+ xmlns:libxslt="http://xmlsoft.org/XSLT/namespace"
+ version='1.0'>
+
+<xsl:template match="/">
+<xsl:text> === 24 Standard elements:
+</xsl:text>
+<xsl:if test="element-available('xsl:apply-templates')">xsl:apply-templates available
+</xsl:if>
+<xsl:if test="element-available('xsl:apply-imports')">xsl:apply-imports available
+</xsl:if>
+<xsl:if test="element-available('xsl:call-template')">xsl:call-template available
+</xsl:if>
+<xsl:if test="element-available('xsl:element')">xsl:element available
+</xsl:if>
+<xsl:if test="element-available('xsl:attribute')">xsl:attribute available
+</xsl:if>
+<xsl:if test="element-available('xsl:text')">xsl:text available
+</xsl:if>
+<xsl:if test="element-available('xsl:processing-instruction')">xsl:processing-instruction available
+</xsl:if>
+<xsl:if test="element-available('xsl:comment')">xsl:comment available
+</xsl:if>
+<xsl:if test="element-available('xsl:copy')">xsl:copy available
+</xsl:if>
+<xsl:if test="element-available('xsl:value-of')">xsl:value-of available
+</xsl:if>
+<xsl:if test="element-available('xsl:number')">xsl:number available
+</xsl:if>
+<xsl:if test="element-available('xsl:for-each')">xsl:for-each available
+</xsl:if>
+<xsl:if test="element-available('xsl:if')">xsl:if available
+</xsl:if>
+<xsl:if test="element-available('xsl:choose')">xsl:choose available
+</xsl:if>
+<xsl:if test="element-available('xsl:sort')">xsl:sort available
+</xsl:if>
+<xsl:if test="element-available('xsl:copy-of')">xsl:copy-of available
+</xsl:if>
+<xsl:if test="element-available('xsl:message')">xsl:message available
+</xsl:if>
+<xsl:if test="element-available('xsl:variable')">xsl:variable available
+</xsl:if>
+<xsl:if test="element-available('xsl:param')">xsl:param available
+</xsl:if>
+<xsl:if test="element-available('xsl:with-param')">xsl:with-param available
+</xsl:if>
+<xsl:if test="element-available('xsl:decimal-format')">xsl:decimal-format available
+</xsl:if>
+<xsl:if test="element-available('xsl:when')">xsl:when available
+</xsl:if>
+<xsl:if test="element-available('xsl:otherwise')">xsl:otherwise available
+</xsl:if>
+<xsl:if test="element-available('xsl:fallback')">xsl:fallback available
+</xsl:if>
+<xsl:text> === 5 Extension elements:
+</xsl:text>
+<xsl:if test="element-available('xsl:element')">xsl:element available
+</xsl:if>
+<xsl:if test="element-available('saxon:output')">saxon:output available
+</xsl:if>
+<xsl:if test="element-available('xalanredirect:write')">xalanredirect:write available
+</xsl:if>
+<xsl:if test="element-available('xt:document')">xt:document available
+</xsl:if>
+<xsl:if test="element-available('libxslt:debug')">libxslt:debug available
+</xsl:if>
+<xsl:text> === 3 Extension functions:
+</xsl:text>
+<xsl:if test="function-available('libxslt:node-set')">libxslt:node-set() available
+</xsl:if>
+<xsl:if test="function-available('saxon:node-set')">saxon:node-set() available
+</xsl:if>
+<xsl:if test="function-available('xt:node-set')">xt:node-set() available
+</xsl:if>
+</xsl:template>
+
+</xsl:stylesheet>