SAX

SAX —

Synopsis




const xmlChar* getPublicId                  (void *ctx);
const xmlChar* getSystemId                  (void *ctx);
void        setDocumentLocator              (void *ctx,
                                             xmlSAXLocatorPtr loc);
int         getLineNumber                   (void *ctx);
int         getColumnNumber                 (void *ctx);
int         isStandalone                    (void *ctx);
int         hasInternalSubset               (void *ctx);
int         hasExternalSubset               (void *ctx);
void        internalSubset                  (void *ctx,
                                             const xmlChar *name,
                                             const xmlChar *ExternalID,
                                             const xmlChar *SystemID);
void        externalSubset                  (void *ctx,
                                             const xmlChar *name,
                                             const xmlChar *ExternalID,
                                             const xmlChar *SystemID);
xmlEntityPtr getEntity                      (void *ctx,
                                             const xmlChar *name);
xmlEntityPtr getParameterEntity             (void *ctx,
                                             const xmlChar *name);
xmlParserInputPtr resolveEntity             (void *ctx,
                                             const xmlChar *publicId,
                                             const xmlChar *systemId);
void        entityDecl                      (void *ctx,
                                             const xmlChar *name,
                                             int type,
                                             const xmlChar *publicId,
                                             const xmlChar *systemId,
                                             xmlChar *content);
void        attributeDecl                   (void *ctx,
                                             const xmlChar *elem,
                                             const xmlChar *fullname,
                                             int type,
                                             int def,
                                             const xmlChar *defaultValue,
                                             xmlEnumerationPtr tree);
void        elementDecl                     (void *ctx,
                                             const xmlChar *name,
                                             int type,
                                             xmlElementContentPtr content);
void        notationDecl                    (void *ctx,
                                             const xmlChar *name,
                                             const xmlChar *publicId,
                                             const xmlChar *systemId);
void        unparsedEntityDecl              (void *ctx,
                                             const xmlChar *name,
                                             const xmlChar *publicId,
                                             const xmlChar *systemId,
                                             const xmlChar *notationName);
void        startDocument                   (void *ctx);
void        endDocument                     (void *ctx);
void        attribute                       (void *ctx,
                                             const xmlChar *fullname,
                                             const xmlChar *value);
void        startElement                    (void *ctx,
                                             const xmlChar *fullname,
                                             const xmlChar **atts);
void        endElement                      (void *ctx,
                                             const xmlChar *name);
void        reference                       (void *ctx,
                                             const xmlChar *name);
void        characters                      (void *ctx,
                                             const xmlChar *ch,
                                             int len);
void        ignorableWhitespace             (void *ctx,
                                             const xmlChar *ch,
                                             int len);
void        processingInstruction           (void *ctx,
                                             const xmlChar *target,
                                             const xmlChar *data);
void        globalNamespace                 (void *ctx,
                                             const xmlChar *href,
                                             const xmlChar *prefix);
void        setNamespace                    (void *ctx,
                                             const xmlChar *name);
xmlNsPtr    getNamespace                    (void *ctx);
int         checkNamespace                  (void *ctx,
                                             xmlChar *nameSpace);
void        namespaceDecl                   (void *ctx,
                                             const xmlChar *href,
                                             const xmlChar *prefix);
void        comment                         (void *ctx,
                                             const xmlChar *value);
void        cdataBlock                      (void *ctx,
                                             const xmlChar *value,
                                             int len);
void        initxmlDefaultSAXHandler        (xmlSAXHandler *hdlr,
                                             int warning);
void        inithtmlDefaultSAXHandler       (xmlSAXHandler *hdlr);
void        initdocbDefaultSAXHandler       (xmlSAXHandler *hdlr);
void        xmlDefaultSAXHandlerInit        (void);
void        htmlDefaultSAXHandlerInit       (void);
void        docbDefaultSAXHandlerInit       (void);

Description

Details

getPublicId ()

