aboutsummaryrefslogtreecommitdiff
path: root/dummy
diff options
context:
space:
mode:
authorAdrian Kummerländer2014-04-26 22:07:13 +0200
committerAdrian Kummerländer2014-04-26 22:07:13 +0200
commit5fde046561caa11a58abd13cf1f469fdce5c53f1 (patch)
tree859b095235b093b448ac5c33aaa5e456d62c984a /dummy
parenteba5513f82f0e1458543e8646db0317d7211cf96 (diff)
downloadInputXSLT-5fde046561caa11a58abd13cf1f469fdce5c53f1.tar
InputXSLT-5fde046561caa11a58abd13cf1f469fdce5c53f1.tar.gz
InputXSLT-5fde046561caa11a58abd13cf1f469fdce5c53f1.tar.bz2
InputXSLT-5fde046561caa11a58abd13cf1f469fdce5c53f1.tar.lz
InputXSLT-5fde046561caa11a58abd13cf1f469fdce5c53f1.tar.xz
InputXSLT-5fde046561caa11a58abd13cf1f469fdce5c53f1.tar.zst
InputXSLT-5fde046561caa11a58abd13cf1f469fdce5c53f1.zip
Added status information to external read-directory function
* updated test transformation accordingly
Diffstat (limited to 'dummy')
-rw-r--r--dummy/transform.xsl34
1 files changed, 23 insertions, 11 deletions
diff --git a/dummy/transform.xsl b/dummy/transform.xsl
index 323ecdb..fc6c15b 100644
--- a/dummy/transform.xsl
+++ b/dummy/transform.xsl
@@ -24,25 +24,37 @@
<xsl:value-of select="$testFile/self::content"/>
</xsl:when>
<xsl:otherwise>
- Failed to read test.txt
+ Could not read file.
</xsl:otherwise>
</xsl:choose>
</div>
+
<ul id="xml">
<xsl:for-each select="external:read-xml-file('test.txt')/tester/eintrag">
<li><xsl:value-of select="."/></li>
</xsl:for-each>
</ul>
- <ul id="filelist1">
- <xsl:for-each select="external:read-directory('../')[@type='file']">
- <li><xsl:value-of select="."/></li>
- </xsl:for-each>
- </ul>
- <ul id="filelist2">
- <xsl:for-each select="external:read-directory('../')[@type='directory']">
- <li><xsl:value-of select="."/></li>
- </xsl:for-each>
- </ul>
+
+ <div id="filelists">
+ <xsl:variable name="fileList" select="external:read-directory('../')"/>
+ <xsl:choose>
+ <xsl:when test="$fileList/self::status = 'successful'">
+ <ul id="filelist1">
+ <xsl:for-each select="$fileList/self::content/item[@type='file']">
+ <li><xsl:value-of select="."/></li>
+ </xsl:for-each>
+ </ul>
+ <ul id="filelist2">
+ <xsl:for-each select="$fileList/self::content/item[@type='directory']">
+ <li><xsl:value-of select="."/></li>
+ </xsl:for-each>
+ </ul>
+ </xsl:when>
+ <xsl:otherwise>
+ Could not read directory.
+ </xsl:otherwise>
+ </xsl:choose>
+ </div>
</body>
</html>
</xsl:template>