Table 18-5 summarizes the methods of available through the SAXHandler
interface.
Table 18-5 Summary of SAXHandler Methods; Parser Package
Function | Summary |
---|---|
CDATA
|
Receive notification of CDATA. |
XMLDecl
|
Receive notification of an XML declaration. |
attributeDecl
|
Receive notification of attribute's declaration. |
characters
|
Receive notification of character data. |
comment
|
Receive notification of a comment. |
elementDecl
|
Receive notification of element's declaration. |
endDocument
|
Receive notification of the end of the document. |
endElement
|
Receive notification of element's end. |
notationDecl
|
Receive notification of a notation declaration. |
parsedEntityDecl
|
Receive notification of a parsed entity declaration. |
processingInstruction
|
Receive notification of a processing instruction. |
startDocument
|
Receive notification of the start of the document. |
startElement
|
Receive notification of element's start. |
startElementNS
|
Receive namespace aware notification of element's start. |
unparsedEntityDecl
|
Receive notification of an unparsed entity declaration. |
whitespace
|
Receive notification of whitespace characters. |
This event handles CDATA, as distinct from Text. The data will be in the data encoding, and the returned length is in characters, not bytes. This is an Oracle extension.
virtual void CDATA( oratext* data, ub4 size) = 0;
Parameter | Description |
---|---|
data |
pointer to CDATA |
size |
size of CDATA |
This event marks an XML declaration (XMLDecl
). The startDocument
event is always first; this event will be the second event. The encoding flag says whether an encoding was specified. For the standalone flag, -1 will be returned if it was not specified, otherwise 0
for FALSE
, 1 for TRUE
. This member function is an Oracle extension.
virtual void XMLDecl( oratext* version, boolean is_encoding, sword standalone) = 0;
Parameter | Description |
---|---|
version |
version string from XMLDecl |
is_encoding |
whether encoding was specified |
standalone |
value of standalone value flag |
This event marks an attribute declaration in the DTD. It is an Oracle extension; not in SAX standard
virtual void attributeDecl( oratext* attr_name, oratext *name, oratext *content) = 0;
Parameter | Description |
---|---|
attr_name |
|
name |
|
content |
body of attribute declaration |
This event marks character data.
virtual void characters( oratext* ch, ub4 size) = 0;
Parameter | Description |
---|---|
ch |
pointer to data |
size |
length of data |
This event marks a comment in the XML document. The comment's data will be in the data encoding. It is an Oracle extension, not in SAX standard.
virtual void comment( oratext* data) = 0;
Parameter | Description |
---|---|
data |
comment's data |
This event marks an element declaration in the DTD. It is an Oracle extension; not in SAX standard.
virtual void elementDecl( oratext *name, oratext *content) = 0;
Parameter | Description |
---|---|
name |
element's name |
content |
element's content |
Receive notification of the end of the document.
virtual void endDocument() = 0;
This event marks the end of an element. The name is the tagName
of the element (which may be a qualified name for namespace-aware elements) and is in the data encoding.
virtual void endElement( oratext* name) = 0;
The even marks the declaration of a notation in the DTD. The notation's name, public ID, and system ID will all be in the data encoding. Both IDs are optional and may be NULL
.
virtual void notationDecl( oratext* name, oratext* public_id, oratext* system_id) = 0;
Parameter | Description |
---|---|
name |
notations's name |
public_id |
notation's public Id |
sysem_id |
notation's system Id |
Marks a parsed entity declaration in the DTD. The parsed entity's name, public ID, system ID, and notation name will all be in the data encoding. This is an Oracle extension.
virtual void parsedEntityDecl( oratext* name, oratext* value, oratext* public_id, oratext* system_id, boolean general) = 0;
Parameter | Description |
---|---|
name |
entity's name |
value |
entity's value if internal |
public_id |
entity's public Id |
sysem_id |
entity's system Id |
general |
whether a general entity (FALSE if parameter entity)
|
This event marks a processing instruction. The PI's target and data will be in the data encoding. There is always a target, but the data may be NULL
.
virtual void processingInstruction( oratext* target, oratext* data) = 0;
Parameter | Description |
---|---|
target |
PI's target |
data |
PI's data |
Receive notification of the start of document.
virtual void startDocument() = 0;
This event marks the start of an element.
virtual void startElement( oratext* name, NodeListRef< Node>* attrs_ptr) = 0;
Parameter | Description |
---|---|
name |
element's name |
attrs_ptr |
list of element's attributes |
This event marks the start of an element. Note this is the new SAX 2 namespace-aware version. The element's qualified name, local name, and namespace URI will be in the data encoding, as are all the attribute parts.
virtual void startElementNS( oratext* qname, oratext* local, oratext* ns_URI, NodeListRef< Node>* attrs_ptr) = 0;
Parameter | Description |
---|---|
qname |
element's qualified name |
local |
element's namespace local name |
ns_URI |
element's namespace URI |
attrs_ref |
NodeList of element's attributes
|
Marks an unparsed entity declaration in the DTD. The unparsed entity's name, public ID, system ID, and notation name will all be in the data encoding.
virtual void unparsedEntityDecl( oratext* name, oratext* public_id, oratext* system_id, oratext* notation_name) = 0; };
Parameter | Description |
---|---|
name |
entity's name |
public_id |
entity's public Id |
sysem_id |
entity's system Id |
notation_name |
entity's notation name |
This event marks ignorable whitespace data such as newlines, and indentation between lines.
virtual void whitespace( oratext* data, ub4 size) = 0;
Parameter | Description |
---|---|
data |
pointer to data |
size |
length of data |