[Previous] [Up]

GSSAXHandler

Authors

Michael Pakhantsov
Richard Frith-Macdonald

Version: 0.2

Date: 15 september, 2000

GSSAXHandler

GSSAXHandler

Declared in: GSXML.h

Inherits from: NSObject


XML SAX Handler.

GSSAXHandler is a callback-based interface to the XML parser that operates in a similar (though not identical) manner to SAX.

Each GSSAXHandler object is associated with a GSXMLParser object. As parsing progresses, the mathods of the GSSAXHandler are invoked by the parser, so the handler is able to deal with the elements and entities being parsed.

The callback methods in the GSSAXHandler class do nothing - it is intended that you subclass GSSAXHandler and override them.

Instance Variables

Methods


Class Methods

handler

+ (GSSAXHandler*) handler;

Create a new SAX handler.



Instances Methods

lib

- (void*) lib;

Return pointer to xmlSAXHandler structure.


parser

- (GSXMLParser*) parser;

Return the parser object with which this handler is associated. This may occasionally be useful.


startDocument

- (void) startDocument;

Called when the document start being processed.


endDocument

- (void) endDocument;

Called when the document end has been detected.


isStandalone

- (int) isStandalone;

Called if the document is standalone.


startElement:attributes:

- (void) startElement: (NSString*)elementName attributes: (NSMutableDictionary*)elementAttributes;

Called when an opening tag has been processed.


endElement

- (void) endElement (NSString*)elementName;

Called when the end of an element has been detected.


attribute:value:

- (void) attribute: (NSString*)name value: (NSString*)value;

Handle an attribute that has been read by the parser.


characters:

- (void) characters: (NSString*)name;

Receiving some chars from the parser.


ignoreWhitespace:

- (void) ignoreWhitespace: (NSString*)ch;

Receiving some ignorable whitespaces from the parser.


processInstruction:value:

- (void) processInstruction: (NSString*)targetName value: (NSString*)PIData;

A processing instruction has been parsed.


comment:

- (void) comment: (NSString*)value;

A comment has been parsed.


cdataBlock:

- (void) cdataBlock: (NSString*)value;

Called when a pcdata block has been parsed.


globalNamespace:href:prefix:

- (void) globalNamespace: (NSString*)name href: (NSString*)href prefix: (NSString*)prefix;

An old global namespace has been parsed.


error:

- (void) error: (NSString*)message;

Called when found a error.


fatalError:

- (void) fatalError: (NSString*)message;

Called when found a fatal error.


warning:

- (void) warning: (NSString*)message;

Called when found a warning.


hasInternalSubset:

- (int) hasInternalSubset:;

Callback on internal subset declaration.


hasExternalSubset:

- (int) hasExternalSubset:;

Does this document have an external subset.


internalSubset:externalID:systemID:

- (void) internalSubset: (NSString*)name externalID: (NSString*)externalID systemID: (NSString*)systemID;

Callback on internal subset declaration.


externalSubset:externalID:systemID:

- (void) externalSubset: (NSString*)name externalID: (NSString*)externalID systemID: (NSString*)systemID;

Callback on external subset declaration.


resolveEntity:systemID:

- (void*) resolveEntity: (NSString*)publicID systemID: (NSString*)systemID;

The entity loader, to control the loading of external entities, the application can either.


getEntity:

- (void*) getEntity: (NSString*)name;

Get an entity by name.


getParameterEntity:

- (void*) getParameterEntity: (NSString*)name;

Get a parameter entity by name.


namespaceDecl:href:prefix:

- (void) namespaceDecl: (NSString*)name href: (NSString*)href prefix: (NSString*)prefix;

A namespace has been parsed.


notationDecl:systemId:

- (void) notationDecl: (NSString*)publicId systemId: (NSString*)systemId;

What to do when a notation declaration has been parsed.


entityDecl:type:publicId:systemId:content:

- (void) entityDecl: (NSString*)name type: (int)type publicId: (NSString*)publicId systemId: (NSString*)systemId content: (NSString*)content;

An entity definition has been parsed.


attributeDecl:name:type:typeDefValue:defaultValue:

- (void) attributeDecl: (NSString*)nameElement name: (NSString*)name type: (int)type typeDefValue: (int)defType defaultValue: (NSString*)value;

An attribute definition has been parsed.


elementDecl:type:

- (void) elementDecl: (NSString*)name type: (int)type;

An element definition has been parsed.


unparsedEntityDecl:public:system:notationName:

- (void) unparsedEntityDecl: (NSString*)name public: (NSString*)publicId system: (NSString*)systemId notationName: (NSString*)notation;

What to do when an unparsed entity declaration is parsed.


reference:

- (void) reference: (NSString*)name;

Called when an entity reference is detected.