Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

qgxml::ContentHandler Class Reference
[XML SAX Module]

#include <qgarlib/sax/ContentHandler.H>

Inheritance diagram for qgxml::ContentHandler:

qgxml::DefaultHandler qgar::QgarAppDescr List of all members.

Detailed Description

Receive notification of the logical content of a document.

This is the main interface that most SAX applications implement: if the application needs to be informed of basic parsing events, it implements this interface and registers an instance with the SAX parser using the setContentHandler method. The parser uses the instance to report basic document-related events like the start and end of elements and character data.

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/or subelements) will appear, in order, between the startElement event and the corresponding endElement event.

This class is an adaptation for C++ of the interface of the same name implemented in the Java SAX API (http://www.saxproject.org).

Author:
Jan Rendek (Adaptation).
Date:
March 3, 2003 16:45
Since:
Qgar 2.1.1

Definition at line 80 of file ContentHandler.H.

Public Member Functions

virtual void characters (const char *ch, const unsigned int start, const unsigned int length)=0
 Receive notification of character data.
virtual void endDocument ()=0
 Receive notification of the end of a document.
virtual void endElement (const std::string &uri, const std::string &localName, const std::string &qName)=0
 Receive notification of the end of an element.
virtual void endPrefixMapping (const std::string &prefix)=0
 End the scope of a prefix-URI mapping.
virtual void ignorableWhitespace (const char *ch, const unsigned int start, const unsigned int length)=0
 Receive notification of ignorable whitespace in element content.
virtual void processingInstruction (const std::string &target, const std::string &data)=0
 Receive notification of a processing instruction.
virtual void setDocumentLocator (Locator *locator)=0
 Receive an object for locating the origin of SAX document events.
virtual void skippedEntity (const std::string &name)=0
 Receive notification of a skipped entity.
virtual void startDocument ()=0
 Receive notification of the beginning of a document.
virtual void startElement (const std::string &uri, const std::string &localName, const std::string &qName, const Attributes &atts)=0
 Receive notification of the beginning of an element.
virtual void startPrefixMapping (const std::string &prefix, const std::string &uri)=0
 Begin the scope of a prefix-URI Namespace mapping.
Destructor
virtual ~ContentHandler ()
 Destructor.


Constructor & Destructor Documentation

virtual qgxml::ContentHandler::~ContentHandler  )  [inline, virtual]
 

Destructor.

Definition at line 95 of file ContentHandler.H.


Member Function Documentation

virtual void qgxml::ContentHandler::characters const char *  ch,
const unsigned int  start,
const unsigned int  length
[pure virtual]
 

Receive notification of character data.

Parameters:
ch The characters from the XML document.
start The start position in the array.
length The number of characters to read from the array.

Implemented in qgar::QgarAppDescr, and qgxml::DefaultHandler.

Referenced by qgxml::XercesQgarContentHandlerAdaptor::characters(), and qgxml::QtQgarContentHandlerAdaptor::characters().

virtual void qgxml::ContentHandler::endDocument  )  [pure virtual]
 

Receive notification of the end of a document.

The SAX parser will invoke this method only once, and it will be the last method invoked during the parse. The parser shall not invoke this method until it has either abandoned parsing (because of an unrecoverable error) or reached the end of input.

See also:
startDocument()

Implemented in qgxml::DefaultHandler.

Referenced by qgxml::XercesQgarContentHandlerAdaptor::endDocument(), and qgxml::QtQgarContentHandlerAdaptor::endDocument().

virtual void qgxml::ContentHandler::endElement const std::string &  uri,
const std::string &  localName,
const std::string &  qName
[pure virtual]
 

Receive notification of the end of an element.

The SAX parser will invoke this method at the end of every element in the XML document; there will be a corresponding startElement event for every endElement event (even when the element is empty).

Parameters:
uri The Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed.
localName The local name (without prefix), or the empty string if Namespace processing is not being performed.
qName The qualified XML 1.0 name (with prefix), or the empty string if qualified names are not available.
See also:
startElement()

Implemented in qgar::QgarAppDescr, and qgxml::DefaultHandler.

Referenced by qgxml::XercesQgarContentHandlerAdaptor::endElement(), and qgxml::QtQgarContentHandlerAdaptor::endElement().