const xmlChar* getPublicId                  (void *ctx);

Provides the public ID e.g. "-//SGMLSOURCE//DTD DEMO//EN"

ctx :
Returns :

getSystemId ()

const xmlChar* getSystemId                  (void *ctx);

Provides the system ID, basically URL or filename e.g. http://www.sgmlsource.com/dtds/memo.dtd

ctx :
Returns :

setDocumentLocator ()

void        setDocumentLocator              (void *ctx,
                                             xmlSAXLocatorPtr loc);

Receive the document locator at startup, actually xmlDefaultSAXLocator Everything is available on the context, so this is useless in our case.

ctx :
loc :

getLineNumber ()

int         getLineNumber                   (void *ctx);

Provide the line number of the current parsing point.

ctx :
Returns :

getColumnNumber ()

int         getColumnNumber                 (void *ctx);

Provide the column number of the current parsing point.

ctx :
Returns :

isStandalone ()

int         isStandalone                    (void *ctx);

Is this document tagged standalone ?

ctx :
Returns :

hasInternalSubset ()

int         hasInternalSubset               (void *ctx);

Does this document has an internal subset

ctx :
Returns :

hasExternalSubset ()

int         hasExternalSubset               (void *ctx);

Does this document has an external subset

ctx :
Returns :

internalSubset ()

void        internalSubset                  (void *ctx,
                                             const xmlChar *name,
                                             const xmlChar *ExternalID,
                                             const xmlChar *SystemID);

Callback on internal subset declaration.

ctx :
name :
ExternalID :
SystemID :

externalSubset ()

void        externalSubset                  (void *ctx,
                                             const xmlChar *name,
                                             const xmlChar *ExternalID,
                                             const xmlChar *SystemID);

Callback on external subset declaration.

ctx :
name :
ExternalID :
SystemID :

getEntity ()

xmlEntityPtr getEntity                      (void *ctx,
                                             const xmlChar *name);

Get an entity by name

ctx :
name :
Returns :

getParameterEntity ()

xmlEntityPtr getParameterEntity             (void *ctx,
                                             const xmlChar *name);

Get a parameter entity by name

ctx :
name :
Returns :

resolveEntity ()

xmlParserInputPtr resolveEntity             (void *ctx,
                                             const xmlChar *publicId,
                                             const xmlChar *systemId);

The entity loader, to control the loading of external entities, the application can either: - override this resolveEntity() callback in the SAX block - or better use the xmlSetExternalEntityLoader() function to set up it's own entity resolution routine

ctx :
publicId :
systemId :
Returns :

entityDecl ()

void        entityDecl                      (void *ctx,
                                             const xmlChar *name,
                                             int type,
                                             const xmlChar *publicId,
                                             const xmlChar *systemId,
                                             xmlChar *content);

An entity definition has been parsed

ctx :
name :
type :
publicId :
systemId :
content :

attributeDecl ()

void        attributeDecl                   (void *ctx,
                                             const xmlChar *elem,
                                             const xmlChar *fullname,
                                             int type,
                                             int def,
                                             const xmlChar *defaultValue,
                                             xmlEnumerationPtr tree);

An attribute definition has been parsed

ctx :
elem :
fullname :
type :
def :
defaultValue :
tree :

elementDecl ()

void        elementDecl                     (void *ctx,
                                             const xmlChar *name,
                                             int type,
                                             xmlElementContentPtr content);

An element definition has been parsed

ctx :
name :
type :
content :

notationDecl ()

void        notationDecl                    (void *ctx,
                                             const xmlChar *name,
                                             const xmlChar *publicId,
                                             const xmlChar *systemId);

What to do when a notation declaration has been parsed.

ctx :
name :
publicId :
systemId :

unparsedEntityDecl ()

void        unparsedEntityDecl              (void *ctx,
                                             const xmlChar *name,
                                             const xmlChar *publicId,
                                             const xmlChar *systemId,
                                             const xmlChar *notationName);

