handle error in XQuery

Hi, I am new to XQuery. I wonder how to handle error in XQuery and the syntax. Basically, I want to load a xml file from disk, if the file doesn’t exist, do sth. else. The fn:doc function raises err:FODC0005, invalid argument to fn:doc. But how to catch that? Thanks.


Which XQuery processor are you using?

Best regards,

Thorsten Fiebig