Ghidra Decompiler Analysis Engine
Public Member Functions | List of all members
ContentHandler Class Referenceabstract

The SAX interface for parsing XML documents. More...

#include <xml.hh>

Inheritance diagram for ContentHandler:
Inheritance graph
[legend]

Public Member Functions

virtual void setDocumentLocator (Locator locator)=0
 Set the Locator object for documents.
 
virtual void startDocument (void)=0
 Start processing a new XML document.
 
virtual void endDocument (void)=0
 End processing for the current XML document.
 
virtual void startPrefixMapping (const string &prefix, const string &uri)=0
 Start a new prefix to namespace URI mapping.
 
virtual void endPrefixMapping (const string &prefix)=0
 Finish the current prefix.
 
virtual void startElement (const string &namespaceURI, const string &localName, const string &qualifiedName, const Attributes &atts)=0
 Callback indicating a new XML element has started. More...
 
virtual void endElement (const string &namespaceURI, const string &localName, const string &qualifiedName)=0
 Callback indicating parsing of the current XML element is finished. More...
 
virtual void characters (const char *text, int4 start, int4 length)=0
 Callback with raw characters to be inserted in the current XML element. More...
 
virtual void ignorableWhitespace (const char *text, int4 start, int4 length)=0
 Callback with whitespace character data for the current XML element. More...
 
virtual void setVersion (const string &version)=0
 Set the XML version as specified by the current document. More...
 
virtual void setEncoding (const string &encoding)=0
 Set the character encoding as specified by the current document. More...
 
virtual void processingInstruction (const string &target, const string &data)=0
 Callback for a formal processing instruction seen in the current document. More...
 
virtual void skippedEntity (const string &name)=0
 Callback for an XML entity skipped by the parser. More...
 
virtual void setError (const string &errmsg)=0
 Callback for handling an error condition during XML parsing. More...
 

Detailed Description

The SAX interface for parsing XML documents.

This is the formal interface for handling the low-level string pieces of an XML document as they are scanned by the parser.

Member Function Documentation

◆ characters()

virtual void ContentHandler::characters ( const char *  text,
int4  start,
int4  length 
)
pure virtual

Callback with raw characters to be inserted in the current XML element.

Parameters
textis an array of character data being inserted.
startis the first character within the array to insert.
lengthis the number of characters to insert.

Implemented in TreeHandler.

◆ endElement()

virtual void ContentHandler::endElement ( const string &  namespaceURI,
const string &  localName,
const string &  qualifiedName 
)
pure virtual

Callback indicating parsing of the current XML element is finished.

Parameters
namespaceURIis the namespace to which the element belongs
localNameis the local name of the new element
qualifiedNameis the fully qualified name of the element.

Implemented in TreeHandler.

◆ ignorableWhitespace()

virtual void ContentHandler::ignorableWhitespace ( const char *  text,
int4  start,
int4  length 
)
pure virtual

Callback with whitespace character data for the current XML element.

Parameters
textis an array of character data that can be inserted.
startis the first character within the array to insert.
lengthis the number of characters to insert.

Implemented in TreeHandler.

◆ processingInstruction()

virtual void ContentHandler::processingInstruction ( const string &  target,
const string &  data 
)
pure virtual

Callback for a formal processing instruction seen in the current document.

Parameters
targetis the target instruction to process
datais (optional) character data for the instruction

Implemented in TreeHandler.

◆ setEncoding()

virtual void ContentHandler::setEncoding ( const string &  encoding)
pure virtual

Set the character encoding as specified by the current document.

Parameters
encodingis the parsed encoding string

Implemented in TreeHandler.

◆ setError()

virtual void ContentHandler::setError ( const string &  errmsg)
pure virtual

Callback for handling an error condition during XML parsing.

Parameters
errmsgis a message describing the error condition

Implemented in TreeHandler.

◆ setVersion()

virtual void ContentHandler::setVersion ( const string &  version)
pure virtual

Set the XML version as specified by the current document.

Parameters
versionis the parsed version string

Implemented in TreeHandler.

◆ skippedEntity()

virtual void ContentHandler::skippedEntity ( const string &  name)
pure virtual

Callback for an XML entity skipped by the parser.

Parameters
nameis the name of the entity being skipped

Implemented in TreeHandler.

◆ startElement()

virtual void ContentHandler::startElement ( const string &  namespaceURI,
const string &  localName,
const string &  qualifiedName,
const Attributes atts 
)
pure virtual

Callback indicating a new XML element has started.

Parameters
namespaceURIis the namespace to which the new element belongs
localNameis the local name of the new element
qualifiedNameis the fully qualified name of the new element
attsis the set of (previously parsed) attributes to attach to the new element

Implemented in TreeHandler.


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