This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Using document() to check the existance of a file


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]