Objective Systems, Inc.  
Home
About ASN.1
Products
Free Software
Documents
Services
Resources
Resellers
Customers
Careers
About Us
Contact Us
 

Google


Objective Systems, Inc.

OSXMLContentHandler Class Reference

Receive notification of general document events. More...

#include <rtSaxCppParserIF.h>

Inheritance diagram for OSXMLContentHandler:

OSXMLDefaultHandlerIF OSXMLDefaultHandler List of all members.

Public Member Functions

The virtual document handler interface
virtual void characters (const XMLCHAR *const chars, unsigned int length)=0
 Receive notification of character data.

virtual void endElement (const XMLCHAR *const uri, const XMLCHAR *const localname, const XMLCHAR *const qname)=0
 Receive notification of the end of an element.

virtual void startElement (const XMLCHAR *const uri, const XMLCHAR *const localname, const XMLCHAR *const qname, const XMLCHAR *const *attrs)=0
 Receive notification of the beginning of an element.


Detailed Description

Receive notification of general document events.

This is the main interface that most SAX2 applications implement: if the application needs to be informed of basic parsing events, it implements this interface and registers an instance with the SAX2 parser using the setDocumentHandler 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.

Application writers who do not want to implement the entire interface while can derive a class from Sax2HandlerBase, which implements the default functionality; parser writers can instantiate Sax2HandlerBase to obtain a default handler. The application can find the location of any document event using the Locator interface supplied by the Parser through the setDocumentLocator method.

See also:
Parser#setDocumentHandler

Locator#Locator

Sax2HandlerBase#Sax2HandlerBase

Definition at line 173 of file rtSaxCppParserIF.h.


Member Function Documentation

virtual void OSXMLContentHandler::characters const XMLCHAR *const  chars,
unsigned int  length
[pure virtual]
 

Receive notification of character data.

The Parser will call this method to report each chunk of character data. SAX parsers may return all contiguous character data in a single chunk, or they may split it into several chunks; however, all of the characters in any single event must come from the same external entity, so that the Locator provides useful information.

The application must not attempt to read from the array outside of the specified range.

Note that some parsers will report whitespace using the ignorableWhitespace() method rather than this one (validating parsers must do so).

Parameters:
chars The characters from the XML document.
length The number of characters to read from the array.
Exceptions:
SAXException Any SAX exception, possibly wrapping another exception.
See also:
#ignorableWhitespace

Locator#Locator

Implemented in OSXMLDefaultHandler, and OSXMLDefaultHandlerIF.

virtual void OSXMLContentHandler::endElement const XMLCHAR *const  uri,
const XMLCHAR *const  localname,
const XMLCHAR *const  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 URI of the asscioated namespace for this element
localname The local part of the element name
qname The QName of this element
Exceptions:
SAXException Any SAX exception, possibly wrapping another exception.

Implemented in OSXMLDefaultHandler, and OSXMLDefaultHandlerIF.

virtual void OSXMLContentHandler::startElement const XMLCHAR *const  uri,
const XMLCHAR *const  localname,
const XMLCHAR *const  qname,
const XMLCHAR *const *  attrs
[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.

Note that the attribute list provided will contain only attributes with explicit values (specified or defaulted): #IMPLIED attributes will be omitted.

Parameters:
uri The URI of the asscioated namespace for this element
localname The local part of the element name
qname The QName of this element
attrs The attributes attached to the element, if any.
Exceptions:
SAXException Any SAX exception, possibly wrapping another exception.
See also:
endElement

Attributes#Attributes

Implemented in OSXMLDefaultHandler, and OSXMLDefaultHandlerIF.


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

This file was last modified on 1 Jun 2004.
XBinder, Version 1.0.0