diff options
author | Adrian Kummerlaender | 2014-07-05 21:55:48 +0200 |
---|---|---|
committer | Adrian Kummerlaender | 2014-07-05 21:55:48 +0200 |
commit | a02dce3c8e6086acbfe9c57c3ee4bb386bfbebc2 (patch) | |
tree | 669ad392772fcc9ab4eaa9e1a410156d6d4cc616 /test/transform | |
parent | f05e742b88e3ebf7401c252332022f1a2f7eb8b0 (diff) | |
download | InputXSLT-a02dce3c8e6086acbfe9c57c3ee4bb386bfbebc2.tar InputXSLT-a02dce3c8e6086acbfe9c57c3ee4bb386bfbebc2.tar.gz InputXSLT-a02dce3c8e6086acbfe9c57c3ee4bb386bfbebc2.tar.bz2 InputXSLT-a02dce3c8e6086acbfe9c57c3ee4bb386bfbebc2.tar.lz InputXSLT-a02dce3c8e6086acbfe9c57c3ee4bb386bfbebc2.tar.xz InputXSLT-a02dce3c8e6086acbfe9c57c3ee4bb386bfbebc2.tar.zst InputXSLT-a02dce3c8e6086acbfe9c57c3ee4bb386bfbebc2.zip |
Revamped implementation to support FunctionTransform XalanNode input
* FunctionTransform now accepts xalan::XalanNode base xalan::XSLTInputSource instances as input parameter
** such xalan::XSLTInputSource instances were already supported for the stylesheet parameter but not for the input parameter
** e.g. it is now possible to generate a DOM inside a transformation, pass the DOM into a embedded transformation as input, modifiy the output of that transformation, pass this modified DOM into another transformation and so on... you get the point
* this required a revamp of TransformationFacade
** it is now a transformation independent wrapper for xalan::XalanTransformer
*** as such is was renamed to TransformerFacade
** removed error catching template factory method "try_create" as it is not needed anymore
** "std::basic_ostream<char>&" taking "generate" member method overloads were removed
** the set of "generate" member overloads was reduced to two methods accepting xalan::XSLTInputSource and xalan::FormatterListener as parameters
* the core problem first documented in 299d0f6 was solved by transforming the input parameter into a xerces DOM and wrapping this DOM inside a xalan::XercesDOMWrapperParsedSource instance
* serialization of the transformation result for file / std::cout output is now performed directly by the ixslt frontend
* removed 'stylesheet parameter' parameter from FunctionTransform
** the functionality provided by this is easily replicated using the now possible DOM input parameter
** this was done to simplify the interface and reduce unnecessary feature duplication
* updated FunctionTransform test case accordingly
* added "generate" template function to ixslt frontend
** wraps TransformerFacade and manages ist input arguments
** handles serialization to stream
* this commit marks a important milestone towards the goals defined in 741a70f
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> |