Using document() to check the existance of a file

Subject: Using document() to check the existance of a file
From: Mac Schwarz <mcschwar@xxxxxxxxxxxxxxxxxxxx>
Date: Wed, 11 Oct 2000 17:34:43 +0200
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@xxxxxxxxxxxxxxxxxxxxxxxxxx  / 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


Current Thread