DeclHandler Class Referenceabstract

Receive notification of DTD declaration events. More...

`#include <xercesc/sax2/DeclHandler.hpp>`

Inheritance diagram for DeclHandler:

## Public Member Functions

Constructors and Destructor
| DeclHandler ()
| Default constructor.
virtual | ~DeclHandler ()
| Destructor.

## The virtual declaration handler interface

virtual void | elementDecl (const XMLCh *const name, const XMLCh *const model)=0
| Report an element type declaration.
virtual void | attributeDecl (const XMLCh *const eName, const XMLCh *const aName, const XMLCh *const type, const XMLCh *const mode, const XMLCh *const value)=0
| Report an attribute type declaration.
virtual void | internalEntityDecl (const XMLCh *const name, const XMLCh *const value)=0
| Report an internal entity declaration.
virtual void | externalEntityDecl (const XMLCh *const name, const XMLCh *const publicId, const XMLCh *const systemId)=0
| Report a parsed external entity declaration.

## Detailed Description

Receive notification of DTD declaration events.

This is an optional extension handler for SAX2 to provide more complete information about DTD declarations in an XML document. XML readers are not required to recognize this handler, and it is not part of core-only SAX2 distributions.

Note that data-related DTD declarations (unparsed entities and notations) are already reported through the DTDHandler interface.

If you are using the declaration handler together with a lexical handler, all of the events will occur between the startDTD and the endDTD events.

See also
  SAX2XMLReader::setLexicalHandler
  SAX2XMLReader::setDeclarationHandler

## Constructor & Destructor Documentation

## DeclHandler()

DeclHandler::DeclHandler | ( |  | ) |

Default constructor.

## ~DeclHandler()

virtual DeclHandler::~DeclHandler | ( |  | ) |

virtual

Destructor.

## Member Function Documentation

## attributeDecl()

virtual void DeclHandler::attributeDecl | ( | const XMLCh *const | eName,
|  | const XMLCh *const | aName,
|  | const XMLCh *const | type,
|  | const XMLCh *const | mode,
|  | const XMLCh *const | value
| ) |  |

pure virtual

Report an attribute type declaration.

The Parser will call this method to report each occurrence of a comment in the XML document.

The application must not attempt to read from the array outside of the specified range.

Parameters

  eName | The name of the associated element.
  aName | The name of the attribute.
  type | A string representing the attribute type.
  mode | A string representing the attribute defaulting mode ("#IMPLIED", "#REQUIRED", or "#FIXED") or null if none of these applies.
  value | A string representing the attribute's default value, or null if there is none.

Exceptions

  SAXException | Any SAX exception, possibly wrapping another exception.

Implemented in DefaultHandler.

## elementDecl()

virtual void DeclHandler::elementDecl | ( | const XMLCh *const | name,
|  | const XMLCh *const | model
| ) |  |

pure virtual

Report an element type declaration.

The content model will consist of the string "EMPTY", the string "ANY", or a parenthesised group, optionally followed by an occurrence indicator. The model will be normalized so that all parameter entities are fully resolved and all whitespace is removed,and will include the enclosing parentheses. Other normalization (such as removing redundant parentheses or simplifying occurrence indicators) is at the discretion of the parser.

Parameters

  name | The element type name.
  model | The content model as a normalized string.

Exceptions

  SAXException | Any SAX exception, possibly wrapping another exception.

Implemented in DefaultHandler.

## externalEntityDecl()

virtual void DeclHandler::externalEntityDecl | ( | const XMLCh *const | name,
|  | const XMLCh *const | publicId,
|  | const XMLCh *const | systemId
| ) |  |

pure virtual

Report a parsed external entity declaration.

Only the effective (first) declaration for each entity will be reported.

Parameters

  name | The name of the entity. If it is a parameter entity, the name will begin with ''.
  publicId | The The declared public identifier of the entity, or null if none was declared.
  systemId | The declared system identifier of the entity.

Exceptions

  SAXException | Any SAX exception, possibly wrapping another exception.

Implemented in DefaultHandler.

## internalEntityDecl()

virtual void DeclHandler::internalEntityDecl | ( | const XMLCh *const | name,
|  | const XMLCh *const | value
| ) |  |

pure virtual

Report an internal entity declaration.

Only the effective (first) declaration for each entity will be reported. All parameter entities in the value will be expanded, but general entities will not.

Parameters

  name | The name of the entity. If it is a parameter entity, the name will begin with ''.
  value | The replacement text of the entity.

Exceptions

  SAXException | Any SAX exception, possibly wrapping another exception.

Implemented in DefaultHandler.

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

- DeclHandler.hpp