virtual void qgxml::ContentHandler::endPrefixMapping const std::string &  prefix  )  [pure virtual]
 

End the scope of a prefix-URI mapping.

Parameters:
prefix The prefix that was being mapped. This is the empty string when a default mapping scope ends.
See also:
startPrefixMapping

Implemented in qgxml::DefaultHandler.

Referenced by qgxml::XercesQgarContentHandlerAdaptor::endPrefixMapping(), and qgxml::QtQgarContentHandlerAdaptor::endPrefixMapping().

virtual void qgxml::ContentHandler::ignorableWhitespace const char *  ch,
const unsigned int  start,
const unsigned int  length
[pure virtual]
 

Receive notification of ignorable whitespace in element content.

Parameters:
ch The characters from the XML document.
start The start position in the array.
length The number of characters to read from the array.

Implemented in qgxml::DefaultHandler.

Referenced by qgxml::XercesQgarContentHandlerAdaptor::ignorableWhitespace(), and qgxml::QtQgarContentHandlerAdaptor::ignorableWhitespace().

virtual void qgxml::ContentHandler::processingInstruction const std::string &  target,
const std::string &  data
[pure virtual]
 

Receive notification of a processing instruction.

Parameters:
target The processing instruction target.
data The processing instruction data. The data does not include any whitespace separating it from the target.

Implemented in qgxml::DefaultHandler.

Referenced by qgxml::XercesQgarContentHandlerAdaptor::processingInstruction(), and qgxml::QtQgarContentHandlerAdaptor::processingInstruction().

virtual void qgxml::ContentHandler::setDocumentLocator Locator locator  )  [pure virtual]
 

Receive an object for locating the origin of SAX document events.

Parameters:
locator An object that can return the location of any SAX document event.

Implemented in qgxml::DefaultHandler.

Referenced by qgxml::XercesQgarContentHandlerAdaptor::setDocumentLocator(), and qgxml::QtQgarContentHandlerAdaptor::setDocumentLocator().

virtual void qgxml::ContentHandler::skippedEntity const std::string &  name  )  [pure virtual]
 

Receive notification of a skipped entity.

Parameters:
name The name of the skipped entity.

Implemented in qgxml::DefaultHandler.

Referenced by qgxml::XercesQgarContentHandlerAdaptor::skippedEntity(), and qgxml::QtQgarContentHandlerAdaptor::skippedEntity().

virtual void qgxml::ContentHandler::startDocument  )  [pure virtual]
 

Receive notification of the beginning of a document.

The SAX parser will invoke this method only once, before any other event callbacks (except for setDocumentLocator()).

See also:
endDocument()

Implemented in qgxml::DefaultHandler.

Referenced by qgxml::XercesQgarContentHandlerAdaptor::startDocument(), and qgxml::QtQgarContentHandlerAdaptor::startDocument().

virtual void qgxml::ContentHandler::startElement const std::string &  uri,
const std::string &  localName,
const std::string &  qName,
const Attributes atts
[pure virtual]
 

Receive notification of the beginning of an element.

The Parser will invoke this method at the beginning of every element in the XML document; there will be a corresponding endElement event for every startElement event (even when the element is empty). All of the element's content will be reported, in order, before the corresponding endElement event.

Parameters:
uri The Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed.
localName The local name (without prefix), or the empty string if Namespace processing is not being performed.
qName The qualified name (with prefix), or the empty string if qualified names are not available.
atts The attributes attached to the element.
See also:
endElement()

Implemented in qgar::QgarAppDescr, and qgxml::DefaultHandler.

Referenced by qgxml::XercesQgarContentHandlerAdaptor::startElement(), and qgxml::QtQgarContentHandlerAdaptor::startElement().

virtual void qgxml::ContentHandler::startPrefixMapping const std::string &  prefix,
const std::string &  uri
[pure virtual]
 

Begin the scope of a prefix-URI Namespace mapping.

Parameters:
prefix The Namespace prefix being declared. An empty string is used for the default element namespace, which has no prefix.
uri The Namespace URI the prefix is mapped to.
See also:
endPrefixMapping()

Implemented in qgxml::DefaultHandler.

Referenced by qgxml::XercesQgarContentHandlerAdaptor::startPrefixMapping(), and qgxml::QtQgarContentHandlerAdaptor::startPrefixMapping().


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