aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAdrian Kummerländer2014-05-29 13:26:37 +0200
committerAdrian Kummerländer2014-05-29 13:26:37 +0200
commit3bc793d95293d40dbab62c593ce4ceaa86fae25b (patch)
tree07a0f99d72a074a75955a593318cc8bcd394f4c2 /test
parent52b60c1a8c23f11ab18fad06e0957490c7436e0a (diff)
downloadInputXSLT-3bc793d95293d40dbab62c593ce4ceaa86fae25b.tar
InputXSLT-3bc793d95293d40dbab62c593ce4ceaa86fae25b.tar.gz
InputXSLT-3bc793d95293d40dbab62c593ce4ceaa86fae25b.tar.bz2
InputXSLT-3bc793d95293d40dbab62c593ce4ceaa86fae25b.tar.lz
InputXSLT-3bc793d95293d40dbab62c593ce4ceaa86fae25b.tar.xz
InputXSLT-3bc793d95293d40dbab62c593ce4ceaa86fae25b.tar.zst
InputXSLT-3bc793d95293d40dbab62c593ce4ceaa86fae25b.zip
Improved TransformationFacade error handling
* ErrorHandler class created in 5859cb6 now caches all errors instead of pushing them to std::cerr ** cached errors are retrieved by TransformationFacade's "generate" member method * test frontend pushes all errors to std::cerr * FunctionTransform returns errors to the calling template as XML ** FunctionTransform test case demonstrates how one may test for successful transformation * "generate" member method returns std::string vector wrapped in a std::unique_ptr ** this is used as a kind of optional pointer, as the std::unique_ptr instance only wraps a vector if errors where actually generated
Diffstat (limited to 'test')
-rw-r--r--test/transform/transformation.xsl31
1 files changed, 20 insertions, 11 deletions
diff --git a/test/transform/transformation.xsl b/test/transform/transformation.xsl
index f2cc787..19c42ae 100644
--- a/test/transform/transformation.xsl
+++ b/test/transform/transformation.xsl
@@ -23,21 +23,30 @@
)
</xsl:variable>
- <xsl:variable name="result" select="dyn:evaluate($command)"/>
+ <xsl:copy-of select="dyn:evaluate($command)"/>
</xsl:template>
<xsl:template name="implementation">
- <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:variable name="result">
+ <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:variable>
- <xsl:copy-of select="
- InputXSLT:read-xml-file('test_actual.xml')/test_case/transform_test/*
- "/>
+ <xsl:choose>
+ <xsl:when test="xalan:nodeset($result)/result/error">
+ <xsl:copy-of select="xalan:nodeset($result)/result/error"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:copy-of select="
+ InputXSLT:read-xml-file('test_actual.xml')/test_case/transform_test/*
+ "/>
+ </xsl:otherwise>
+ </xsl:choose>
</xsl:template>
</xsl:stylesheet>