This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: mystery #2: testing document() without failure
Hi,
So is it wrong to rely on something like (if processor independence is
important):
<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>
it works in saxon.
best,
-Rob
David Carlisle wrote:
>>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
>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list