aboutsummaryrefslogtreecommitdiff
path: root/test/transform
diff options
context:
space:
mode:
Diffstat (limited to 'test/transform')
-rw-r--r--test/transform/reference.xml2
-rw-r--r--test/transform/test.xsl2
-rw-r--r--test/transform/transformation.xsl48
3 files changed, 24 insertions, 28 deletions
diff --git a/test/transform/reference.xml b/test/transform/reference.xml
index b98f978..5d45081 100644
--- a/test/transform/reference.xml
+++ b/test/transform/reference.xml
@@ -1,8 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<test_case>
-<transform>
<transform_test>
<parameter_value>42</parameter_value>
</transform_test>
-</transform>
</test_case>
diff --git a/test/transform/test.xsl b/test/transform/test.xsl
index 9a1ea7a..7d4cac0 100644
--- a/test/transform/test.xsl
+++ b/test/transform/test.xsl
@@ -4,7 +4,7 @@
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xalan="http://xml.apache.org/xalan"
xmlns:InputXSLT="function.inputxslt.application"
- exclude-result-prefixes="InputXSLT xalan"
+ exclude-result-prefixes="xalan InputXSLT"
>
<xsl:output
diff --git a/test/transform/transformation.xsl b/test/transform/transformation.xsl
index 24f4df7..fc41eb3 100644
--- a/test/transform/transformation.xsl
+++ b/test/transform/transformation.xsl
@@ -2,44 +2,42 @@
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:dyn="http://exslt.org/dynamic"
xmlns:xalan="http://xml.apache.org/xalan"
xmlns:InputXSLT="function.inputxslt.application"
- exclude-result-prefixes="InputXSLT xalan"
+ exclude-result-prefixes="dyn xalan InputXSLT"
>
-<xsl:output
- method="xml"
- omit-xml-declaration="no"
- encoding="UTF-8"
- indent="yes"
-/>
+<xsl:include href="[testcase.xsl]"/>
<xsl:template name="transformer">
<xsl:param name="transformation"/>
<xsl:param name="target"/>
<xsl:param name="parameters"/>
- <xsl:variable name="result" select="
- InputXSLT:transform($transformation, $target, xalan:nodeset($parameters))
- "/>
+ <xsl:variable name="command">
+ InputXSLT:transform(
+ $transformation,
+ $target,
+ xalan:nodeset($parameters)
+ )
+ </xsl:variable>
+
+ <xsl:variable name="result" select="dyn:evaluate($command)"/>
</xsl:template>
-<xsl:template match="/">
-<test_case>
- <transform>
- <xsl:call-template name="transformer">
- <xsl:with-param name="transformation">test.xsl</xsl:with-param>
- <xsl:with-param name="target">test_actual.xml</xsl:with-param>
- <xsl:with-param name="parameters">
- <test>21</test>
- </xsl:with-param>
- </xsl:call-template>
+<xsl:template name="implementation">
+ <xsl:call-template name="transformer">
+ <xsl:with-param name="transformation">test.xsl</xsl:with-param>
+ <xsl:with-param name="target">test_actual.xml</xsl:with-param>
+ <xsl:with-param name="parameters">
+ <test>21</test>
+ </xsl:with-param>
+ </xsl:call-template>
- <xsl:copy-of select="
- InputXSLT:read-xml-file('test_actual.xml')/test_case/transform_test
- "/>
- </transform>
-</test_case>
+ <xsl:copy-of select="
+ InputXSLT:read-xml-file('test_actual.xml')/test_case/transform_test
+ "/>
</xsl:template>
</xsl:stylesheet>