[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.

SAX is a callback-based interface to the XML parser.

You can debug the SAX behaviour by using the GSDebugSAXHandler class. Here is the sequence of callbacks that would be reported when parsing the example XML document shown earlier.

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:length:

- (void) characters: (NSString*)name length: (int)len;

Receiving some chars from the parser.


ignoreWhitespace:length:

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

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:length:

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

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.


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.