aboutsummaryrefslogtreecommitdiff
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
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
-rw-r--r--test/default_params/transformation.xsl2
-rw-r--r--test/external_text_formatter/transformation.xsl2
-rw-r--r--test/read_directory/transformation.xsl10
-rw-r--r--test/read_file/transformation.xsl10
-rw-r--r--test/read_xml_file/transformation.xsl10
-rw-r--r--test/transform/transformation.xsl2
6 files changed, 15 insertions, 21 deletions
diff --git a/test/default_params/transformation.xsl b/test/default_params/transformation.xsl
index 0ffaea0..54cf57e 100644
--- a/test/default_params/transformation.xsl
+++ b/test/default_params/transformation.xsl
@@ -6,7 +6,7 @@
exclude-result-prefixes="InputXSLT"
>
-<xsl:include href="[testcase.xsl]"/>
+<xsl:import href="[testcase.xsl]"/>
<xsl:param name="target-file"/>
<xsl:param name="parent-directory"/>
diff --git a/test/external_text_formatter/transformation.xsl b/test/external_text_formatter/transformation.xsl
index a94f211..7be4866 100644
--- a/test/external_text_formatter/transformation.xsl
+++ b/test/external_text_formatter/transformation.xsl
@@ -8,7 +8,7 @@
exclude-result-prefixes="dyn xalan InputXSLT"
>
-<xsl:include href="[testcase.xsl]"/>
+<xsl:import href="[testcase.xsl]"/>
<xsl:template name="formatter">
<xsl:param name="source"/>
diff --git a/test/read_directory/transformation.xsl b/test/read_directory/transformation.xsl
index f1446a2..5955c26 100644
--- a/test/read_directory/transformation.xsl
+++ b/test/read_directory/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-directory('../')"/>
- </xsl:variable>
+ <xsl:variable name="result" select="InputXSLT:read-directory('../')"/>
<xsl:choose>
- <xsl:when test="xalan:nodeset($result)/directory/@result = 'success'">
- <xsl:for-each select="xalan:nodeset($result)/directory/entry">
+ <xsl:when test="$result/self::directory/@result = 'success'">
+ <xsl:for-each select="$result/self::directory/entry">
<item type="{@type}">
<name><xsl:value-of select="./name"/></name>
diff --git a/test/read_file/transformation.xsl b/test/read_file/transformation.xsl
index 9610046..a968f35 100644
--- a/test/read_file/transformation.xsl
+++ b/test/read_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-file('test.txt')"/>
- </xsl:variable>
+ <xsl:variable name="result" select="InputXSLT:read-file('test.txt')"/>
<xsl:choose>
- <xsl:when test="xalan:nodeset($result)/file/@result = 'success'">
- <xsl:value-of select="xalan:nodeset($result)/file"/>
+ <xsl:when test="$result/self::file/@result = 'success'">
+ <xsl:value-of select="$result/self::file"/>
</xsl:when>
<xsl:otherwise>
Error during file io
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>
diff --git a/test/transform/transformation.xsl b/test/transform/transformation.xsl
index 412036b..6bc759d 100644
--- a/test/transform/transformation.xsl
+++ b/test/transform/transformation.xsl
@@ -8,7 +8,7 @@
exclude-result-prefixes="dyn xalan InputXSLT"
>
-<xsl:include href="[testcase.xsl]"/>
+<xsl:import href="[testcase.xsl]"/>
<xsl:template name="transformer">
<xsl:param name="transformation"/>