[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

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
xml attribute existance check
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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.