Markdown Format | JSON API | MCP Server Tool
Help on module drv_libxml2: NAME drv_libxml2 - A SAX2 driver for libxml2, on top of it's XmlReader API DESCRIPTION USAGE # put this file (drv_libxml2.py) in PYTHONPATH import xml.sax reader = xml.sax.make_parser(["drv_libxml2"]) # ...and the rest is standard python sax. CAVEATS - Lexical handlers are supported, except for start/endEntity (waiting for XmlReader.ResolveEntity) and start/endDTD - Error callbacks are not exactly synchronous, they tend to be invoked before the corresponding content callback, because the underlying reader interface parses data by chunks of 512 bytes TODO - search for TODO - some ErrorHandler events (warning) - some ContentHandler events (setDocumentLocator, skippedEntity) - EntityResolver (using libxml2.?) - DTDHandler (if/when libxml2 exposes such node types) - DeclHandler (if/when libxml2 exposes such node types) - property_xml_string? - feature_string_interning? - Incremental parser - additional performance tuning: - one might cache callbacks to avoid some name lookups - one might implement a smarter way to pass attributes to startElement (some kind of lazy evaluation?) - there might be room for improvement in start/endPrefixMapping - other? CLASSES xml.sax.xmlreader.Locator(builtins.object) Locator xml.sax.xmlreader.XMLReader(builtins.object) LibXml2Reader class LibXml2Reader(xml.sax.xmlreader.XMLReader) | Method resolution order: | LibXml2Reader | xml.sax.xmlreader.XMLReader | builtins.object | | Methods defined here: | | __init__(self) | Initialize self. See help(type(self)) for accurate signature. | | getFeature(self, name) | Looks up and returns the state of a SAX2 feature. | | getProperty(self, name) | Looks up and returns the value of a SAX2 property. | | parse(self, source) | Parse an XML document from a system identifier or an InputSource. | | setDTDHandler(self, handler) | Register an object to receive basic DTD-related events. | | setEntityResolver(self, resolver) | Register an object to resolve external entities. | | setFeature(self, name, state) | Sets the state of a SAX2 feature. | | setProperty(self, name, value) | Sets the value of a SAX2 property. | | ---------------------------------------------------------------------- | Methods inherited from xml.sax.xmlreader.XMLReader: | | getContentHandler(self) | Returns the current ContentHandler. | | getDTDHandler(self) | Returns the current DTD handler. | | getEntityResolver(self) | Returns the current EntityResolver. | | getErrorHandler(self) | Returns the current ErrorHandler. | | setContentHandler(self, handler) | Registers a new object to receive document content events. | | setErrorHandler(self, handler) | Register an object to receive error-message events. | | setLocale(self, locale) | Allow an application to set the locale for errors and warnings. | | SAX parsers are not required to provide localization for errors | and warnings; if they cannot support the requested locale, | however, they must raise a SAX exception. Applications may | request a locale change in the middle of a parse. | | ---------------------------------------------------------------------- | Data descriptors inherited from xml.sax.xmlreader.XMLReader: | | __dict__ | dictionary for instance variables (if defined) | | __weakref__ | list of weak references to the object (if defined) class Locator(xml.sax.xmlreader.Locator) | Locator(locator) | | SAX Locator adapter for libxml2.xmlTextReaderLocator | | Method resolution order: | Locator | xml.sax.xmlreader.Locator | builtins.object | | Methods defined here: | | __init__(self, locator) | Initialize self. See help(type(self)) for accurate signature. | | getColumnNumber(self) | Return the column number where the current event ends. | | getLineNumber(self) | Return the line number where the current event ends. | | getPublicId(self) | Return the public identifier for the current event. | | getSystemId(self) | Return the system identifier for the current event. | | ---------------------------------------------------------------------- | Data descriptors inherited from xml.sax.xmlreader.Locator: | | __dict__ | dictionary for instance variables (if defined) | | __weakref__ | list of weak references to the object (if defined) FUNCTIONS create_parser() DATA feature_external_ges = 'http://xml.org/sax/features/external-general-e... feature_external_pes = 'http://xml.org/sax/features/external-parameter... feature_namespace_prefixes = 'http://xml.org/sax/features/namespace-pr... feature_namespaces = 'http://xml.org/sax/features/namespaces' feature_string_interning = 'http://xml.org/sax/features/string-interni... feature_validation = 'http://xml.org/sax/features/validation' property_declaration_handler = 'http://xml.org/sax/properties/declarat... property_dom_node = 'http://xml.org/sax/properties/dom-node' property_lexical_handler = 'http://xml.org/sax/properties/lexical-hand... property_xml_string = 'http://xml.org/sax/properties/xml-string' VERSION 0.3 AUTHOR Stéphane Bidoul <sbi AT skynet.be> FILE /usr/lib/python3/dist-packages/drv_libxml2.py
Generated by phpMan Author: Che Dong Under GNU General Public License
2026-06-02 05:14 @216.73.216.198 CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)