Subject: Re: [xsl] mystery #2: testing document() without failure From: Robert Koberg <rob@xxxxxxxxxx> Date: Sat, 13 Apr 2002 02:48:58 -0700 |
<xsl:variable name="test" select="document('test.xml')/test"/> <xsl:choose> <xsl:when test="boolean($test)"> <xsl:apply-templates select="$test"/> </xsl:when> <xsl:otherwise> <!-- error display --> </xsl:otherwise> </xsl:choose>
best, -Rob
The document() function will return a null node set if the referenced file is not found,
It might do that as an allowed recovery option but the default behaviour is to issue a (possibly fatal) error. Unfortunately there's no way to control that behaviour in XSLT itself.
xalan may have some implementation-specific customisation of this though.
David
_____________________________________________________________________ This message has been checked for all known viruses by Star Internet delivered through the MessageLabs Virus Scanning Service. For further information visit http://www.star.net.uk/stats.asp or alternatively call Star Internet for details on the Virus Scanning Service.
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] mystery #2: testing docum, David Carlisle | Thread | Re: [xsl] mystery #2: testing docum, David Carlisle |
Re: [xsl] mystery #2: testing docum, David Carlisle | Date | Re: [xsl] mystery #2: testing docum, David Carlisle |
Month |