xerces-c uses exceptions like many others.
If you want to have a robust xml parser, make heavy use of catching thrown exceptions. Many exception classes have additional information, so you can use them to make a really robust and "tolerant" xml parser.
SAX is also a good starting point.
Example DOM parser in xerces-c (my favorite parser):
XercesDOMParser* parser = new XercesDOMParser();
parser->setValidationScheme(XercesDOMParser::Val_Always);
parser->setDoNamespaces(true);
ErrorHandler* errHandler = (ErrorHandler*) new HandlerBase();
parser->setErrorHandler(errHandler);
char* xmlFile = "test.xml";
try
{
parser->parse(xmlFile);
}
catch (const XMLException& toCatch)
{
/*ERROR HANDLER*/
}
catch (const DOMException& toCatch)
{
/*ERROR HANDLER*/
}
catch (...)
{
/*ERROR HANDLER*/
}
delete parser;
delete errHandler;
Additionally, you can also create your own DOMErrorHandler to make "corrections" on the fly. See the xerces-c programming guide for more information.