<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Class Poco::XML::ErrorHandler</title> <meta http-equiv="content-type" content="text/html; charset=utf-8"/> <meta name="author" content="Applied Informatics Software Engineering GmbH and Contributors"/> <meta name="publisher" content="Applied Informatics Software Engineering GmbH and Contributors"/> <meta name="copyright" content="Copyright (c) 2009, Applied Informatics Software Engineering GmbH and Contributors"/> <meta name="language" content="en"/> <meta name="date" content="2009-11-24"/> <meta name="generator" content="PocoDoc"/> <link rel="stylesheet" href="css/styles.css" type="text/css"/> </head> <body bgcolor="#ffffff" leftmargin="0" topmargin="0"> <div class="header"> <h1 class="namespace"><a href="Poco.XML.html" class="namespace">Poco::XML</a></h1> <h1 class="symbol">class ErrorHandler</h1> </div> <div class="body"> <p> <b>Library:</b> XML<br /> <b>Package:</b> SAX<br /> <b>Header:</b> Poco/SAX/ErrorHandler.h</p> <h2>Description</h2> <div class="description"> <p>If a SAX application needs to implement customized error handling, it must implement this interface and then register an instance with the <a href="Poco.XML.html" title="namespace Poco::XML">XML</a> reader using the setErrorHandler method. The parser will then report all errors and warnings through this interface. </p> <p>WARNING: If an application does not register an <a href="Poco.XML.ErrorHandler.html" title="class Poco::XML::ErrorHandler">ErrorHandler</a>, <a href="Poco.XML.html" title="namespace Poco::XML">XML</a> parsing errors will go unreported, except that SAXParseExceptions will be thrown for fatal errors. In order to detect validity errors, an <a href="Poco.XML.ErrorHandler.html" title="class Poco::XML::ErrorHandler">ErrorHandler</a> that does something with <a href="Poco.XML.ErrorHandler.html#18993" title="Poco::XML::ErrorHandler::error()">error</a>() calls must be registered. </p> <p>For <a href="Poco.XML.html" title="namespace Poco::XML">XML</a> processing errors, a SAX driver must use this interface in preference to 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 parser continue to report additional errors after a call to fatalError. In other words, a SAX driver class may throw an exception after reporting any fatalError. Also parsers may throw appropriate exceptions for non-<a href="Poco.XML.html" title="namespace Poco::XML">XML</a> errors. For example, <a href="Poco.XML.XMLReader.html#19460" title="Poco::XML::XMLReader::parse()">XMLReader::parse</a>() would throw an <a href="Poco.IOException.html" title="class Poco::IOException">IOException</a> for errors accessing entities or the document. </p> </div> <h2>Inheritance</h2> <p><b>Known Derived Classes: </b><a href="Poco.XML.DefaultHandler.html" title="class Poco::XML::DefaultHandler">DefaultHandler</a>, <a href="Poco.XML.XMLFilterImpl.html" title="class Poco::XML::XMLFilterImpl">XMLFilterImpl</a>, <a href="Poco.XML.WhitespaceFilter.html" title="class Poco::XML::WhitespaceFilter">WhitespaceFilter</a></p> <h2>Member Summary</h2> <p><b>Member Functions: </b><a href="Poco.XML.ErrorHandler.html#18993" title="Poco::XML::ErrorHandler::error()">error</a>, <a href="Poco.XML.ErrorHandler.html#18995" title="Poco::XML::ErrorHandler::fatalError()">fatalError</a>, <a href="Poco.XML.ErrorHandler.html#18991" title="Poco::XML::ErrorHandler::warning()">warning</a></p> <h2>Destructor</h2> <h3><a name="18997">~ErrorHandler</a> <img src="images/protected.gif" alt="protected" title="protected" style="vertical-align:baseline;" border="0" /> <img src="images/virtual.gif" alt="virtual" title="virtual" style="vertical-align:baseline;" border="0" /> </h3> <p class="decl">virtual ~<a href="Poco.XML.ErrorHandler.html" title="class Poco::XML::ErrorHandler">ErrorHandler</a>();</p> <div class="description"> <p></p> </div> <h2>Member Functions</h2> <h3><a name="18993">error</a> <img src="images/virtual.gif" alt="virtual" title="virtual" style="vertical-align:baseline;" border="0" /> </h3> <p class="decl">virtual void error(<br /> const <a href="Poco.XML.SAXException.html" title="class Poco::XML::SAXException">SAXException</a> & exc<br />) = 0;</p> <div class="description"> <p>Receive notification of a recoverable error. </p> <p>This corresponds to the definition of "error" in section 1.2 of the W3C <a href="Poco.XML.html" title="namespace Poco::XML">XML</a> 1.0 Recommendation. For example, a validating parser would use this callback to report the violation of a validity constraint. The default behaviour is to take no action. </p> <p>The SAX parser must continue to provide normal parsing 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 parser should report a fatal error even if the <a href="Poco.XML.html" title="namespace Poco::XML">XML</a> recommendation does not require it to do so. </p> <p>Filters may use this method to report other, non-<a href="Poco.XML.html" title="namespace Poco::XML">XML</a> errors as well. </p> </div> <h3><a name="18995">fatalError</a> <img src="images/virtual.gif" alt="virtual" title="virtual" style="vertical-align:baseline;" border="0" /> </h3> <p class="decl">virtual void fatalError(<br /> const <a href="Poco.XML.SAXException.html" title="class Poco::XML::SAXException">SAXException</a> & exc<br />) = 0;</p> <div class="description"> <p>Receive notification of a non-recoverable error. The application must assume that the document is unusable after the parser has invoked this method, and should continue (if at all) only for the sake of collecting additional error messages: in fact, SAX parsers are free to stop reporting any other events once this method has been invoked. </p> </div> <h3><a name="18991">warning</a> <img src="images/virtual.gif" alt="virtual" title="virtual" style="vertical-align:baseline;" border="0" /> </h3> <p class="decl">virtual void warning(<br /> const <a href="Poco.XML.SAXException.html" title="class Poco::XML::SAXException">SAXException</a> & exc<br />) = 0;</p> <div class="description"> <p>Receive notification of a warning. </p> <p>SAX parsers will use this method to report conditions that are not errors or fatal errors as defined by the <a href="Poco.XML.html" title="namespace Poco::XML">XML</a> recommendation. The default behaviour is to take no action. </p> <p>The SAX parser must continue to provide normal parsing events after invoking this method: it should still be possible for the application to process the document through to the end. </p> <p>Filters may use this method to report other, non-<a href="Poco.XML.html" title="namespace Poco::XML">XML</a> warnings as well. </p> </div> <p class="footer">POCO C++ Libraries 1.3.6-all<br /> Copyright © 2009, <a href="http://pocoproject.org/" target="_blank">Applied Informatics Software Engineering GmbH and Contributors</a></p> </div> </body> </html>