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        (xmlSAXHandlerV1 *hdlr,
                                             int warning);
void        inithtmlDefaultSAXHandler       (xmlSAXHandlerV1 *hdlr);
void        initdocbDefaultSAXHandler       (xmlSAXHandlerV1 *hdlr);

Description

Details

getPublicId ()

const xmlChar* getPublicId                  (void *ctx);

Warning

getPublicId is deprecated and should not be used in newly-written code. use xmlSAX2GetPublicId()

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

ctx: the user data (XML parser context)
Returns :a xmlChar *

getSystemId ()

const xmlChar* getSystemId                  (void *ctx);

Warning

getSystemId is deprecated and should not be used in newly-written code. use xmlSAX2GetSystemId()

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

ctx: the user data (XML parser context)
Returns :a xmlChar *

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

ctx: the user data (XML parser context)
loc: A SAX Locator

getLineNumber ()

int         getLineNumber                   (void *ctx);

Warning

getLineNumber is deprecated and should not be used in newly-written code. use xmlSAX2GetLineNumber()

Provide the line number of the current parsing point. Returns

ctx: the user data (XML parser context)
Returns :an int

getColumnNumber ()

int         getColumnNumber                 (void *ctx);

Warning

getColumnNumber is deprecated and should not be used in newly-written code. use xmlSAX2GetColumnNumber()

Provide the column number of the current parsing point. Returns

ctx: the user data (XML parser context)
Returns :an int

isStandalone ()

int         isStandalone                    (void *ctx);

Warning

isStandalone is deprecated and should not be used in newly-written code. use xmlSAX2IsStandalone()

Is this document tagged standalone ? Returns

ctx: the user data (XML parser context)
Returns :1 if true

hasInternalSubset ()

int         hasInternalSubset               (void *ctx);

Warning

hasInternalSubset is deprecated and should not be used in newly-written code. use xmlSAX2HasInternalSubset()

Does this document has an internal subset Returns

ctx: the user data (XML parser context)
Returns :1 if true

hasExternalSubset ()

int         hasExternalSubset               (void *ctx);

Warning

hasExternalSubset is deprecated and should not be used in newly-written code. use xmlSAX2HasExternalSubset()

Does this document has an external subset Returns

ctx: the user data (XML parser context)
Returns :1 if true

internalSubset ()

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

Warning

internalSubset is deprecated and should not be used in newly-written code. use xmlSAX2InternalSubset()

Callback on internal subset declaration.

ctx: the user data (XML parser context)
name: the root element name
ExternalID: the external ID
SystemID: the SYSTEM ID (e.g. filename or URL)

externalSubset ()

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

Warning

externalSubset is deprecated and should not be used in newly-written code. use xmlSAX2ExternalSubset()

Callback on external subset declaration.

ctx: the user data (XML parser context)
name: the root element name
ExternalID: the external ID
SystemID: the SYSTEM ID (e.g. filename or URL)

getEntity ()

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

Warning

getEntity is deprecated and should not be used in newly-written code. use xmlSAX2GetEntity()

Get an entity by name Returns

ctx: the user data (XML parser context)
name: The entity name
Returns :the xmlEntityPtr if found.

getParameterEntity ()

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

Warning

getParameterEntity is deprecated and should not be used in newly-written code. use xmlSAX2GetParameterEntity()

Get a parameter entity by name Returns

ctx: the user data (XML parser context)
name: The entity name
Returns :the xmlEntityPtr if found.

resolveEntity ()

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

Warning

resolveEntity is deprecated and should not be used in newly-written code. use xmlSAX2ResolveEntity()

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 Returns

ctx: the user data (XML parser context)
publicId: The public ID of the entity
systemId: The system ID of the entity
Returns :the xmlParserInputPtr if inlined or NULL for DOM behaviour.

entityDecl ()

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

Warning

entityDecl is deprecated and should not be used in newly-written code. use xmlSAX2EntityDecl()

An entity definition has been parsed

ctx: the user data (XML parser context)
name: the entity name
type: the entity type
publicId: The public ID of the entity
systemId: The system ID of the entity
content: the entity value (without processing).

attributeDecl ()

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

Warning

attributeDecl is deprecated and should not be used in newly-written code. use xmlSAX2AttributeDecl()

An attribute definition has been parsed

ctx: the user data (XML parser context)
elem: the name of the element
fullname: the attribute name
type: the attribute type
def: the type of default value
defaultValue: the attribute default value
tree: the tree of enumerated value set

elementDecl ()

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

Warning

elementDecl is deprecated and should not be used in newly-written code. use xmlSAX2ElementDecl()

An element definition has been parsed

ctx: the user data (XML parser context)
name: the element name
type: the element type
content: the element value tree

notationDecl ()

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

Warning

notationDecl is deprecated and should not be used in newly-written code. use xmlSAX2NotationDecl()

What to do when a notation declaration has been parsed.

ctx: the user data (XML parser context)
name: The name of the notation
publicId: The public ID of the entity
systemId: The system ID of the entity

