aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAdrian Kummerländer2014-05-27 21:25:40 +0200
committerAdrian Kummerländer2014-05-27 21:25:40 +0200
commit802d416040aa31d72defa7a9227cd31b0885bc60 (patch)
tree8bd3253f4b6e4e57ac54557a7bf4ea705b5a15d1 /test
parent6efa3385ae0fab5f7b6e3a113d1da18cfbed8591 (diff)
downloadInputXSLT-802d416040aa31d72defa7a9227cd31b0885bc60.tar
InputXSLT-802d416040aa31d72defa7a9227cd31b0885bc60.tar.gz
InputXSLT-802d416040aa31d72defa7a9227cd31b0885bc60.tar.bz2
InputXSLT-802d416040aa31d72defa7a9227cd31b0885bc60.tar.lz
InputXSLT-802d416040aa31d72defa7a9227cd31b0885bc60.tar.xz
InputXSLT-802d416040aa31d72defa7a9227cd31b0885bc60.tar.zst
InputXSLT-802d416040aa31d72defa7a9227cd31b0885bc60.zip
Expanded "read-directory" test case
* verifying type attribute and extension value node if available
Diffstat (limited to 'test')
-rw-r--r--test/read_directory/reference.xml35
-rw-r--r--test/read_directory/transformation.xsl10
2 files changed, 36 insertions, 9 deletions
diff --git a/test/read_directory/reference.xml b/test/read_directory/reference.xml
index 94e639e..4c1000b 100644
--- a/test/read_directory/reference.xml
+++ b/test/read_directory/reference.xml
@@ -1,10 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<test_case>
-<item>common</item>
-<item>default_params</item>
-<item>external_text_formatter</item>
-<item>read_directory</item>
-<item>read_file</item>
-<item>read_xml_file</item>
-<item>transform</item>
+<item type="file">
+<name>Session</name>
+</item>
+<item type="file">
+<name>check</name>
+<extension>.sh</extension>
+</item>
+<item type="directory">
+<name>common</name>
+</item>
+<item type="directory">
+<name>default_params</name>
+</item>
+<item type="directory">
+<name>external_text_formatter</name>
+</item>
+<item type="directory">
+<name>read_directory</name>
+</item>
+<item type="directory">
+<name>read_file</name>
+</item>
+<item type="directory">
+<name>read_xml_file</name>
+</item>
+<item type="directory">
+<name>transform</name>
+</item>
</test_case>
diff --git a/test/read_directory/transformation.xsl b/test/read_directory/transformation.xsl
index 5bcace1..9a9a057 100644
--- a/test/read_directory/transformation.xsl
+++ b/test/read_directory/transformation.xsl
@@ -9,8 +9,14 @@
<xsl:include href="[testcase.xsl]"/>
<xsl:template name="implementation">
- <xsl:for-each select="InputXSLT:read-directory('../')[@type='directory']">
- <item><xsl:value-of select="name"/></item>
+ <xsl:for-each select="InputXSLT:read-directory('../')">
+ <item type="{@type}">
+ <name><xsl:value-of select="./name"/></name>
+
+ <xsl:if test="@type='file' and ./name='check'">
+ <extension><xsl:value-of select="./extension"/></extension>
+ </xsl:if>
+ </item>
</xsl:for-each>
</xsl:template>