XMLErrorReporter class Reference

| API Docs for SAX and DOM |

Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members File Members

# XMLErrorReporter Class Reference

This abstract class defines a callback mechanism for the scanner. More...

Inheritance diagram for XMLErrorReporter:

[legend]
List of all members.

## Public Types

enum | ErrTypes { ErrType_Warning, ErrType_Error, ErrType_Fatal, ErrTypes_Unknown }

## Public Methods

Destructor
virtual | ~XMLErrorReporter ()
| Default destructor.
Error Handler interface
virtual void | error (const unsigned int errCode, const XMLCh *const errDomain, const ErrTypes type, const XMLCh *const errorText, const XMLCh *const systemId, const XMLCh *const publicId, const XMLSSize_t lineNum, const XMLSSize_t colNum)=0
| Called to report errors from the scanner or validator.
virtual void | resetErrors ()=0
| Called before a new parse event to allow the handler to reset.

## Protected Methods

Constructor
| XMLErrorReporter ()
| Default constructor.

## Detailed Description

This abstract class defines a callback mechanism for the scanner.

By creating a class that implements this interface and plugging an instance of that class into the scanner, the scanner will call back on the object's virtual methods to report error events. This class is also used with the validator, to allow it to report errors.

This class is primarily for use by those writing their own parser classes. If you use the standard parser classes, DOMParser and SAXParser, you won't use this API. You will instead use a similar mechanism defined by the SAX API, called ErrorHandler.

## Member Enumeration Documentation

enum XMLErrorReporter::ErrTypes

Enumeration values:

  ErrType_Warning |
  ErrType_Error |
  ErrType_Fatal |
  ErrTypes_Unknown |

## Constructor & Destructor Documentation

virtual XMLErrorReporter::~XMLErrorReporter | ( |  | ) | `[virtual]`

| Default destructor.

XMLErrorReporter::XMLErrorReporter | ( |  | ) | `[protected]`

| Default constructor.

## Member Function Documentation

virtual void XMLErrorReporter::error | ( | const unsigned int | errCode,
|  | const XMLCh *const | errDomain,
|  | const ErrTypes | type,
|  | const XMLCh *const | errorText,
|  | const XMLCh *const | systemId,
|  | const XMLCh *const | publicId,
|  | const XMLSSize_t | lineNum,
|  | const XMLSSize_t | colNum
| ) | `[pure virtual]`

Called to report errors from the scanner or validator.

This method is called back on by the scanner or validator (or any other internal parser component which might need to report an error in the future.) It contains all the information that the client code might need to report or log the error.

Parameters:

  errCode | The error code of the error being reported. What this means is dependent on the domain it is from.
  errDomain | The domain from which the error occured. The domain is a means of providing a hierarchical layering to the error system, so that a single set of error id numbers don't have to be split up.
  type | The error type, which is defined mostly by XML which categorizes errors into warning, errors and validity constraints.
  errorText | The actual text of the error. This is translatable, so can possibly be in the local language if a translation has been provided.
  systemId | The system id of the entity where the error occured, fully qualified.
  publicId | The optional public id of the entity were the error occured. It can be an empty string if non was provided.
  lineNum | The line number within the source XML of the error.
  colNum | The column number within the source XML of the error. Because of the parsing style, this is usually just after the actual offending text.

virtual void XMLErrorReporter::resetErrors | ( |  | ) | `[pure virtual]`

| Called before a new parse event to allow the handler to reset. This method is called by the scanner before a new parse event is about to start. It gives the error handler a chance to reset its internal state. Implemented in SAXParser, and XercesDOMParser.

The documentation for this class was generated from the following file:

- XMLErrorReporter.hpp

Copyright © 2000 The Apache Software Foundation. All Rights Reserved.