Cross-Platform C++

ot::sax
class DeclHandler  (abstract)

#include "ot/sax/DeclHandler.h"

ot::ManagedObject SAX2 extension handler for DTD declaration events.

This is an optional extension handler for SAX2 to provide information about DTD declarations in an XML document. XML readers are not required to support this handler, and this handler is not included in the core Java SAX2 distribution. The default XMLReader supplied with OpenTop does support the DeclHandler interface.

Note that data-related DTD declarations (unparsed entities and notations) are already reported through the DTDHandler interface.

If you are using the declaration handler together with a lexical handler, all of the events will occur between the LexicalHandler::startDTD() and the LexicalHandler::endDTD() events.

To set the DeclHandler for an XML reader, use the XMLReader::setDeclHandler() method. This differs from the Java SAX 2.0 distribution, where it is necessary to to use a generic setProperty() method.




Method Summary
 virtual void attributeDecl(const String& eName, const String& aName, const String& type, const String& valueDefault, const String& value)=0
         Report an attribute type declaration.
 virtual void elementDecl(const String& name, const String& model)=0
         Report an element type declaration.
 virtual void externalEntityDecl(const String& name, const String& publicId, const String& systemId)=0
         Report a parsed external entity declaration.
 virtual void internalEntityDecl(const String& name, const String& value)=0
         Report an internal entity declaration.

Methods inherited from class ot::ManagedObject
addRef, getRefCount, onFinalRelease, operator=, release

Method Detail

attributeDecl

virtual void attributeDecl(const String& eName,
                           const String& aName,
                           const String& type,
                           const String& valueDefault,
                           const String& value)=0
Report an attribute type declaration. Only the effective (first) declaration for an attribute will be reported. The type will be one of the strings "CDATA", "ID", "IDREF", "IDREFS", "NMTOKEN", "NMTOKENS", "ENTITY", "ENTITIES", a parenthesized token group with the separator "|" and all whitespace removed, or the word "NOTATION" followed by a space followed by a parenthesized token group with all whitespace removed.

Any parameter entities in the attribute value will be expanded, but general entities will not.

Parameters:
eName - The name of the associated element.
aName - The name of the attribute.
type - A string representing the attribute type.
valueDefault - A string representing the attribute default ("IMPLIED", "REQUIRED", or "FIXED") or the empty string if none of these applies.
value - A string representing the attribute's default value, or the empty string if there is none.
Exceptions:
SAXException - The application may throw an exception during processing. If so, the SAX XML parser will stop parsing the current document.

elementDecl

virtual void elementDecl(const String& name,
                         const String& model)=0
Report an element type declaration. The content model will consist of the string "EMPTY", the string "ANY", or a parenthesized group, optionally followed by an occurrence indicator. The model will be normalized so that all parameter entities are fully resolved and all whitespace is removed,and will include the enclosing parentheses. Other normalization (such as removing redundant parentheses or simplifying occurrence indicators) is at the discretion of the parser.

Parameters:
name - The element type name.
model - The content model as a normalized string.
Exceptions:
SAXException - The application may throw an exception during processing. If so, the SAX XML parser will stop parsing the current document.

externalEntityDecl

virtual void externalEntityDecl(const String& name,
                                const String& publicId,
                                const String& systemId)=0
Report a parsed external entity declaration. Only the effective (first) declaration for each entity will be reported.

Parameters:
name - The name of the entity. If it is a parameter entity, the name will begin with '%'.
publicId - The declared public identifier of the entity, or the empty string if none was declared.
systemId - The declared system identifier of the entity. If the system identifier is a URL, it will be fully resolved if the http://elcel.com/opentop/sax/features/resolve-entity-uris feature is set to true (the default).
Exceptions:
SAXException - The application may throw an exception during processing. If so, the SAX XML parser will stop parsing the current document.
See also:
internalEntityDecl() , DTDHandler::unparsedEntityDecl()

internalEntityDecl

virtual void internalEntityDecl(const String& name,
                                const String& value)=0
Report an internal entity declaration. Only the effective (first) declaration for each entity will be reported. All parameter entities in the value will be expanded, but general entities will not.

Parameters:
name - The name of the entity. If it is a parameter entity, the name will begin with '%'.
value - The replacement text of the entity.
Exceptions:
SAXException - The application may throw an exception during processing. If so, the SAX XML parser will stop parsing the current document.
See also:
externalEntityDecl() , DTDHandler::unparsedEntityDecl()


Cross-Platform C++

Found a bug or missing feature? Please email us at support@elcel.com

Copyright © 2000-2003 ElCel Technology   Trademark Acknowledgements