libxml2
Data Fields
_xmlSAXHandler Struct Reference

Callbacks for SAX parser. More...

Data Fields

internalSubsetSAXFunc internalSubset
 Called after the start of the document type declaration was parsed. More...
 
isStandaloneSAXFunc isStandalone
 Standalone status. More...
 
hasInternalSubsetSAXFunc hasInternalSubset
 Internal subset availability. More...
 
hasExternalSubsetSAXFunc hasExternalSubset
 External subset availability. More...
 
resolveEntitySAXFunc resolveEntity
 Only called when loading external DTDs. More...
 
getEntitySAXFunc getEntity
 Called when looking up general entities. More...
 
entityDeclSAXFunc entityDecl
 Called after an entity declaration was parsed. More...
 
notationDeclSAXFunc notationDecl
 Called after a notation declaration was parsed. More...
 
attributeDeclSAXFunc attributeDecl
 Called after an attribute declaration was parsed. More...
 
elementDeclSAXFunc elementDecl
 Called after an element declaration was parsed. More...
 
unparsedEntityDeclSAXFunc unparsedEntityDecl
 Called after an unparsed entity declaration was parsed. More...
 
setDocumentLocatorSAXFunc setDocumentLocator
 This callback receives the "document locator" at startup, which is always the global xmlDefaultSAXLocator. More...
 
startDocumentSAXFunc startDocument
 Called after the XML declaration was parsed. More...
 
endDocumentSAXFunc endDocument
 Called at the end of the document.
 
startElementSAXFunc startElement
 Legacy start tag handler. More...
 
endElementSAXFunc endElement
 See _xmlSAXHandler.startElement.
 
referenceSAXFunc reference
 Called after an entity reference was parsed.
 
charactersSAXFunc characters
 Called after a character data was parsed.
 
ignorableWhitespaceSAXFunc ignorableWhitespace
 Called after "ignorable" whitespace was parsed. More...
 
processingInstructionSAXFunc processingInstruction
 Called after a processing instruction was parsed.
 
commentSAXFunc comment
 Called after a comment was parsed.
 
warningSAXFunc warning
 Callback for warning messages.
 
errorSAXFunc error
 Callback for error messages.
 
fatalErrorSAXFunc fatalError
 Unused, all errors go to error.
 
getParameterEntitySAXFunc getParameterEntity
 Called when looking up parameter entities. More...
 
cdataBlockSAXFunc cdataBlock
 Called after a CDATA section was parsed.
 
externalSubsetSAXFunc externalSubset
 Called to parse the external subset. More...
 
unsigned int initialized
 Legacy magic value. More...
 
void * _private
 Application data.
 
startElementNsSAX2Func startElementNs
 Called after a start tag was parsed.
 
endElementNsSAX2Func endElementNs
 Called after an end tag was parsed.
 
xmlStructuredErrorFunc serror
 Structured error handler. More...
 

Detailed Description

Callbacks for SAX parser.

For DTD-related handlers, it's recommended to either use the original libxml2 handler or set them to NULL if DTDs can be ignored.

Field Documentation

attributeDeclSAXFunc attributeDecl

Called after an attribute declaration was parsed.

Should typically not be modified.

elementDeclSAXFunc elementDecl

Called after an element declaration was parsed.

Should typically not be modified.

entityDeclSAXFunc entityDecl

Called after an entity declaration was parsed.

Should typically not be modified.

externalSubsetSAXFunc externalSubset

Called to parse the external subset.

Should typically not be modified.

getEntitySAXFunc getEntity

Called when looking up general entities.

Should typically not be modified.

getParameterEntitySAXFunc getParameterEntity

Called when looking up parameter entities.

Should typically not be modified.

hasExternalSubsetSAXFunc hasExternalSubset

External subset availability.

Not invoked by the parser. Not supposed to be changed by applications.

hasInternalSubsetSAXFunc hasInternalSubset

Internal subset availability.

Not invoked by the parser. Not supposed to be changed by applications.

ignorableWhitespaceSAXFunc ignorableWhitespace

Called after "ignorable" whitespace was parsed.

ignorableWhitespace should always be set to the same value as characters. Otherwise, the parser will try to detect whitespace which is unreliable.

unsigned int initialized

Legacy magic value.

initialized should always be set to XML_SAX2_MAGIC to enable the modern SAX2 interface.

internalSubsetSAXFunc internalSubset

Called after the start of the document type declaration was parsed.

Should typically not be modified.

isStandaloneSAXFunc isStandalone

Standalone status.

Not invoked by the parser. Not supposed to be changed by applications.

notationDeclSAXFunc notationDecl

Called after a notation declaration was parsed.

Should typically not be modified.

resolveEntitySAXFunc resolveEntity

Only called when loading external DTDs.

Not called to load external entities.

Should typically not be modified.

Structured error handler.

Takes precedence over error or warning, but modern code should use xmlCtxtSetErrorHandler().

setDocumentLocatorSAXFunc setDocumentLocator

This callback receives the "document locator" at startup, which is always the global xmlDefaultSAXLocator.

Everything is available on the context, so this is useless in our case.

startDocumentSAXFunc startDocument

Called after the XML declaration was parsed.

Use xmlCtxtGetVersion(), xmlCtxtGetDeclaredEncoding() and xmlCtxtGetStandalone() to get data from the XML declaration.

startElementSAXFunc startElement

Legacy start tag handler.

startElement and endElement are only used by the legacy SAX1 interface and should not be used in new software. If you really have to enable SAX1, the preferred way is set the initialized member to 1 instead of XML_SAX2_MAGIC.

For backward compatibility, it's also possible to set the startElementNs and endElementNs handlers to NULL.

You can also set the XML_PARSE_SAX1 parser option, but versions older than 2.12.0 will probably crash if this option is provided together with custom SAX callbacks.

unparsedEntityDeclSAXFunc unparsedEntityDecl

Called after an unparsed entity declaration was parsed.

Should typically not be modified.


The documentation for this struct was generated from the following file: