diff options
author | Adrian Kummerlaender | 2014-07-06 14:33:01 +0200 |
---|---|---|
committer | Adrian Kummerlaender | 2014-07-06 14:33:01 +0200 |
commit | e172aee6569df6a3f9abd8cd647eded1bb0612b3 (patch) | |
tree | acaf3f8d037f651d0ea24aa4aef968701dc0843e /test | |
parent | a02dce3c8e6086acbfe9c57c3ee4bb386bfbebc2 (diff) | |
download | InputXSLT-e172aee6569df6a3f9abd8cd647eded1bb0612b3.tar InputXSLT-e172aee6569df6a3f9abd8cd647eded1bb0612b3.tar.gz InputXSLT-e172aee6569df6a3f9abd8cd647eded1bb0612b3.tar.bz2 InputXSLT-e172aee6569df6a3f9abd8cd647eded1bb0612b3.tar.lz InputXSLT-e172aee6569df6a3f9abd8cd647eded1bb0612b3.tar.xz InputXSLT-e172aee6569df6a3f9abd8cd647eded1bb0612b3.tar.zst InputXSLT-e172aee6569df6a3f9abd8cd647eded1bb0612b3.zip |
Simplified FunctionTransform test case helper templates
* as FunctionTransform returns the result as a DOM tree there is no reason for including the separately tested FunctionWriteFile in this test case
Diffstat (limited to 'test')
-rw-r--r-- | test/transform/transformation.xsl | 52 |
1 files changed, 6 insertions, 46 deletions
diff --git a/test/transform/transformation.xsl b/test/transform/transformation.xsl index 1002540..7cfb8f9 100644 --- a/test/transform/transformation.xsl +++ b/test/transform/transformation.xsl @@ -10,54 +10,19 @@ <xsl:import href="[testcase.xsl]"/> -<xsl:template name="writer"> - <xsl:param name="file"/> - <xsl:param name="content"/> - - <xsl:copy-of select="InputXSLT:write-file( - $file, - $content - )"/> -</xsl:template> - <xsl:template name="transformer"> <xsl:param name="input"/> <xsl:param name="transformation"/> <xsl:copy-of select="InputXSLT:transform( $input, - $transformation + string($transformation) )"/> </xsl:template> -<xsl:template name="generator"> - <xsl:param name="input"/> - <xsl:param name="transformation"/> - <xsl:param name="target"/> - - <xsl:variable name="transformerResult"> - <xsl:call-template name="transformer"> - <xsl:with-param name="input" select="$input"/> - <xsl:with-param name="transformation" select="string($transformation)"/> - </xsl:call-template> - </xsl:variable> - - <xsl:variable name="writerResult"> - <xsl:call-template name="writer"> - <xsl:with-param name="file" select="string($target)"/> - <xsl:with-param name="content" select="xalan:nodeset($transformerResult)/transformation/*"/> - </xsl:call-template> - </xsl:variable> - - <generator transformation="{$transformation}" target="{$target}"> - <xsl:copy-of select="$transformerResult"/> - <xsl:copy-of select="$writerResult"/> - </generator> -</xsl:template> - <xsl:template name="implementation"> <xsl:variable name="result"> - <xsl:call-template name="generator"> + <xsl:call-template name="transformer"> <xsl:with-param name="input"> <test> <entries> @@ -72,22 +37,17 @@ </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:call-template> </xsl:variable> - <xsl:variable name="generator" select="xalan:nodeset($result)/generator"/> - <xsl:variable name="transformation" select="$generator/transformation/@result"/> - <xsl:variable name="write" select="$generator/file/@result"/> + <xsl:variable name="transformation" select="xalan:nodeset($result)/transformation"/> <xsl:choose> - <xsl:when test="$transformation = 'success' and $write = 'success'"> - <xsl:copy-of select=" - InputXSLT:read-file('test_actual.xml')/test_case/transform_test/* - "/> + <xsl:when test="$transformation/@result = 'success'"> + <xsl:copy-of select="$transformation/test_case/transform_test/*"/> </xsl:when> <xsl:otherwise> - <xsl:copy-of select="xalan:nodeset($result)/generator/*"/> + <xsl:copy-of select="$transformation/*"/> </xsl:otherwise> </xsl:choose> </xsl:template> |