Xerces-C++
3.1.2
|
Default base class for SAX2 handlers. More...
Public Member Functions | |
DefaultHandler () | |
virtual | ~DefaultHandler () |
Default handlers for the DocumentHandler interface | |
virtual void | characters (const XMLCh *const chars, const XMLSize_t length) |
Receive notification of character data inside an element. More... | |
virtual void | endDocument () |
Receive notification of the end of the document. More... | |
virtual void | endElement (const XMLCh *const uri, const XMLCh *const localname, const XMLCh *const qname) |
Receive notification of the end of an element. More... | |
virtual void | ignorableWhitespace (const XMLCh *const chars, const XMLSize_t length) |
Receive notification of ignorable whitespace in element content. More... | |
virtual void | processingInstruction (const XMLCh *const target, const XMLCh *const data) |
Receive notification of a processing instruction. More... | |
virtual void | resetDocument () |
Reset the Document object on its reuse. More... | |
Default implementation of DocumentHandler interface | |
virtual void | setDocumentLocator (const Locator *const locator) |
Receive a Locator object for document events. More... | |
virtual void | startDocument () |
Receive notification of the beginning of the document. More... | |
virtual void | startElement (const XMLCh *const uri, const XMLCh *const localname, const XMLCh *const qname, const Attributes &attrs) |
Receive notification of the start of an element. More... | |
virtual void | startPrefixMapping (const XMLCh *const prefix, const XMLCh *const uri) |
Receive notification of the start of an namespace prefix mapping. More... | |
virtual void | endPrefixMapping (const XMLCh *const prefix) |
Receive notification of the end of an namespace prefix mapping. More... | |
virtual void | skippedEntity (const XMLCh *const name) |
Receive notification of a skipped entity. More... | |
Default implementation of the EntityResolver interface. | |
virtual InputSource * | resolveEntity (const XMLCh *const publicId, const XMLCh *const systemId) |
Resolve an external entity. More... | |
Default implementation of the ErrorHandler interface | |
virtual void | error (const SAXParseException &exc) |
Receive notification of a recoverable parser error. More... | |
virtual void | fatalError (const SAXParseException &exc) |
Report a fatal XML parsing error. More... | |
virtual void | warning (const SAXParseException &exc) |
Receive notification of a parser warning. More... | |
virtual void | resetErrors () |
Reset the Error handler object on its reuse. More... | |
Default implementation of DTDHandler interface. | |
virtual void | notationDecl (const XMLCh *const name, const XMLCh *const publicId, const XMLCh *const systemId) |
Receive notification of a notation declaration. More... | |
virtual void | resetDocType () |
Reset the DTD object on its reuse. More... | |
virtual void | unparsedEntityDecl (const XMLCh *const name, const XMLCh *const publicId, const XMLCh *const systemId, const XMLCh *const notationName) |
Receive notification of an unparsed entity declaration. More... | |
Default implementation of LexicalHandler interface. | |
virtual void | comment (const XMLCh *const chars, const XMLSize_t length) |
Receive notification of comments. More... | |
virtual void | endCDATA () |
Receive notification of the end of a CDATA section. More... | |
virtual void | endDTD () |
Receive notification of the end of the DTD declarations. More... | |
virtual void | endEntity (const XMLCh *const name) |
Receive notification of the end of an entity. More... | |
virtual void | startCDATA () |
Receive notification of the start of a CDATA section. More... | |
virtual void | startDTD (const XMLCh *const name, const XMLCh *const publicId, const XMLCh *const systemId) |
Receive notification of the start of the DTD declarations. More... | |
virtual void | startEntity (const XMLCh *const name) |
Receive notification of the start of an entity. More... | |
Default implementation of DeclHandler interface. | |
virtual void | elementDecl (const XMLCh *const name, const XMLCh *const model) |
Report an element type declaration. More... | |
virtual void | attributeDecl (const XMLCh *const eName, const XMLCh *const aName, const XMLCh *const type, const XMLCh *const mode, const XMLCh *const value) |
Report an attribute type declaration. More... | |
virtual void | internalEntityDecl (const XMLCh *const name, const XMLCh *const value) |
Report an internal entity declaration. More... | |
virtual void | externalEntityDecl (const XMLCh *const name, const XMLCh *const publicId, const XMLCh *const systemId) |
Report a parsed external entity declaration. More... | |
Public Member Functions inherited from EntityResolver | |
EntityResolver () | |
Default Constructor. More... | |
virtual | ~EntityResolver () |
Destructor. More... | |
Public Member Functions inherited from DTDHandler | |
DTDHandler () | |
Default Constructor. More... | |
virtual | ~DTDHandler () |
Destructor. More... | |
Public Member Functions inherited from ContentHandler | |
ContentHandler () | |
Default constructor. More... | |
virtual | ~ContentHandler () |
Destructor. More... | |
Public Member Functions inherited from ErrorHandler | |
ErrorHandler () | |
Default constructor. More... | |
virtual | ~ErrorHandler () |
Destructor. More... | |
Public Member Functions inherited from LexicalHandler | |
LexicalHandler () | |
Default constructor. More... | |
virtual | ~LexicalHandler () |
Destructor. More... | |
Public Member Functions inherited from DeclHandler | |
DeclHandler () | |
Default constructor. More... | |
virtual | ~DeclHandler () |
Destructor. More... | |
Default base class for SAX2 handlers.
This class implements the default behaviour for SAX2 interfaces: EntityResolver, DTDHandler, ContentHandler, ErrorHandler, LexicalHandler, and DeclHandler.
Application writers can extend this class when they need to implement only part of an interface; parser writers can instantiate this class to provide default handlers when the application has not supplied its own.
Note that the use of this class is optional.
DefaultHandler::DefaultHandler | ( | ) |
|
virtual |
|
virtual |
Report an attribute type declaration.
Only the effective (first) declaration for an attribute will be reported.
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. |
SAXException | Any SAX exception, possibly wrapping another exception. |
Implements DeclHandler.
Receive notification of character data inside an element.
By default, do nothing. Application writers may override this method to take specific actions for each chunk of character data (such as adding the data to a node or buffer, or printing it to a file).
chars | The characters. |
length | The number of characters to use from the character array. |
SAXException | Any SAX exception, possibly wrapping another exception. |
Implements ContentHandler.
Receive notification of comments.
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.
chars | The characters from the XML document. |
length | The number of characters to read from the array. |
SAXException | Any SAX exception, possibly wrapping another exception. |
Implements LexicalHandler.
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.
name | The element type name. |
model | The content model as a normalized string. |
SAXException | Any SAX exception, possibly wrapping another exception. |
Implements DeclHandler.
|
virtual |
Receive notification of the end of a CDATA section.
The SAX parser will invoke this method at the end of each CDATA parsed.
SAXException | Any SAX exception, possibly wrapping another exception. |
Implements LexicalHandler.
|
virtual |
Receive notification of the end of the document.
By default, do nothing. Application writers may override this method in a subclass to take specific actions at the beginning of a document (such as finalising a tree or closing an output file).
SAXException | Any SAX exception, possibly wrapping another exception. |
Implements ContentHandler.
|
virtual |
Receive notification of the end of the DTD declarations.
The SAX parser will invoke this method at the end of the DTD
SAXException | Any SAX exception, possibly wrapping another exception. |
Implements LexicalHandler.
|
virtual |
Receive notification of the end of an element.
By default, do nothing. Application writers may override this method in a subclass to take specific actions at the end of each element (such as finalising a tree node or writing output to a file).
uri | The URI of the associated namespace for this element |
localname | The local part of the element name |
qname | The QName of this element |
SAXException | Any SAX exception, possibly wrapping another exception. |
Implements ContentHandler.
|
virtual |
Receive notification of the end of an entity.
The SAX parser will invoke this method at the end of an entity
name | The name of the entity that is ending. |
SAXException | Any SAX exception, possibly wrapping another exception. |
Implements LexicalHandler.
|
virtual |
Receive notification of the end of an namespace prefix mapping.
By default, do nothing. Application writers may override this method in a subclass to take specific actions at the end of each namespace prefix mapping.
prefix | The namespace prefix used |
SAXException | Any SAX exception, possibly wrapping another exception. |
Implements ContentHandler.
|
virtual |
Receive notification of a recoverable parser error.
The default implementation does nothing. Application writers may override this method in a subclass to take specific actions for each error, such as inserting the message in a log file or printing it to the console.
exc | The warning information encoded as an exception. |
SAXException | Any SAX exception, possibly wrapping another exception. |
Implements ErrorHandler.
|
virtual |
Report a parsed external entity declaration.
Only the effective (first) declaration for each entity will be reported.
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. |
SAXException | Any SAX exception, possibly wrapping another exception. |
Implements DeclHandler.
|
virtual |
Report a fatal XML parsing error.
The default implementation throws a SAXParseException. Application writers may override this method in a subclass if they need to take specific actions for each fatal error (such as collecting all of the errors into a single report): in any case, the application must stop all regular processing when this method is invoked, since the document is no longer reliable, and the parser may no longer report parsing events.
exc | The error information encoded as an exception. |
SAXException | Any SAX exception, possibly wrapping another exception. |
Implements ErrorHandler.
|
virtual |
Receive notification of ignorable whitespace in element content.
By default, do nothing. Application writers may override this method to take specific actions for each chunk of ignorable whitespace (such as adding data to a node or buffer, or printing it to a file).
chars | The whitespace characters. |
length | The number of characters to use from the character array. |
SAXException | Any SAX exception, possibly wrapping another exception. |
Implements ContentHandler.
|
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.
name | The name of the entity. If it is a parameter entity, the name will begin with ''. |
value | The replacement text of the entity. |
SAXException | Any SAX exception, possibly wrapping another exception. |
Implements DeclHandler.
|
virtual |
Receive notification of a notation declaration.
By default, do nothing. Application writers may override this method in a subclass if they wish to keep track of the notations declared in a document.
name | The notation name. |
publicId | The notation public identifier, or null if not available. |
systemId | The notation system identifier. |
Implements DTDHandler.
|
virtual |
Receive notification of a processing instruction.
By default, do nothing. Application writers may override this method in a subclass to take specific actions for each processing instruction, such as setting status variables or invoking other methods.
target | The processing instruction target. |
data | The processing instruction data, or null if none is supplied. |
SAXException | Any SAX exception, possibly wrapping another exception. |
Implements ContentHandler.
|
virtual |
|
virtual |
Reset the Document object on its reuse.
|
virtual |
Reset the Error handler object on its reuse.
Implements ErrorHandler.
|
virtual |
Resolve an external entity.
Always return null, so that the parser will use the system identifier provided in the XML document. This method implements the SAX default behaviour: application writers can override it in a subclass to do special translations such as catalog lookups or URI redirection.
publicId | The public identifier, or null if none is available. |
systemId | The system identifier provided in the XML document. |
SAXException | Any SAX exception, possibly wrapping another exception. |
Implements EntityResolver.
|
virtual |
Receive a Locator object for document events.
By default, do nothing. Application writers may override this method in a subclass if they wish to store the locator for use with other document events.
locator | A locator for all SAX document events. |
Implements ContentHandler.
|
virtual |
Receive notification of a skipped entity.
The parser will invoke this method once for each entity skipped. All processors may skip external entities, depending on the values of the features:
http://xml.org/sax/features/external-general-entities
http://xml.org/sax/features/external-parameter-entities
Introduced with SAX2
name | The name of the skipped entity. If it is a parameter entity, the name will begin with %, and if it is the external DTD subset, it will be the string [dtd]. |
SAXException | Any SAX exception, possibly wrapping another exception. |
Implements ContentHandler.
|
virtual |
Receive notification of the start of a CDATA section.
The SAX parser will invoke this method at the start of each CDATA parsed.
SAXException | Any SAX exception, possibly wrapping another exception. |
Implements LexicalHandler.
|
virtual |
Receive notification of the beginning of the document.
By default, do nothing. Application writers may override this method in a subclass to take specific actions at the beginning of a document (such as allocating the root node of a tree or creating an output file).
SAXException | Any SAX exception, possibly wrapping another exception. |
Implements ContentHandler.
|
virtual |
Receive notification of the start of the DTD declarations.
The SAX parser will invoke this method at the start of the DTD
name | The document type name. |
publicId | The declared public identifier for the external DTD subset, or null if none was declared. |
systemId | The declared system identifier for the external DTD subset, or null if none was declared. |
SAXException | Any SAX exception, possibly wrapping another exception. |
Implements LexicalHandler.
|
virtual |
Receive notification of the start of an element.
By default, do nothing. Application writers may override this method in a subclass to take specific actions at the start of each element (such as allocating a new tree node or writing output to a file).
uri | The URI of the associated namespace for this element |
localname | the local part of the element name |
qname | the QName of this element |
attrs | The specified or defaulted attributes. |
SAXException | Any SAX exception, possibly wrapping another exception. |
Implements ContentHandler.
|
virtual |
Receive notification of the start of an entity.
The SAX parser will invoke this method at the start of an entity
name | The name of the entity that is starting. |
SAXException | Any SAX exception, possibly wrapping another exception. |
Implements LexicalHandler.
|
virtual |
Receive notification of the start of an namespace prefix mapping.
By default, do nothing. Application writers may override this method in a subclass to take specific actions at the start of each namespace prefix mapping.
prefix | The namespace prefix used |
uri | The namespace URI used. |
SAXException | Any SAX exception, possibly wrapping another exception. |
Implements ContentHandler.
|
virtual |
Receive notification of an unparsed entity declaration.
By default, do nothing. Application writers may override this method in a subclass to keep track of the unparsed entities declared in a document.
name | The entity name. |
publicId | The entity public identifier, or null if not available. |
systemId | The entity system identifier. |
notationName | The name of the associated notation. |
Implements DTDHandler.
|
virtual |
Receive notification of a parser warning.
The default implementation does nothing. Application writers may override this method in a subclass to take specific actions for each warning, such as inserting the message in a log file or printing it to the console.
exc | The warning information encoded as an exception. |
SAXException | Any SAX exception, possibly wrapping another exception. |
Implements ErrorHandler.