> I am parsing a file using
> .....
> parser->parseFirst(filename,toFill);
> ....
> I am able to parse and retrive data when the file exist.
> In case of nonexistence of the file, no error is reported and whole code is
> ignored.
> .....
> parser->parseFirst(filename,toFill);
> ....
> I am able to parse and retrive data when the file exist.
> In case of nonexistence of the file, no error is reported and whole code is
> ignored.
You must also catch any XMLException, take a look
a this snippet:
try
{
//
bool gotMore = parser->parseFirst(*input,
token);
//
}
catch (const SAXException&
excToCatch)
//
catch (const XMLException&
excToCatch)
//
catch (...)
//
If running this with a non-existing primary
document entity, you will catch an exception of class
XMLException.
excToCatch.getErrorType() ==
XMLErrorReporter::ErrType_Fatal
excToCatch.getMessage() == "The primary document
entity could not be opened. Id=" (followed by your input buffer's
id)
Regards,
Martin
