Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5b56765

Browse files
committed
Added documentation on the ErrorHandler interface.
This closes bug #126034.
1 parent e22e4b2 commit 5b56765

1 file changed

Lines changed: 40 additions & 0 deletions

File tree

Doc/lib/xmlsaxhandler.tex

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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+
4047
In addition to these classes, \module{xml.sax.handler} provides
4148
symbolic 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

Comments
 (0)