diff options
author | Adrian Kummerlaender | 2014-06-30 19:38:02 +0200 |
---|---|---|
committer | Adrian Kummerlaender | 2014-06-30 19:38:02 +0200 |
commit | 2becbedf4cb779b56578e495293b850ff05b738f (patch) | |
tree | e8b98b9079865647a94740e08776cc05f61f2c50 | |
parent | 437b9d9911a4313a834e1840f8cc8e98ce821ac5 (diff) | |
download | InputXSLT-2becbedf4cb779b56578e495293b850ff05b738f.tar InputXSLT-2becbedf4cb779b56578e495293b850ff05b738f.tar.gz InputXSLT-2becbedf4cb779b56578e495293b850ff05b738f.tar.bz2 InputXSLT-2becbedf4cb779b56578e495293b850ff05b738f.tar.lz InputXSLT-2becbedf4cb779b56578e495293b850ff05b738f.tar.xz InputXSLT-2becbedf4cb779b56578e495293b850ff05b738f.tar.zst InputXSLT-2becbedf4cb779b56578e495293b850ff05b738f.zip |
Improved "external-text-formatter" test case helper template
* test cases should also provide examples of how the tested external functions may be integrated into transformations
** helper templates such as "formatter" or "transformer" are an important step into this direction
** especially functions other than plain read-only functions fit much better into a template context than a XPath context
-rw-r--r-- | test/external_text_formatter/transformation.xsl | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/test/external_text_formatter/transformation.xsl b/test/external_text_formatter/transformation.xsl index 2026302..f797b87 100644 --- a/test/external_text_formatter/transformation.xsl +++ b/test/external_text_formatter/transformation.xsl @@ -11,22 +11,22 @@ <xsl:import href="[testcase.xsl]"/> <xsl:template name="formatter"> - <xsl:param name="source"/> + <xsl:param name="format"/> + <xsl:param name="file"/> - <xsl:variable name="command"> - InputXSLT:external-text-formatter( - '/usr/bin/markdown', - $source - ) - </xsl:variable> + <xsl:variable name="content" select="InputXSLT:read-file($file)/text()"/> - <xsl:copy-of select="dyn:evaluate($command)"/> + <xsl:copy-of select="InputXSLT:external-text-formatter( + $format, + $content + )"/> </xsl:template> <xsl:template name="implementation"> <xsl:variable name="result"> <xsl:call-template name="formatter"> - <xsl:with-param name="source" select="InputXSLT:read-file('[test.md]')"/> + <xsl:with-param name="format">/usr/bin/markdown</xsl:with-param> + <xsl:with-param name="file">[test.md]</xsl:with-param> </xsl:call-template> </xsl:variable> |