unparsedEntityDecl ()

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

Warning

unparsedEntityDecl is deprecated and should not be used in newly-written code. use xmlSAX2UnparsedEntityDecl()

What to do when an unparsed entity declaration is parsed

ctx: the user data (XML parser context)
name: The name of the entity
publicId: The public ID of the entity
systemId: The system ID of the entity
notationName: the name of the notation

startDocument ()

void        startDocument                   (void *ctx);

Warning

startDocument is deprecated and should not be used in newly-written code. use xmlSAX2StartDocument()

called when the document start being processed.

ctx: the user data (XML parser context)

endDocument ()

void        endDocument                     (void *ctx);

Warning

endDocument is deprecated and should not be used in newly-written code. use xmlSAX2EndDocument()

called when the document end has been detected.

ctx: the user data (XML parser context)

attribute ()

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

Warning

attribute is deprecated and should not be used in newly-written code. use xmlSAX2Attribute()

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: the user data (XML parser context)
fullname: The attribute name, including namespace prefix
value: The attribute value

startElement ()

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

Warning

startElement is deprecated and should not be used in newly-written code. use xmlSAX2StartElement()

called when an opening tag has been processed.

ctx: the user data (XML parser context)
fullname: The element name, including namespace prefix
atts: An array of name/value attributes pairs, NULL terminated

endElement ()

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

Warning

endElement is deprecated and should not be used in newly-written code. use xmlSAX2EndElement()

called when the end of an element has been detected.

ctx: the user data (XML parser context)
name: The element name

reference ()

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

Warning

reference is deprecated and should not be used in newly-written code. use xmlSAX2Reference()

called when an entity reference is detected.

ctx: the user data (XML parser context)
name: The entity name

characters ()

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

Warning

characters is deprecated and should not be used in newly-written code. use xmlSAX2Characters()

receiving some chars from the parser.

ctx: the user data (XML parser context)
ch: a xmlChar string
len: the number of xmlChar

ignorableWhitespace ()

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

Warning

ignorableWhitespace is deprecated and should not be used in newly-written code. use xmlSAX2IgnorableWhitespace()

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

ctx: the user data (XML parser context)
ch: a xmlChar string
len: the number of xmlChar

processingInstruction ()

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

Warning

processingInstruction is deprecated and should not be used in newly-written code. use xmlSAX2ProcessingInstruction()

A processing instruction has been parsed.

ctx: the user data (XML parser context)
target: the target name
data: the PI data's

globalNamespace ()

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

An old global namespace has been parsed. DEPRECATED

ctx: the user data (XML parser context)
href: the namespace associated URN
prefix: the namespace prefix

setNamespace ()

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

Set the current element namespace. DEPRECATED

ctx: the user data (XML parser context)
name: the namespace prefix

getNamespace ()

xmlNsPtr    getNamespace                    (void *ctx);

Get the current element namespace. DEPRECATED

ctx: the user data (XML parser context)
Returns :the xmlNsPtr or NULL if none

checkNamespace ()

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

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

ctx: the user data (XML parser context)
nameSpace: the namespace to check against
Returns :1 if true 0 otherwise

namespaceDecl ()

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

A namespace has been parsed. DEPRECATED

ctx: the user data (XML parser context)
href: the namespace associated URN
prefix: the namespace prefix

comment ()

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

Warning

comment is deprecated and should not be used in newly-written code. use xmlSAX2Comment()

A comment has been parsed.

ctx: the user data (XML parser context)
value: the comment content

cdataBlock ()

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

Warning

cdataBlock is deprecated and should not be used in newly-written code. use xmlSAX2CDataBlock()

called when a pcdata block has been parsed

ctx: the user data (XML parser context)
value: The pcdata content
len: the block length

initxmlDefaultSAXHandler ()

void        initxmlDefaultSAXHandler        (xmlSAXHandlerV1 *hdlr,
                                             int warning);

Warning

initxmlDefaultSAXHandler is deprecated and should not be used in newly-written code. use xmlSAX2InitDefaultSAXHandler() for the new SAX2 blocks

Initialize the default XML SAX version 1 handler

hdlr: the SAX handler
warning: flag if non-zero sets the handler warning procedure

inithtmlDefaultSAXHandler ()

void        inithtmlDefaultSAXHandler       (xmlSAXHandlerV1 *hdlr);

Warning

inithtmlDefaultSAXHandler is deprecated and should not be used in newly-written code. use xmlSAX2InitHtmlDefaultSAXHandler() for the new SAX2 blocks

Initialize the default HTML SAX version 1 handler

hdlr: the SAX handler

initdocbDefaultSAXHandler ()

void        initdocbDefaultSAXHandler       (xmlSAXHandlerV1 *hdlr);

Warning

initdocbDefaultSAXHandler is deprecated and should not be used in newly-written code. use xmlSAX2InitDocbDefaultSAXHandler() for the new SAX2 blocks

Initialize the default DocBook SAX version 1 handler

hdlr: the SAX handler