diff options
author | Fred Drake <fdrake@acm.org> | 2000-12-19 04:07:54 (GMT) |
---|---|---|
committer | Fred Drake <fdrake@acm.org> | 2000-12-19 04:07:54 (GMT) |
commit | 5b56765fe78a38584f15e27dc50a08e3b0c4e342 (patch) | |
tree | 95d5f44da74f411f4e3a53377438f1dbf085cf50 /Doc/lib/xmlsaxhandler.tex | |
parent | e22e4b2b59836339c3f1d22216d04911bc1ad2f8 (diff) | |
download | cpython-5b56765fe78a38584f15e27dc50a08e3b0c4e342.zip cpython-5b56765fe78a38584f15e27dc50a08e3b0c4e342.tar.gz cpython-5b56765fe78a38584f15e27dc50a08e3b0c4e342.tar.bz2 |
Added documentation on the ErrorHandler interface.
This closes bug #126034.
Diffstat (limited to 'Doc/lib/xmlsaxhandler.tex')
-rw-r--r-- | Doc/lib/xmlsaxhandler.tex | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/Doc/lib/xmlsaxhandler.tex b/Doc/lib/xmlsaxhandler.tex index 6796286..8d9c519 100644 --- a/Doc/lib/xmlsaxhandler.tex +++ b/Doc/lib/xmlsaxhandler.tex @@ -37,6 +37,13 @@ methods get default implementations. external entities. \end{classdesc} +\begin{classdesc}{ErrorHandler}{} + Interface used by the parser to present error and warning messages + to the application. The methods of this object control whether errors + are immediately converted to exceptions or are handled in some other + way. +\end{classdesc} + In addition to these classes, \module{xml.sax.handler} provides symbolic constants for the feature and property names. @@ -327,3 +334,36 @@ appropriate events in the input document: system identifier to read from as a string, or an InputSource to read from. The default implementation returns \var{systemId}. \end{methoddesc} + + +\subsection{ErrorHandler Objects \label{sax-error-handler}} + +Objects with this interface are used to receive error and warning +information from the \class{XMLReader}. If you create an object that +implements this interface, then register the object with your +\class{XMLReader}, the parser will call the methods in your object to +report all warnings and errors. There are three levels of errors +available: warnings, (possibly) recoverable errors, and unrecoverable +errors. All methods take a \exception{SAXParseException} as the only +parameter. Errors and warnings may be converted to an exception by +raising the passed-in exception object. + +\begin{methoddesc}[ErrorHandler]{error}{exception} + Called when the parser encounters a recoverable error. If this method + does not raise an exception, parsing may continue, but further document + information should not be expected by the application. Allowing the + parser to continue may allow additional errors to be discovered in the + input document. +\end{methoddesc} + +\begin{methoddesc}[ErrorHandler]{fatalError}{exception} + Called when the parser encounters an error it cannot recover from; + parsing is expected to terminate when this method returns. +\end{methoddesc} + +\begin{methoddesc}[ErrorHandler]{warning}{exception} + Called when the parser presents minor warning information to the + application. Parsing is expected to continue when this method returns, + and document information will continue to be passed to the application. + Raising an exception in this method will cause parsing to end. +\end{methoddesc} |