Skip to main content

xmlSAXHandler

Type Alias xmlSAXHandler 

Source
pub type xmlSAXHandler = _xmlSAXHandler;
Expand description

SAX handler

Aliased Type§

#[repr(C)]
pub struct xmlSAXHandler {
Show 32 fields pub internalSubset: Option<unsafe extern "C" fn(*mut c_void, *const u8, *const u8, *const u8)>, pub isStandalone: Option<unsafe extern "C" fn(*mut c_void) -> i32>, pub hasInternalSubset: Option<unsafe extern "C" fn(*mut c_void) -> i32>, pub hasExternalSubset: Option<unsafe extern "C" fn(*mut c_void) -> i32>, pub resolveEntity: Option<unsafe extern "C" fn(*mut c_void, *const u8, *const u8) -> *mut _xmlParserInput>, pub getEntity: Option<unsafe extern "C" fn(*mut c_void, *const u8) -> *mut _xmlEntity>, pub entityDecl: Option<unsafe extern "C" fn(*mut c_void, *const u8, i32, *const u8, *const u8, *mut u8)>, pub notationDecl: Option<unsafe extern "C" fn(*mut c_void, *const u8, *const u8, *const u8)>, pub attributeDecl: Option<unsafe extern "C" fn(*mut c_void, *const u8, *const u8, i32, i32, *const u8, *mut _xmlEnumeration)>, pub elementDecl: Option<unsafe extern "C" fn(*mut c_void, *const u8, i32, *mut _xmlElementContent)>, pub unparsedEntityDecl: Option<unsafe extern "C" fn(*mut c_void, *const u8, *const u8, *const u8, *const u8)>, pub setDocumentLocator: Option<unsafe extern "C" fn(*mut c_void, *mut _xmlSAXLocator)>, pub startDocument: Option<unsafe extern "C" fn(*mut c_void)>, pub endDocument: Option<unsafe extern "C" fn(*mut c_void)>, pub startElement: Option<unsafe extern "C" fn(*mut c_void, *const u8, *mut *const u8)>, pub endElement: Option<unsafe extern "C" fn(*mut c_void, *const u8)>, pub reference: Option<unsafe extern "C" fn(*mut c_void, *const u8)>, pub characters: Option<unsafe extern "C" fn(*mut c_void, *const u8, i32)>, pub ignorableWhitespace: Option<unsafe extern "C" fn(*mut c_void, *const u8, i32)>, pub processingInstruction: Option<unsafe extern "C" fn(*mut c_void, *const u8, *const u8)>, pub comment: Option<unsafe extern "C" fn(*mut c_void, *const u8)>, pub warning: Option<unsafe extern "C" fn(*mut c_void, *const i8, ...)>, pub error: Option<unsafe extern "C" fn(*mut c_void, *const i8, ...)>, pub fatalError: Option<unsafe extern "C" fn(*mut c_void, *const i8, ...)>, pub getParameterEntity: Option<unsafe extern "C" fn(*mut c_void, *const u8) -> *mut _xmlEntity>, pub cdataBlock: Option<unsafe extern "C" fn(*mut c_void, *const u8, i32)>, pub externalSubset: Option<unsafe extern "C" fn(*mut c_void, *const u8, *const u8, *const u8)>, pub initialized: u32, pub _private: *mut c_void, pub startElementNs: Option<unsafe extern "C" fn(*mut c_void, *const u8, *const u8, *const u8, i32, *mut *const u8, i32, i32, *mut *const u8)>, pub endElementNs: Option<unsafe extern "C" fn(*mut c_void, *const u8, *const u8, *const u8)>, pub serror: Option<unsafe extern "C" fn(*mut c_void, *const _xmlError)>,
}

Fields§

§internalSubset: Option<unsafe extern "C" fn(*mut c_void, *const u8, *const u8, *const u8)>

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

Should typically not be modified.

§isStandalone: Option<unsafe extern "C" fn(*mut c_void) -> i32>

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

§hasInternalSubset: Option<unsafe extern "C" fn(*mut c_void) -> i32>

Internal subset availability. Not invoked by the parser. Not supposed to be changed by applications.

