|
Unicorn XML Toolkit Version 1.50.00 |
|||||||||
� PREV CLASS �� NEXT CLASS | FRAMES��NO FRAMES | |||||||||
SUMMARY: � CONSTR �|� FUNCTION �|�DATA | DETAIL: � CONSTR �|� FUNCTION �|�DATA |
class CErrorHandler: virtual public CInterface { public: CErrorHandler(); virtual ~CErrorHandler(); public: virtual void Warning(CSaxParseException *pException) = 0; virtual void Error(CSaxParseException *pException) = 0; virtual void FatalError(CSaxParseException *pException) = 0; }; typedef XInterface<CErrorHandler> XErrorHandler;
The basic interface for SAX error handlers.
If a SAX application needs to implement customized error
handling, it must implement this interface and then register an
instance with the XML reader using the
CXmlReader::SetErrorHandler
method. The reader will then report all errors and warnings
through this interface.
WARNING: If an application does not register an error handler, XML parsing errors will go unreported and bizarre behaviour may result.
For XML processing errors, a SAX reader must use this interface
instead of throwing an exception: it is up to the application
to decide whether to throw an exception for different types of
errors and warnings. Note, however, that there is no requirement that
the reader continue to provide useful information after a call to
FatalError
(in other words, a SAX reader class
could catch an exception and report a fatal error).
CSaxParseException
Constructor/Destructor Summary | |
CErrorHandler
();
����������Constructs the error handler. |
|
~CErrorHandler
();
����������Destroys the error handler. |
Function Summary | |
void
|
Warning
(CSaxParseException *pException);
����������Receives notification of a warning. |
void
|
Error
(CSaxParseException *pException);
����������Receives notification of a recoverable error. |
void
|
FatalError
(CSaxParseException *pException);
����������Receives notification of a non-recoverable error. |
Constructor/Destructor Detail |
CErrorHandler();
Constructs the error handler.
virtual ~CErrorHandler();
Destroys the error handler.
Function Detail |
virtual void Warning(CSaxParseException *pException) = 0;
Receives notification of a warning.
SAX readers will use this method to report conditions that are not errors or fatal errors as defined by the XML 1.0 recommendation. The default behaviour is to take no action.
The SAX reader must continue to provide normal events after invoking this method: it should still be possible for the application to process the document through to the end.
Filters may use this method to report other, non-XML warnings as well.
pException
- the SAX parse exception
containing the warning informationvirtual void Error(CSaxParseException *pException) = 0;
Receives notification of a recoverable error.
This corresponds to the definition of "error" in section 1.2 of the W3C XML 1.0 Recommendation. For example, a reader implementing a validating parser would use this callback to report the violation of a validity constraint. The default behaviour is to take no action.
The SAX reader must continue to provide normal events after invoking this method: it should still be possible for the application to process the document through to the end. If the application cannot do so, then the reader should report a fatal error even if the XML 1.0 recommendation does not require it to do so.
Filters may use this method to report other, non-XML errors as well.
pException
- the SAX parse exception
containing the error informationvirtual void FatalError(CSaxParseException *pException) = 0;
Receives notification of a non-recoverable error.
This corresponds to the definition of "fatal error" in section 1.2 of the W3C XML 1.0 Recommendation. For example, a reader would use this callback to report the violation of a well-formedness constraint.
The application must assume that the document is unusable after the reader has invoked this method, and should continue (if at all) only for the sake of collecting addition error messages: in fact, SAX readers are free to stop reporting any other events once this method has been invoked.
pException
- the SAX parse exception
containing the error information
|
Unicorn XML Toolkit Version 1.50.00 |
|||||||||
� PREV CLASS �� NEXT CLASS | FRAMES��NO FRAMES | |||||||||
SUMMARY: � CONSTR �|� FUNCTION �|�DATA | DETAIL: � CONSTR �|� FUNCTION �|�DATA |