Callbacks for SAX parser. More...
#include <parser.h>
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.
Called after an attribute declaration was parsed.
Should typically not be modified.
Called after an element declaration was parsed.
Should typically not be modified.
Called after an entity declaration was parsed.
Should typically not be modified.
Called to parse the external subset.
Should typically not be modified.
Called when looking up general entities.
Should typically not be modified.
Called when looking up parameter entities.
Should typically not be modified.
External subset availability.
Not invoked by the parser. Not supposed to be changed by applications.
Internal subset availability.
Not invoked by the parser. Not supposed to be changed by applications.
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.
Legacy magic value.
initialized should always be set to XML_SAX2_MAGIC to enable the modern SAX2 interface.
Called after the start of the document type declaration was parsed.
Should typically not be modified.
Standalone status.
Not invoked by the parser. Not supposed to be changed by applications.
Called after a notation declaration was parsed.
Should typically not be modified.
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().
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.
Called after the XML declaration was parsed.
Use xmlCtxtGetVersion(), xmlCtxtGetDeclaredEncoding() and xmlCtxtGetStandalone() to get data from the XML declaration.
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.
Called after an unparsed entity declaration was parsed.
Should typically not be modified.