aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAdrian Kummerlaender2014-07-06 14:33:01 +0200
committerAdrian Kummerlaender2014-07-06 14:33:01 +0200
commite172aee6569df6a3f9abd8cd647eded1bb0612b3 (patch)
treeacaf3f8d037f651d0ea24aa4aef968701dc0843e /test
parenta02dce3c8e6086acbfe9c57c3ee4bb386bfbebc2 (diff)
downloadInputXSLT-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.xsl52
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>