aboutsummaryrefslogtreecommitdiff
path: root/test/transform
diff options
context:
space:
mode:
Diffstat (limited to 'test/transform')
-rw-r--r--test/transform/reference.xml19
-rw-r--r--test/transform/test.xsl12
-rw-r--r--test/transform/transformation.xsl12
3 files changed, 34 insertions, 9 deletions
diff --git a/test/transform/reference.xml b/test/transform/reference.xml
index 37c060e..d3675bc 100644
--- a/test/transform/reference.xml
+++ b/test/transform/reference.xml
@@ -1,11 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<test_case>
-<transform>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
+<transform>
+<transform_test>
+<argument_value>42</argument_value>
+<transformation_content>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;xsl:stylesheet
version="1.0"
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"
+ exclude-result-prefixes="InputXSLT xalan"
&gt;
&lt;xsl:output
@@ -18,12 +22,17 @@
&lt;xsl:template match="/"&gt;
&lt;test_case&gt;
&lt;transform&gt;
+ &lt;xsl:variable name="argument"&gt;
+ &lt;key&gt;test&lt;/key&gt;
+ &lt;value&gt;42&lt;/value&gt;
+ &lt;/xsl:variable&gt;
+
&lt;xsl:variable
name = "result"
- select = "InputXSLT:transform('test.xsl', 'test_actual.xml')"
+ select = "InputXSLT:transform('test.xsl', 'test_actual.xml', $argument)"
/&gt;
- &lt;xsl:value-of select="
+ &lt;xsl:copy-of select="
InputXSLT:read-xml-file('test_actual.xml')/test_case/transform_test
"/&gt;
&lt;/transform&gt;
@@ -31,5 +40,7 @@
&lt;/xsl:template&gt;
&lt;/xsl:stylesheet&gt;
+</transformation_content>
+</transform_test>
</transform>
</test_case>
diff --git a/test/transform/test.xsl b/test/transform/test.xsl
index 40134c4..677e80d 100644
--- a/test/transform/test.xsl
+++ b/test/transform/test.xsl
@@ -2,8 +2,9 @@
<xsl:stylesheet
version="1.0"
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"
+ exclude-result-prefixes="InputXSLT xalan"
>
<xsl:output
@@ -13,10 +14,17 @@
indent="yes"
/>
+<xsl:param name="arguments"/>
+
<xsl:template match="/">
<test_case>
<transform_test>
- <xsl:value-of select="InputXSLT:read-file('transformation.xsl')"/>
+ <argument_value>
+ <xsl:value-of select="xalan:nodeset($arguments)/value"/>
+ </argument_value>
+ <transformation_content>
+ <xsl:value-of select="InputXSLT:read-file('transformation.xsl')"/>
+ </transformation_content>
</transform_test>
</test_case>
</xsl:template>
diff --git a/test/transform/transformation.xsl b/test/transform/transformation.xsl
index 9039642..7348fef 100644
--- a/test/transform/transformation.xsl
+++ b/test/transform/transformation.xsl
@@ -2,8 +2,9 @@
<xsl:stylesheet
version="1.0"
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"
+ exclude-result-prefixes="InputXSLT xalan"
>
<xsl:output
@@ -16,12 +17,17 @@
<xsl:template match="/">
<test_case>
<transform>
+ <xsl:variable name="argument">
+ <key>test</key>
+ <value>42</value>
+ </xsl:variable>
+
<xsl:variable
name = "result"
- select = "InputXSLT:transform('test.xsl', 'test_actual.xml')"
+ select = "InputXSLT:transform('test.xsl', 'test_actual.xml', $argument)"
/>
- <xsl:value-of select="
+ <xsl:copy-of select="
InputXSLT:read-xml-file('test_actual.xml')/test_case/transform_test
"/>
</transform>