aboutsummaryrefslogtreecommitdiff
path: root/test/read_xml_file
diff options
context:
space:
mode:
authorAdrian Kummerländer2014-06-01 17:31:17 +0200
committerAdrian Kummerländer2014-06-01 17:31:17 +0200
commit6b5da054693cd348f3c357dbf1c8cb1979fecf6a (patch)
tree8b998b3c3ea08bb7bb5c9a41569ca94d9f3166d5 /test/read_xml_file
parent1a744712426c9c19019b8ebebdd0c703aae204a6 (diff)
downloadInputXSLT-6b5da054693cd348f3c357dbf1c8cb1979fecf6a.tar
InputXSLT-6b5da054693cd348f3c357dbf1c8cb1979fecf6a.tar.gz
InputXSLT-6b5da054693cd348f3c357dbf1c8cb1979fecf6a.tar.bz2
InputXSLT-6b5da054693cd348f3c357dbf1c8cb1979fecf6a.tar.lz
InputXSLT-6b5da054693cd348f3c357dbf1c8cb1979fecf6a.tar.xz
InputXSLT-6b5da054693cd348f3c357dbf1c8cb1979fecf6a.tar.zst
InputXSLT-6b5da054693cd348f3c357dbf1c8cb1979fecf6a.zip
Simplified test case result variable definitions
* variables containing the output of a external function can be defined using the "select" attribute ** tree-like definition is only needed when helper templates such as "transformer" are used ** queries on variables that are instantiated in this fashion need the "self::" prefix before base nodes * changed includes of the "testcase.xsl" base template to imports ** this signifies that the importing template is based on the imported template ** ... and this is exactly what we want to define
Diffstat (limited to 'test/read_xml_file')
-rw-r--r--test/read_xml_file/transformation.xsl10
1 files changed, 4 insertions, 6 deletions
diff --git a/test/read_xml_file/transformation.xsl b/test/read_xml_file/transformation.xsl
index f23273e..ae54099 100644
--- a/test/read_xml_file/transformation.xsl
+++ b/test/read_xml_file/transformation.xsl
@@ -7,16 +7,14 @@
exclude-result-prefixes="InputXSLT xalan"
>
-<xsl:include href="[testcase.xsl]"/>
+<xsl:import href="[testcase.xsl]"/>
<xsl:template name="implementation">
- <xsl:variable name="result">
- <xsl:copy-of select="InputXSLT:read-xml-file('test.txt')"/>
- </xsl:variable>
+ <xsl:variable name="result" select="InputXSLT:read-xml-file('test.txt')"/>
<xsl:choose>
- <xsl:when test="xalan:nodeset($result)/file/@result = 'success'">
- <xsl:for-each select="xalan:nodeset($result)/file/tester/eintrag">
+ <xsl:when test="$result/self::file/@result = 'success'">
+ <xsl:for-each select="$result/self::file/tester/eintrag">
<item><xsl:value-of select="."/></item>
</xsl:for-each>
</xsl:when>