Usage: you can freely reimplement this interface.
interface CATISAXContentHandler
Interface to 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 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 content (character data, processing instructions, and/or subelements) will appear, in order, between the event and the corresponding event.
public virtual Characters( | const | iCharacters) |
The 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 provides useful information.
Note that some parsers will report whitespace using the method rather than this one (validating parsers must do so).
Error Class | Error Id | Description |
---|---|---|
XMLParserERR_2000 | The method can raise a CATSAXException | |
XMLParserERR_2002 | The method can raise a CATSAXParseException |
public virtual EndDocument( | ) |
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.
Error Class | Error Id | Description |
---|---|---|
XMLParserERR_2000 | The method can raise a CATSAXException | |
XMLParserERR_2002 | The method can raise a CATSAXParseException |
public virtual EndElement( | const | iURI, |
const | iLocalName, | |
const | iQualifiedName) |
The SAX parser will invoke this method at the end of every element in the XML document; there will be a corresponding event for every event (even when the element is empty).
For information on the names, see .
Error Class | Error Id | Description |
---|---|---|
XMLParserERR_2000 | The method can raise a CATSAXException | |
XMLParserERR_2002 | The method can raise a CATSAXParseException |
public virtual EndPrefixMapping( | const | iPrefix) |
Error Class | Error Id | Description |
---|---|---|
XMLParserERR_2000 | The method can raise a CATSAXException | |
XMLParserERR_2002 | The method can raise a CATSAXParseException |
public virtual IgnorableWhiteSpace( | const | iCharacters) |
Validating s must use this method to report each chunk of ignorable whitespace (see the W3C XML 1.0 recommendation, section 2.10): non-validating parsers may also use this method if they are capable of parsing and using content models.
SAX parsers may return all contiguous whitespace 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 provides useful information.
Error Class | Error Id | Description |
---|---|---|
XMLParserERR_2000 | The method can raise a CATSAXException | |
XMLParserERR_2002 | The method can raise a CATSAXParseException |
public virtual ProcessingInstruction( | const | iTarget, |
const | iData) |
The will invoke this method once for each processing instruction found: note that processing instructions may occur before or after the main document element.
A SAX parser should never report an XML declaration (XML 1.0, section 2.8) or a text declaration (XML 1.0, section 4.3.1) using this method.
Error Class | Error Id | Description |
---|---|---|
XMLParserERR_2000 | The method can raise a CATSAXException | |
XMLParserERR_2002 | The method can raise a CATSAXParseException |
public virtual SetDocumentLocator( | const | iLocator) |
SAX parsers are strongly encouraged (though not absolutely required) to supply a locator: if it does so, it must supply the locator to the application by invoking this method before invoking any of the other methods in the interface.
The locator allows the application to determine the end position of any document-related event, even if the parser is not reporting an error. Typically, the application will use this information for reporting its own errors (such as character content that does not match an application's business rules). The information returned by the locator is probably not sufficient for use with a search engine.
Note that the locator will return correct information only during the invocation of the events in this interface. The application should not attempt to use it at any other time.
public virtual SkippedEntity( | const | iName) |
The will invoke this method once for each entity skipped. Non-validating processors may skip entities if they have not seen the declarations (because, for example, the entity was declared in an external DTD subset). All processors may skip external entities, depending on the values of the http://xml.org/sax/features/external-general-entities and the http://xml.org/sax/features/external-parameter-entities properties.
Error Class | Error Id | Description |
---|---|---|
XMLParserERR_2000 | The method can raise a CATSAXException | |
XMLParserERR_2002 | The method can raise a CATSAXParseException |
public virtual StartDocument( | ) |
The SAX parser will invoke this method only once, before any other methods in this interface or in (except for ).
Error Class | Error Id | Description |
---|---|---|
XMLParserERR_2000 | The method can raise a CATSAXException | |
XMLParserERR_2002 | The method can raise a CATSAXParseException |
public virtual StartElement( | const | iURI, |
const | iLocalName, | |
const | iQualifiedName, | |
const | iAttributes) |
The Parser will invoke this method at the beginning of every element in the XML document; there will be a corresponding event for every event (even when the element is empty).
All of the element content will be reported, in order, before the corresponding event .
This event allows up to three name components for each element:
Any or all of these may be provided, depending on the values of the http://xml.org/sax/features/namespaces and the http://xml.org/sax/features/namespace-prefixes properties:
Note that the attribute list provided will contain only attributes with explicit values (specified or defaulted): #IMPLIED attributes will be omitted. The attribute list will contain attributes used for Namespace declarations (xmlns* attributes) only if the http://xml.org/sax/features/namespace-prefixes property is TRUE (it is FALSE by default, and support for a TRUE value is optional).
Error Class | Error Id | Description |
---|---|---|
XMLParserERR_2000 | The method can raise a CATSAXException | |
XMLParserERR_2002 | The method can raise a CATSAXParseException |
public virtual StartPrefixMapping( | const | iPrefix, |
const | iURI) |
The information from this event is not necessary for normal Namespace processing: the will automatically replace prefixes for element and attribute names when the http://xml.org/sax/features/namespaces feature is TRUE (the default).
There are cases, however, when applications need to use prefixes in character data or in attribute values, where they cannot safely be expanded automatically; the / events supply the information to the application to expand prefixes in those contexts itself, if necessary.
Note that / events are not guaranteed to be properly nested relative to each-other: all events will occur before the corresponding event, and all events will occur after the corresponding event, but their order is not otherwise guaranteed.
There should never be / events for the "xml" prefix, since it is predeclared and immutable.
Error Class | Error Id | Description |
---|---|---|
XMLParserERR_2000 | The method can raise a CATSAXException | |
XMLParserERR_2002 | The method can raise a CATSAXParseException |
Copyright © 1999-2014, Dassault Systèmes. All rights reserved.