|  | Home · Overviews · Examples

# QXmlContentHandlerInterface Class Reference
[com.trolltech.qt.xml module]

The `QXmlContentHandler` class provides an interface to report the logical content of XML data. More...

Inherited by `QXmlContentHandler`.

## Detailed Description

The `QXmlContentHandler` class provides an interface to report the logical content of XML data.

If the application needs to be informed of basic parsing events, it can implement this interface and activate it using QXmlReader::setContentHandler(). The reader can then report basic document-related events like the start and end of elements and character data through this interface.

The order of events in this interface is very important, and mirrors the order of information in the document itself. For example, all of an element's content (character data, processing instructions, and sub-elements) appears, in order, between the `startElement` event and the corresponding `endElement` event.

The class `QXmlDefaultHandler` provides a default implementation for this interface; subclassing from the `QXmlDefaultHandler` class is very convenient if you only want to be informed of some parsing events.

The `startDocument` function is called at the start of the document, and `endDocument` is called at the end. Before parsing begins `setDocumentLocator` is called. For each element `startElement` is called, with `endElement` being called at the end of each element. The `characters` function is called with chunks of character data; `ignorableWhitespace` is called with chunks of whitespace and `processingInstruction` is called with processing instructions. If an entity is skipped `skippedEntity` is called. At the beginning of prefix-URI scopes `startPrefixMapping` is called.

See also `QXmlDTDHandler`, `QXmlDeclHandler`, `QXmlEntityResolver`, `QXmlErrorHandler`, `QXmlLexicalHandler`, and Introduction to SAX2.