aboutsummaryrefslogtreecommitdiff
path: root/test/read_directory
diff options
context:
space:
mode:
Diffstat (limited to 'test/read_directory')
-rw-r--r--test/read_directory/transformation.xsl30
1 files changed, 21 insertions, 9 deletions
diff --git a/test/read_directory/transformation.xsl b/test/read_directory/transformation.xsl
index 9a9a057..f1446a2 100644
--- a/test/read_directory/transformation.xsl
+++ b/test/read_directory/transformation.xsl
@@ -2,22 +2,34 @@
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:xalan="http://xml.apache.org/xalan"
xmlns:InputXSLT="function.inputxslt.application"
- exclude-result-prefixes="InputXSLT"
+ exclude-result-prefixes="InputXSLT xalan"
>
<xsl:include href="[testcase.xsl]"/>
<xsl:template name="implementation">
- <xsl:for-each select="InputXSLT:read-directory('../')">
- <item type="{@type}">
- <name><xsl:value-of select="./name"/></name>
+ <xsl:variable name="result">
+ <xsl:copy-of select="InputXSLT:read-directory('../')"/>
+ </xsl:variable>
- <xsl:if test="@type='file' and ./name='check'">
- <extension><xsl:value-of select="./extension"/></extension>
- </xsl:if>
- </item>
- </xsl:for-each>
+ <xsl:choose>
+ <xsl:when test="xalan:nodeset($result)/directory/@result = 'success'">
+ <xsl:for-each select="xalan:nodeset($result)/directory/entry">
+ <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:when>
+ <xsl:otherwise>
+ Error during directory io
+ </xsl:otherwise>
+ </xsl:choose>
</xsl:template>
</xsl:stylesheet>