#[repr(C)]pub struct _xmlSAXHandler {Show 32 fields
pub internalSubset: internalSubsetSAXFunc,
pub isStandalone: isStandaloneSAXFunc,
pub hasInternalSubset: hasInternalSubsetSAXFunc,
pub hasExternalSubset: hasExternalSubsetSAXFunc,
pub resolveEntity: resolveEntitySAXFunc,
pub getEntity: getEntitySAXFunc,
pub entityDecl: entityDeclSAXFunc,
pub notationDecl: notationDeclSAXFunc,
pub attributeDecl: attributeDeclSAXFunc,
pub elementDecl: elementDeclSAXFunc,
pub unparsedEntityDecl: unparsedEntityDeclSAXFunc,
pub setDocumentLocator: setDocumentLocatorSAXFunc,
pub startDocument: startDocumentSAXFunc,
pub endDocument: endDocumentSAXFunc,
pub startElement: startElementSAXFunc,
pub endElement: endElementSAXFunc,
pub reference: referenceSAXFunc,
pub characters: charactersSAXFunc,
pub ignorableWhitespace: ignorableWhitespaceSAXFunc,
pub processingInstruction: processingInstructionSAXFunc,
pub comment: commentSAXFunc,
pub warning: warningSAXFunc,
pub error: errorSAXFunc,
pub fatalError: fatalErrorSAXFunc,
pub getParameterEntity: getParameterEntitySAXFunc,
pub cdataBlock: cdataBlockSAXFunc,
pub externalSubset: externalSubsetSAXFunc,
pub initialized: c_uint,
pub _private: *mut c_void,
pub startElementNs: startElementNsSAX2Func,
pub endElementNs: endElementNsSAX2Func,
pub serror: xmlStructuredErrorFunc,
}Expand 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.
Fields§
§internalSubset: internalSubsetSAXFuncCalled after the start of the document type declaration was parsed.
Should typically not be modified.
isStandalone: isStandaloneSAXFuncStandalone status. Not invoked by the parser. Not supposed to be changed by applications.
hasInternalSubset: hasInternalSubsetSAXFuncInternal subset availability. Not invoked by the parser. Not supposed to be changed by applications.
hasExternalSubset: hasExternalSubsetSAXFuncExternal subset availability. Not invoked by the parser. Not supposed to be changed by applications.
resolveEntity: resolveEntitySAXFuncOnly called when loading external DTDs. Not called to load external entities.
Should typically not be modified.
getEntity: getEntitySAXFuncCalled when looking up general entities.
Should typically not be modified.
entityDecl: entityDeclSAXFuncCalled after an entity declaration was parsed.
Should typically not be modified.
notationDecl: notationDeclSAXFuncCalled after a notation declaration was parsed.
Should typically not be modified.
attributeDecl: attributeDeclSAXFuncCalled after an attribute declaration was parsed.
Should typically not be modified.
elementDecl: elementDeclSAXFuncCalled after an element declaration was parsed.
Should typically not be modified.
unparsedEntityDecl: unparsedEntityDeclSAXFuncCalled after an unparsed entity declaration was parsed.
Should typically not be modified.
setDocumentLocator: setDocumentLocatorSAXFuncThis 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.
startDocument: startDocumentSAXFuncCalled after the XML declaration was parsed.
Use xmlCtxtGetVersion(), xmlCtxtGetDeclaredEncoding() and xmlCtxtGetStandalone() to get data from the XML declaration.
endDocument: endDocumentSAXFuncCalled at the end of the document.
startElement: startElementSAXFuncLegacy 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.
endElement: endElementSAXFuncSee _xmlSAXHandler.startElement
reference: referenceSAXFuncCalled after an entity reference was parsed.
characters: charactersSAXFuncCalled after a character data was parsed.
ignorableWhitespace: ignorableWhitespaceSAXFuncCalled 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.
processingInstruction: processingInstructionSAXFuncCalled after a processing instruction was parsed.
comment: commentSAXFuncCalled after a comment was parsed.
warning: warningSAXFuncCallback for warning messages.
error: errorSAXFuncCallback for error messages.
fatalError: fatalErrorSAXFuncUnused, all errors go to error.
getParameterEntity: getParameterEntitySAXFuncCalled when looking up parameter entities.
Should typically not be modified.
cdataBlock: cdataBlockSAXFuncCalled after a CDATA section was parsed.
externalSubset: externalSubsetSAXFuncCalled to parse the external subset.
Should typically not be modified.
initialized: c_uintLegacy magic value
initialized should always be set to XML_SAX2_MAGIC to
enable the modern SAX2 interface.
_private: *mut c_voidApplication data
startElementNs: startElementNsSAX2FuncCalled after a start tag was parsed.
endElementNs: endElementNsSAX2FuncCalled after an end tag was parsed.
serror: xmlStructuredErrorFuncStructured error handler.
Takes precedence over error or warning, but modern code
should use xmlCtxtSetErrorHandler().
Trait Implementations§
Source§impl Clone for _xmlSAXHandler
impl Clone for _xmlSAXHandler
Source§fn clone(&self) -> _xmlSAXHandler
fn clone(&self) -> _xmlSAXHandler
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more