diff options
Diffstat (limited to 'test/transform')
-rw-r--r-- | test/transform/reference.xml | 40 | ||||
-rw-r--r-- | test/transform/test.xsl | 11 | ||||
-rw-r--r-- | test/transform/transformation.xsl | 26 |
3 files changed, 22 insertions, 55 deletions
diff --git a/test/transform/reference.xml b/test/transform/reference.xml index d3675bc..b98f978 100644 --- a/test/transform/reference.xml +++ b/test/transform/reference.xml @@ -2,45 +2,7 @@ <test_case> <transform> <transform_test> -<argument_value>42</argument_value> -<transformation_content><?xml version="1.0" encoding="UTF-8"?> -<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 xalan" -> - -<xsl:output - method="xml" - omit-xml-declaration="no" - encoding="UTF-8" - indent="yes" -/> - -<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', $argument)" - /> - - <xsl:copy-of select=" - InputXSLT:read-xml-file('test_actual.xml')/test_case/transform_test - "/> - </transform> -</test_case> -</xsl:template> - -</xsl:stylesheet> -</transformation_content> +<parameter_value>42</parameter_value> </transform_test> </transform> </test_case> diff --git a/test/transform/test.xsl b/test/transform/test.xsl index 677e80d..9a1ea7a 100644 --- a/test/transform/test.xsl +++ b/test/transform/test.xsl @@ -14,17 +14,14 @@ indent="yes" /> -<xsl:param name="arguments"/> +<xsl:param name="parameters"/> <xsl:template match="/"> <test_case> <transform_test> - <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> + <parameter_value> + <xsl:value-of select="$parameters/test * 2"/> + </parameter_value> </transform_test> </test_case> </xsl:template> diff --git a/test/transform/transformation.xsl b/test/transform/transformation.xsl index 7348fef..24f4df7 100644 --- a/test/transform/transformation.xsl +++ b/test/transform/transformation.xsl @@ -14,18 +14,26 @@ indent="yes" /> +<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:template> + <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', $argument)" - /> + <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 |