This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Using document() to check the existance of a file
- To: "xsl-list at mulberrytech dot com" <xsl-list at mulberrytech dot com>
- Subject: Using document() to check the existance of a file
- From: Mac Schwarz <mcschwar at phil dot uni-erlangen dot de>
- Date: Wed, 11 Oct 2000 17:34:43 +0200
- Organization: FAU Erlangen-Nuernberg
- Reply-To: xsl-list at mulberrytech dot com
Hi,
I'd like to check the existance of an file with the document function.
Depending oon this test I want to generate a link:
<xsl:choose>
<xsl:when test="document('help.xml')">
<a>
<xsl:attribute name="href">help.xml</xsl:attribute>[help]
</a>
</xsl:when>
<xsl:otherwise>
<a>
<xsl:attribute name="href">helpfiles/help.xml</xsl:attribute>[help]
</a>
</xsl:otherwise>
</xsl:choose>
The above snippet from my xsl file won't work (and I tried several othe
ways also) but it should illustate what I want to achieve. If a file
help.xml exists in the same directory as the xml file it should generate
a link to this 'help.xml' otherwise it should generate a link to the
main help file at helpfiles/help.xml.
Any ideas how to use the document function for that task? Or is there
another and better way to generate the links?
Regards,
mac
--
Mac Schwarz / AERIA Projekt / Inst. f. Klassische Archaeologie
e-mail: mac@aeria.phil.uni-erlangen.de / Tel.: 09131-85-24791
FAU Erlangen-Nuernberg / Kochstr.4 / 91054 Erlangen
<http://www.phil.uni-erlangen.de/~p1altar/aeriahome.html>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list