diff options
Revamped external function result trees
* the root node of the result tree of each function is a domain element
** i.e. the root node of "read-xml-file" is "file", the root node of "read-directory" is "directory"
* the root node contains the result state of the function call encoded in a "result" attribute
** possible values are "success" and "error"
** the root node may contain additional attributes such as the target path of a called transformation
* the actual function result is contained within the child nodes of the function root node
** i.e. the XML file tree returned by "read-xml-file" is a child of the function root node
** if specific errors occured they are also returned as child nodes of the function root node
*** this is currently only the case for "transform" where transformation errors are returned as "error" value node childs of the function root node
* updated test cases accordingly
Diffstat (limited to 'test/external_text_formatter/transformation.xsl')
-rw-r--r-- | test/external_text_formatter/transformation.xsl | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/test/external_text_formatter/transformation.xsl b/test/external_text_formatter/transformation.xsl index 00fe3b3..a94f211 100644 --- a/test/external_text_formatter/transformation.xsl +++ b/test/external_text_formatter/transformation.xsl @@ -20,13 +20,24 @@ ) </xsl:variable> - <xsl:copy-of select="dyn:evaluate($command)/output/*"/> + <xsl:copy-of select="dyn:evaluate($command)"/> </xsl:template> <xsl:template name="implementation"> - <xsl:call-template name="formatter"> - <xsl:with-param name="source" select="InputXSLT:read-file('test.md')"/> - </xsl:call-template> + <xsl:variable name="result"> + <xsl:call-template name="formatter"> + <xsl:with-param name="source" select="InputXSLT:read-file('test.md')"/> + </xsl:call-template> + </xsl:variable> + + <xsl:choose> + <xsl:when test="xalan:nodeset($result)/output/@result = 'success'"> + <xsl:copy-of select="xalan:nodeset($result)/output/*"/> + </xsl:when> + <xsl:otherwise> + Failure during external text formatting + </xsl:otherwise> + </xsl:choose> </xsl:template> </xsl:stylesheet> |