@@ -37,6 +37,13 @@ \section{\module{xml.sax.handler} ---
3737 external entities.
3838\end {classdesc }
3939
40+ \begin {classdesc }{ErrorHandler}{}
41+ Interface used by the parser to present error and warning messages
42+ to the application. The methods of this object control whether errors
43+ are immediately converted to exceptions or are handled in some other
44+ way.
45+ \end {classdesc }
46+
4047In addition to these classes, \module {xml.sax.handler} provides
4148symbolic constants for the feature and property names.
4249
@@ -327,3 +334,36 @@ \subsection{EntityResolver Objects \label{entity-resolver-objects}}
327334 system identifier to read from as a string, or an InputSource to
328335 read from. The default implementation returns \var {systemId}.
329336\end {methoddesc }
337+
338+
339+ \subsection {ErrorHandler Objects \label {sax-error-handler } }
340+
341+ Objects with this interface are used to receive error and warning
342+ information from the \class {XMLReader}. If you create an object that
343+ implements this interface, then register the object with your
344+ \class {XMLReader}, the parser will call the methods in your object to
345+ report all warnings and errors. There are three levels of errors
346+ available: warnings, (possibly) recoverable errors, and unrecoverable
347+ errors. All methods take a \exception {SAXParseException} as the only
348+ parameter. Errors and warnings may be converted to an exception by
349+ raising the passed-in exception object.
350+
351+ \begin {methoddesc }[ErrorHandler]{error}{exception}
352+ Called when the parser encounters a recoverable error. If this method
353+ does not raise an exception, parsing may continue, but further document
354+ information should not be expected by the application. Allowing the
355+ parser to continue may allow additional errors to be discovered in the
356+ input document.
357+ \end {methoddesc }
358+
359+ \begin {methoddesc }[ErrorHandler]{fatalError}{exception}
360+ Called when the parser encounters an error it cannot recover from;
361+ parsing is expected to terminate when this method returns.
362+ \end {methoddesc }
363+
364+ \begin {methoddesc }[ErrorHandler]{warning}{exception}
365+ Called when the parser presents minor warning information to the
366+ application. Parsing is expected to continue when this method returns,
367+ and document information will continue to be passed to the application.
368+ Raising an exception in this method will cause parsing to end.
369+ \end {methoddesc }
0 commit comments