Usage: you can derive this class.
public class CATSAXDefaultHandler
Default base class for SAX2 event handlers.
This class is available as a convenience base class for SAX2 applications: it provides default implementations for all of the callbacks in the four core SAX2 handler classes:
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.
public CATSAXDefaultHandler( | ) |
public virtual ~CATSAXDefaultHandler( | ) |
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 Error( | iException) |
This corresponds to the definition of "error" in section 1.2 of the W3C XML 1.0 Recommendation. For example, a validating parser would use this callback to report the violation of a validity constraint. The default behaviour is to take no action.
The SAX parser must continue to provide normal parsing events after invoking this method: it should still be possible for the application to process the document through to the end. If the application cannot do so, then the parser should report a fatal error even if the XML 1.0 recommendation does not require it to 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 FatalError( | iException) |
This corresponds to the definition of "fatal error" in section 1.2 of the W3C XML 1.0 Recommendation. For example, a parser would use this callback to report the violation of a well-formedness constraint.
The application must assume that the document is unusable after the parser has invoked this method, and should continue (if at all) only for the sake of collecting addition error messages: in fact, SAX parsers are free to stop reporting any other events once this method has been invoked.
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 NotationDecl( | const | iName, |
const | iPublicId, | |
const | iSystemId) |
It is up to the application to record the notation for later reference, if necessary.
At least one of publicId and systemId must be non-empty.
If a system identifier is present, and it is a URL, the SAX parser must resolve it fully before passing it to the application.
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 ResolveEntity( | const | iPublicId, |
const | iSystemId, | |
oInputSource) |
The will call this method before opening any external entity except the top-level document entity (including the external DTD subset, external entities referenced within the DTD, and external entities referenced within the document element): the application may request that the parser resolve the entity itself, that it use an alternative URI, or that it use an entirely different input source.
Application writers can use this method to redirect external system identifiers to secure and/or local URIs, to look up public identifiers in a catalogue, or to read an entity from a database or other input source (including, for example, a dialog box).
If the system identifier is a URL, the SAX parser must resolve it fully before reporting it to the application.
Error Class | Error Id | Description |
---|---|---|
XMLParserERR_2000 | The method can raise a CATSAXException | |
XMLParserERR_2001 | If an I/O error occurs, possibly the result of creating a new the method can raise this error. |
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 |
public virtual UnparsedEntityDecl( | const | iName, |
const | iPublicId, | |
const | iSystemId, | |
const | iNotationName) |
Note that the notation name corresponds to a notation reported by the event. It is up to the application to record the entity for later reference, if necessary.
If the system identifier is a URL, the parser must resolve it fully before passing it to the application.
Error Class | Error Id | Description |
---|---|---|
XMLParserERR_2000 | The method can raise a CATSAXException | |
XMLParserERR_2002 | The method can raise a CATSAXParseException |
public virtual Warning( | iException) |
SAX parsers will use this method to report conditions that are not errors or fatal errors as defined by the XML 1.0 recommendation. The default behaviour is to take no action.
The SAX parser must continue to provide normal parsing events after invoking this method: it should still be possible for the application to process the document through to the end.
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.