At 15.28 19/03/2007 +0000, Stephen Collyer wrote:
Alberto Massari wrote:
At 20.14 12/03/2007 +0000, Stephen Collyer wrote:
This may be a trivial question but I can't see an obvious answer
so feel free to flame if I'm being idiotic ..
Is there a straightforward way of distinguishing a non-well-formed
XML error from an invalid XML error, when running Xerces in validating
mode ?
Hi Steve,
that isn't a trivial question....
The only way I can see is that you create a new parser class by
deriving either XercesDOMParser or SAXParser, and override the
error( const unsigned int code
, const XMLCh* const errDomain
, const XMLErrorReporter::ErrTypes errType
, const XMLCh* const errorText
, const XMLCh* const systemId
, const XMLCh* const
, const XMLSSize_t lineNum
, const XMLSSize_t colNum)
method. At that point, if errDomain is XMLUni::fgValidityDomain
("http://apache.org/xml/messages/XMLValidity"), it's a validation
error; if it's XMLUni::fgXMLErrDomain
Alberto,
Is there any way to do this by looking at the errType value ?
At the moment, it seems to me that the Perl bindings don't expose
any way to get of the errDomain, but do provide a getType method.
Stephen,
the errType enum is simply Warning/Error/Fatal Error; I don't know if
the Perl binding can access protected methods, or create callback
object, but in case it can you could try registering your own
XMLErrorReporter-derived error handler by calling
parser->getScanner()->setErrorReporter.
Alberto