diff options
author | Adrian Kummerlaender | 2014-06-29 20:36:28 +0200 |
---|---|---|
committer | Adrian Kummerlaender | 2014-06-29 20:36:28 +0200 |
commit | bd39d49464dbd17eb3d4cdbb5784431e43e56fbf (patch) | |
tree | 48013d44196637c6ac434c239be1b4950ba7056f /test/write_file | |
parent | 299d0f6fa3fbd1bfd8d1d6d452e9d055973d0e0e (diff) | |
download | InputXSLT-bd39d49464dbd17eb3d4cdbb5784431e43e56fbf.tar InputXSLT-bd39d49464dbd17eb3d4cdbb5784431e43e56fbf.tar.gz InputXSLT-bd39d49464dbd17eb3d4cdbb5784431e43e56fbf.tar.bz2 InputXSLT-bd39d49464dbd17eb3d4cdbb5784431e43e56fbf.tar.lz InputXSLT-bd39d49464dbd17eb3d4cdbb5784431e43e56fbf.tar.xz InputXSLT-bd39d49464dbd17eb3d4cdbb5784431e43e56fbf.tar.zst InputXSLT-bd39d49464dbd17eb3d4cdbb5784431e43e56fbf.zip |
Switched FunctionWriteFile content parameter to xalan::XalanNode pointer
* i.e. "write-file" now supports the serialization of given DOM structures
** this will be needed e.g. if FunctionTransform returns the result as a DOM tree instead of as a plain string
** enables the creation of multiple XML documents from within a single transformation
*** i.e. backports the functionality provided in XSLT 2.0 by "xsl:result-document" to xalan's XSLT 1.0
* changed test cases accordingly
Diffstat (limited to 'test/write_file')
-rw-r--r-- | test/write_file/reference.xml | 3 | ||||
-rw-r--r-- | test/write_file/transformation.xsl | 13 |
2 files changed, 10 insertions, 6 deletions
diff --git a/test/write_file/reference.xml b/test/write_file/reference.xml index ba10cf5..e16d0b5 100644 --- a/test/write_file/reference.xml +++ b/test/write_file/reference.xml @@ -1,3 +1,2 @@ <?xml version="1.0" encoding="UTF-8"?> -<test_case>Hello world! -</test_case> +<test_case>Hello world!</test_case> diff --git a/test/write_file/transformation.xsl b/test/write_file/transformation.xsl index f65e62d..82afdfc 100644 --- a/test/write_file/transformation.xsl +++ b/test/write_file/transformation.xsl @@ -10,12 +10,17 @@ <xsl:import href="[testcase.xsl]"/> <xsl:template name="implementation"> - <xsl:variable name="result" select="InputXSLT:write-file('test.txt', 'Hello world!')"/> - <xsl:variable name="content" select="InputXSLT:read-file('test.txt')"/> + <xsl:variable name="testContent"> + <content> + <entry>Hello world!</entry> + </content> + </xsl:variable> + <xsl:variable name="result" select="InputXSLT:write-file('test.xml', $testContent)"/> + <xsl:variable name="actualContent" select="InputXSLT:read-file('test.xml')"/> <xsl:choose> - <xsl:when test="$content/self::file/@result = 'success'"> - <xsl:value-of select="$content/self::file/text()"/> + <xsl:when test="$actualContent/self::file/@result = 'success'"> + <xsl:value-of select="$actualContent/self::file/content/entry"/> </xsl:when> <xsl:otherwise> Error during file io |