§hasExternalSubset: Option<unsafe extern "C" fn(*mut c_void) -> i32>

External subset availability. Not invoked by the parser. Not supposed to be changed by applications.

§resolveEntity: Option<unsafe extern "C" fn(*mut c_void, *const u8, *const u8) -> *mut _xmlParserInput>

Only called when loading external DTDs. Not called to load external entities.

Should typically not be modified.

§getEntity: Option<unsafe extern "C" fn(*mut c_void, *const u8) -> *mut _xmlEntity>

Called when looking up general entities.

Should typically not be modified.

§entityDecl: Option<unsafe extern "C" fn(*mut c_void, *const u8, i32, *const u8, *const u8, *mut u8)>

Called after an entity declaration was parsed.

Should typically not be modified.

§notationDecl: Option<unsafe extern "C" fn(*mut c_void, *const u8, *const u8, *const u8)>

Called after a notation declaration was parsed.

Should typically not be modified.

§attributeDecl: Option<unsafe extern "C" fn(*mut c_void, *const u8, *const u8, i32, i32, *const u8, *mut _xmlEnumeration)>

Called after an attribute declaration was parsed.

Should typically not be modified.

§elementDecl: Option<unsafe extern "C" fn(*mut c_void, *const u8, i32, *mut _xmlElementContent)>

Called after an element declaration was parsed.

Should typically not be modified.

§unparsedEntityDecl: Option<unsafe extern "C" fn(*mut c_void, *const u8, *const u8, *const u8, *const u8)>

Called after an unparsed entity declaration was parsed.

Should typically not be modified.

§setDocumentLocator: Option<unsafe extern "C" fn(*mut c_void, *mut _xmlSAXLocator)>

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.

§startDocument: Option<unsafe extern "C" fn(*mut c_void)>

Called after the XML declaration was parsed.

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

§endDocument: Option<unsafe extern "C" fn(*mut c_void)>

Called at the end of the document.

§startElement: Option<unsafe extern "C" fn(*mut c_void, *const u8, *mut *const u8)>

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.

§endElement: Option<unsafe extern "C" fn(*mut c_void, *const u8)>

See _xmlSAXHandler.startElement

§reference: Option<unsafe extern "C" fn(*mut c_void, *const u8)>

Called after an entity reference was parsed.

§characters: Option<unsafe extern "C" fn(*mut c_void, *const u8, i32)>

Called after a character data was parsed.

§ignorableWhitespace: Option<unsafe extern "C" fn(*mut c_void, *const u8, i32)>

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.

§processingInstruction: Option<unsafe extern "C" fn(*mut c_void, *const u8, *const u8)>

Called after a processing instruction was parsed.

§comment: Option<unsafe extern "C" fn(*mut c_void, *const u8)>

Called after a comment was parsed.

§warning: Option<unsafe extern "C" fn(*mut c_void, *const i8, ...)>

Callback for warning messages.

§error: Option<unsafe extern "C" fn(*mut c_void, *const i8, ...)>

Callback for error messages.

§fatalError: Option<unsafe extern "C" fn(*mut c_void, *const i8, ...)>

Unused, all errors go to error.

§getParameterEntity: Option<unsafe extern "C" fn(*mut c_void, *const u8) -> *mut _xmlEntity>

Called when looking up parameter entities.

Should typically not be modified.

§cdataBlock: Option<unsafe extern "C" fn(*mut c_void, *const u8, i32)>

Called after a CDATA section was parsed.

§externalSubset: Option<unsafe extern "C" fn(*mut c_void, *const u8, *const u8, *const u8)>

Called to parse the external subset.

Should typically not be modified.

§initialized: u32

Legacy magic value

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

§_private: *mut c_void

Application data

§startElementNs: Option<unsafe extern "C" fn(*mut c_void, *const u8, *const u8, *const u8, i32, *mut *const u8, i32, i32, *mut *const u8)>

Called after a start tag was parsed.

§endElementNs: Option<unsafe extern "C" fn(*mut c_void, *const u8, *const u8, *const u8)>

Called after an end tag was parsed.

§serror: Option<unsafe extern "C" fn(*mut c_void, *const _xmlError)>

Structured error handler.

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