Hi,
I'm using Xerces C++ to parse some XML files - I use the XercesDOMParser
object and invoke the "parse" method, catching exceptions for various types
of errors. I also have an error handler object installed which reports fatal
and non-fatal errors. The XML file resides on a remote server so the
parameter to the parse method will be a URL.
The problem is that one particular XML file is optional, so my program
should continue if the file is absent, but abort if the file is present but
cannot be parsed. However, I can't see any way to determine from the
exceptions thrown/error handler callbacks if the problem is that the file
does not exist, rather than any other parsing error.
Is there any way to do this - the only other thing I can do is try to GET
the file from the server and parse it locally. If the GET fails, then the
file is not present. However this is extra coding which I would like to
avoid.
Any help appreciated.
Greg O'Rawe