diff options
author | Adrian Kummerländer | 2014-04-27 17:24:30 +0200 |
---|---|---|
committer | Adrian Kummerländer | 2014-04-27 17:24:30 +0200 |
commit | 947a8389728ff7d052fa820f598da3c17802f3d1 (patch) | |
tree | c24c7f19ea9b7b6fb6999e1c065b38598ebd27df /dummy | |
parent | 5fde046561caa11a58abd13cf1f469fdce5c53f1 (diff) | |
download | InputXSLT-947a8389728ff7d052fa820f598da3c17802f3d1.tar InputXSLT-947a8389728ff7d052fa820f598da3c17802f3d1.tar.gz InputXSLT-947a8389728ff7d052fa820f598da3c17802f3d1.tar.bz2 InputXSLT-947a8389728ff7d052fa820f598da3c17802f3d1.tar.lz InputXSLT-947a8389728ff7d052fa820f598da3c17802f3d1.tar.xz InputXSLT-947a8389728ff7d052fa820f598da3c17802f3d1.tar.zst InputXSLT-947a8389728ff7d052fa820f598da3c17802f3d1.zip |
Added status information to external read-xml-file function
* XML tree is contained below the _content_ node if read was successful
** status is set to error otherwise
* updated test transformation accordingly
Diffstat (limited to 'dummy')
-rw-r--r-- | dummy/transform.xsl | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/dummy/transform.xsl b/dummy/transform.xsl index fc6c15b..359db05 100644 --- a/dummy/transform.xsl +++ b/dummy/transform.xsl @@ -24,16 +24,26 @@ <xsl:value-of select="$testFile/self::content"/> </xsl:when> <xsl:otherwise> - Could not read file. + Could not read text 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> + <div id="xml"> + <xsl:variable name="testXml" select="external:read-xml-file('test.txt')"/> + <xsl:choose> + <xsl:when test="$testXml/self::status = 'successful'"> + <ul id="xml"> + <xsl:for-each select="$testXml/self::content/tester/eintrag"> + <li><xsl:value-of select="."/></li> + </xsl:for-each> + </ul> + </xsl:when> + <xsl:otherwise> + Could not read XML file. + </xsl:otherwise> + </xsl:choose> + </div> <div id="filelists"> <xsl:variable name="fileList" select="external:read-directory('../')"/> |