[xsl] check with XSL if a file is available

Subject: [xsl] check with XSL if a file is available
From: "Joel Fisler" <fisler@xxxxxxxxxxxx>
Date: 7 Jul 2003 16:09:21 +0200
hi,
i want to implement a choose statment that defines what to do if a document is available and what to do if this document is not available. to check whether a file is available or not i use the following structure:


<xsl:choose>
<xsl:when test="document(path/filename.xml)">
do this with the file
</when>
<otherwise>
do something else without the file
</otherwise>
</choose>

now if "filename.xml" is available, everything works just fine. but if not, the otherwise-statment is not running at all, instead cocoon just responds with an error "file not found":
javax.xml.transform.TransformerException: Errors in XSLT transformation:
Fatal: File file:/home/gis/fisler/sharqi/tomcat/webapps/GITTA/student/presentation/html/gittaNavLesson.xsl; Line 18; Column 94; /home/gis/fisler/sharqi/tomcat/webapps/GITTA/student/content/institut/giuz.xml (No such file or directory)



of course this file doesnt exist, thats why i have the "otherwise" statement :-) how can i make this work? i have been trying to fix this for two days with many different trials and errors, but none worked. if anyone has a suggestion? thanks.


i am using cocoon 2.0.4.

bye
joel


XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list



Current Thread