XMLParserItf Interface CATISAXLexicalHandler

Usage: you can freely reimplement this interface.


interface CATISAXLexicalHandler

Interface to receive notification of lexical events.

This is an optional extension handler for SAX2 to provide lexical information about an XML document, such as comments and CDATA section boundaries; XML readers are not required to support this handler, and it is not part of the core SAX2 distribution.

The events in the lexical handler apply to the entire document, not just to the document element, and all lexical handler events must appear between the content handler's and events.

To set the CATISAXDeclHandler for an CATISAXXMLReader, use the method with the propertyId "http://xml.org/sax/properties/lexical-handler". If the reader does not support declaration events, it will return a error or a error when you attempt to register the handler.

See also:


Method Index


o Comment(CATUnicodeString&)
Receives notification of an XML comment anywhere in the document.
o EndCDATA()
Receives notification of the end of a CDATA section.
o EndDTD()
Receives notification of the end of DTD declarations.
o EndEntity(CATUnicodeString&)
Receives notification of the end of an entity.
o StartCDATA()
Receives notification of the start of a CDATA section.
o StartDTD(CATUnicodeString&,CATUnicodeString&,CATUnicodeString&)
Receives notification of the start of DTD declarations, if any.
o StartEntity(CATUnicodeString&)
Receives notification of the beginning of some internal and external XML entities.

Methods


o Comment
public virtual Comment( const iComment)
Receives notification of an XML comment anywhere in the document.

This callback will be used for comments inside or outside the document element, including comments in the external DTD subset (if read). Comments in the DTD must be properly nested inside / and / events (if used).

Parameters:
iComment
The comment text.
Errors Returned:
Error Class Error Id Description
XMLParserERR_2000 The method can raise a CATSAXException
See also:
o EndCDATA
public virtual EndCDATA()
Receives notification of the end of a CDATA section.
Errors Returned:
Error Class Error Id Description
XMLParserERR_2000 The method can raise a CATSAXException
See also:
o EndDTD
public virtual EndDTD()
Receives notification of the end of DTD declarations.

This method is intended to report the end of the DOCTYPE declaration; if the document has no DOCTYPE declaration, this method will not be invoked.

Errors Returned:
Error Class Error Id Description
XMLParserERR_2000 The method can raise a CATSAXException
See also:
o EndEntity
public virtual EndEntity( const iName)
Receives notification of the end of an entity.
Errors Returned:
Error Class Error Id Description
XMLParserERR_2000 The method can raise a CATSAXException
Parameters:
iName
The name of the entity that is ending.
See also:
o StartCDATA
public virtual StartCDATA()
Receives notification of the start of a CDATA section.

The contents of the CDATA section will be reported through the regular event; this event is intended only to report the boundary.

Errors Returned:
Error Class Error Id Description
XMLParserERR_2000 The method can raise a CATSAXException
See also:
o StartDTD
public virtual StartDTD( const iName,
const iPublicId,
const iSystemId)
Receives notification of the start of DTD declarations, if any.

This method is intended to report the beginning of the DOCTYPE declaration; if the document has no DOCTYPE declaration, this method will not be invoked.

All declarations reported through or events must appear between the and events. Declarations are assumed to belong to the internal DTD subset unless they appear between and events. Comments and processing instructions from the DTD should also be reported between the and events, in their original order of (logical) occurrence; they are not required to appear in their correct locations relative to or events, however.

Note that the / events will appear within the / events and before the first event.

Parameters:
iName
The document type name.
iPublicId
The declared public identifier for the external DTD subset, or an empty string if none was declared.
iSystemId
The declared system identifier for the external DTD subset, or an empty string if none was declared.
Errors Returned:
Error Class Error Id Description
XMLParserERR_2000 The method can raise a CATSAXException
See also:
o StartEntity
public virtual StartEntity( const iName)
Receives notification of the beginning of some internal and external XML entities.

The reporting of parameter entities (including the external DTD subset) is optional, and SAX2 drivers that support may not support it; you can use the http://xml.org/sax/features/lexical-handler/parameter-entities feature to query or control the reporting of parameter entities.

General entities are reported with their regular names, parameter entities have '%' prepended to their names, and the external DTD subset has the pseudo-entity name "[dtd]".

When a SAX2 driver is providing these events, all other events must be properly nested within / events. There is no additional requirement that events from or be properly ordered.

Note that skipped entities will be reported through the event, which is part of the interface.

Because of the streaming event model that SAX uses, some entity boundaries cannot be reported under any circumstances:

These will be silently expanded, with no indication of where the original entity boundaries were.

Note also that the boundaries of character references (which are not really entities anyway) are not reported.

All / events must be properly nested.

Parameters:
iName
The name of the entity. If it is a parameter entity, the name will begin with '%', and if it is the external DTD subset, it will be "[dtd]".
Errors Returned:
Error Class Error Id Description
XMLParserERR_2000 The method can raise a CATSAXException
See also:
, ,

This object is included in the file: CATISAXLexicalHandler.h
If needed, your Imakefile.mk should include the module: CatXmlItfBase

Copyright © 1999-2014, Dassault Systèmes. All rights reserved.