What to do when an unparsed entity declaration is parsed

ctx :
name :
publicId :
systemId :
notationName :

startDocument ()

void        startDocument                   (void *ctx);

called when the document start being processed.

ctx :

endDocument ()

void        endDocument                     (void *ctx);

called when the document end has been detected.

ctx :

attribute ()

void        attribute                       (void *ctx,
                                             const xmlChar *fullname,
                                             const xmlChar *value);

Handle an attribute that has been read by the parser. The default handling is to convert the attribute into an DOM subtree and past it in a new xmlAttr element added to the element.

ctx :
fullname :
value :

startElement ()

void        startElement                    (void *ctx,
                                             const xmlChar *fullname,
                                             const xmlChar **atts);

called when an opening tag has been processed.

ctx :
fullname :
atts :

endElement ()

void        endElement                      (void *ctx,
                                             const xmlChar *name);

called when the end of an element has been detected.

ctx :
name :

reference ()

void        reference                       (void *ctx,
                                             const xmlChar *name);

called when an entity reference is detected.

ctx :
name :

characters ()

void        characters                      (void *ctx,
                                             const xmlChar *ch,
                                             int len);

receiving some chars from the parser.

ctx :
ch :
len :

ignorableWhitespace ()

void        ignorableWhitespace             (void *ctx,
                                             const xmlChar *ch,
                                             int len);

receiving some ignorable whitespaces from the parser. UNUSED: by default the DOM building will use characters

ctx :
ch :
len :

processingInstruction ()

void        processingInstruction           (void *ctx,
                                             const xmlChar *target,
                                             const xmlChar *data);

A processing instruction has been parsed.

ctx :
target :
data :

globalNamespace ()

void        globalNamespace                 (void *ctx,
                                             const xmlChar *href,
                                             const xmlChar *prefix);

An old global namespace has been parsed.

ctx :
href :
prefix :

setNamespace ()

void        setNamespace                    (void *ctx,
                                             const xmlChar *name);

Set the current element namespace.

ctx :
name :

getNamespace ()

xmlNsPtr    getNamespace                    (void *ctx);

Get the current element namespace.

ctx :
Returns :

checkNamespace ()

int         checkNamespace                  (void *ctx,
                                             xmlChar *nameSpace);

Check that the current element namespace is the same as the one read upon parsing.

ctx :
nameSpace :
Returns :

namespaceDecl ()

void        namespaceDecl                   (void *ctx,
                                             const xmlChar *href,
                                             const xmlChar *prefix);

A namespace has been parsed.

ctx :
href :
prefix :

comment ()

void        comment                         (void *ctx,
                                             const xmlChar *value);

A comment has been parsed.

ctx :
value :

cdataBlock ()

void        cdataBlock                      (void *ctx,
                                             const xmlChar *value,
                                             int len);

called when a pcdata block has been parsed

ctx :
value :
len :

initxmlDefaultSAXHandler ()

void        initxmlDefaultSAXHandler        (xmlSAXHandler *hdlr,
                                             int warning);

Initialize the default XML SAX handler

hdlr :
warning :

inithtmlDefaultSAXHandler ()

void        inithtmlDefaultSAXHandler       (xmlSAXHandler *hdlr);

Initialize the default HTML SAX handler

hdlr :

initdocbDefaultSAXHandler ()

void        initdocbDefaultSAXHandler       (xmlSAXHandler *hdlr);

Initialize the default DocBook SAX handler

hdlr :

xmlDefaultSAXHandlerInit ()

void        xmlDefaultSAXHandlerInit        (void);

Initialize the default SAX handler


htmlDefaultSAXHandlerInit ()

void        htmlDefaultSAXHandlerInit       (void);

Initialize the default SAX handler


docbDefaultSAXHandlerInit ()

void        docbDefaultSAXHandlerInit       (void);

Initialize the default SAX handler