diff options
Diffstat (limited to 'test/transform')
-rw-r--r-- | test/transform/reference.xml | 4 | ||||
-rw-r--r-- | test/transform/test.xsl | 10 | ||||
-rw-r--r-- | test/transform/transformation.xsl | 25 |
3 files changed, 21 insertions, 18 deletions
diff --git a/test/transform/reference.xml b/test/transform/reference.xml index e537bbc..1c702e8 100644 --- a/test/transform/reference.xml +++ b/test/transform/reference.xml @@ -1,10 +1,10 @@ <?xml version="1.0" encoding="UTF-8"?> <test_case> -<input_tree> +<input_entries> <entry>Hello 1</entry> <entry>Hello 2</entry> <entry>Hello 3</entry> <entry>Hello 4</entry> -</input_tree> +</input_entries> <parameter_value>42</parameter_value> </test_case> diff --git a/test/transform/test.xsl b/test/transform/test.xsl index 7469f92..a9f04a5 100644 --- a/test/transform/test.xsl +++ b/test/transform/test.xsl @@ -14,16 +14,14 @@ indent="yes" /> -<xsl:param name="parameters"/> - <xsl:template match="test"> <test_case> <transform_test> - <input_tree> - <xsl:copy-of select="./entry"/> - </input_tree> + <input_entries> + <xsl:copy-of select="./entries/entry"/> + </input_entries> <parameter_value> - <xsl:copy-of select="$parameters/test * 2"/> + <xsl:value-of select="./parameter/test * 2"/> </parameter_value> </transform_test> </test_case> diff --git a/test/transform/transformation.xsl b/test/transform/transformation.xsl index 686bbf5..1002540 100644 --- a/test/transform/transformation.xsl +++ b/test/transform/transformation.xsl @@ -23,12 +23,10 @@ <xsl:template name="transformer"> <xsl:param name="input"/> <xsl:param name="transformation"/> - <xsl:param name="parameters"/> <xsl:copy-of select="InputXSLT:transform( $input, - $transformation, - $parameters + $transformation )"/> </xsl:template> @@ -36,13 +34,11 @@ <xsl:param name="input"/> <xsl:param name="transformation"/> <xsl:param name="target"/> - <xsl:param name="parameters"/> <xsl:variable name="transformerResult"> <xsl:call-template name="transformer"> - <xsl:with-param name="input" select="string($input)"/> + <xsl:with-param name="input" select="$input"/> <xsl:with-param name="transformation" select="string($transformation)"/> - <xsl:with-param name="parameters" select="xalan:nodeset($parameters)"/> </xsl:call-template> </xsl:variable> @@ -62,12 +58,21 @@ <xsl:template name="implementation"> <xsl:variable name="result"> <xsl:call-template name="generator"> - <xsl:with-param name="input">[test.xml]</xsl:with-param> + <xsl:with-param name="input"> + <test> + <entries> + <entry>Hello 1</entry> + <entry>Hello 2</entry> + <entry>Hello 3</entry> + <entry>Hello 4</entry> + </entries> + <parameter> + <test>21</test> + </parameter> + </test> + </xsl:with-param> <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:variable> |