This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Fallback from document() error
It is not.
I can have:
document('foo.xml')//aaa
with foo.xml:
<bbb/>
this bit will return empty node-set but I cannot
find out that the document exists.
so
1) I must have according to the current spec:
a processor which returns empty set not an error if encounters
non-existing file (e.g. Saxon stops processing when the file does not
exist and it is right to do it according to the spec)
2) then I must test: document('foo.xml') and if this does not return
empty-nodeset then
3) I may use document('foo.xml')//aaa
In 1.1 I will not have problems with restrictions
on result tree fragment use, so I can reuse the part from case 2)
and it will not be necessary to repeat the document() part
but still I would love to have a possibility to distinguish
empty node-set because of non-existing file from empty node-set from
non-existing element in one step
David Carlisle wrote:
>
> While a general exception handling mechanism would be interesting, is it
> clear why this particular case is an error at all what would be lost in
> mandating that document() returns an empty node set if it can't retrieve
> an XML file. This could be tested using standard boolean tests without
> need of error handler at all. Since this behaviour is already allowed by
> the spec it wouldn't be much of a change.
>
> David
>
> _____________________________________________________________________
> This message has been checked for all known viruses by Star Internet delivered
> through the MessageLabs Virus Control Centre. For further information visit
> http://www.star.net.uk/stats.asp
>
> XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
--
******************************************
<firstName> Miloslav </firstName>
<surname> Nic </surname>
<mail> nicmila@idoox.com </mail>
<support> http://www.zvon.org </support>
<zvonMailingList>
http://www.zvon.org/index.php?nav_id=4
</zvonMailingList>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list