{
    "mode": "pydoc",
    "parameter": "drv_libxml2",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/pydoc/drv_libxml2/json",
    "generated": "2026-06-02T15:03:27Z",
    "sections": {
        "NAME": {
            "content": "drvlibxml2 - A SAX2 driver for libxml2, on top of it's XmlReader API\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "USAGE\n# put this file (drvlibxml2.py) in PYTHONPATH\nimport xml.sax\nreader = xml.sax.makeparser([\"drvlibxml2\"])\n# ...and the rest is standard python sax.\n\nCAVEATS\n- Lexical handlers are supported, except for start/endEntity\n(waiting for XmlReader.ResolveEntity) and start/endDTD\n- Error callbacks are not exactly synchronous, they tend\nto be invoked before the corresponding content callback,\nbecause the underlying reader interface parses\ndata by chunks of 512 bytes\n\nTODO\n- search for TODO\n- some ErrorHandler events (warning)\n- some ContentHandler events (setDocumentLocator, skippedEntity)\n- EntityResolver (using libxml2.?)\n- DTDHandler (if/when libxml2 exposes such node types)\n- DeclHandler (if/when libxml2 exposes such node types)\n- propertyxmlstring?\n- featurestringinterning?\n- Incremental parser\n- additional performance tuning:\n- one might cache callbacks to avoid some name lookups\n- one might implement a smarter way to pass attributes to startElement\n(some kind of lazy evaluation?)\n- there might be room for improvement in start/endPrefixMapping\n- other?\n",
            "subsections": []
        },
        "CLASSES": {
            "content": "xml.sax.xmlreader.Locator(builtins.object)\nLocator\nxml.sax.xmlreader.XMLReader(builtins.object)\nLibXml2Reader\n",
            "subsections": [
                {
                    "name": "class LibXml2Reader",
                    "content": "|  Method resolution order:\n|      LibXml2Reader\n|      xml.sax.xmlreader.XMLReader\n|      builtins.object\n|\n|  Methods defined here:\n|\n|  init(self)\n|      Initialize self.  See help(type(self)) for accurate signature.\n|\n|  getFeature(self, name)\n|      Looks up and returns the state of a SAX2 feature.\n|\n|  getProperty(self, name)\n|      Looks up and returns the value of a SAX2 property.\n|\n|  parse(self, source)\n|      Parse an XML document from a system identifier or an InputSource.\n|\n|  setDTDHandler(self, handler)\n|      Register an object to receive basic DTD-related events.\n|\n|  setEntityResolver(self, resolver)\n|      Register an object to resolve external entities.\n|\n|  setFeature(self, name, state)\n|      Sets the state of a SAX2 feature.\n|\n|  setProperty(self, name, value)\n|      Sets the value of a SAX2 property.\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from xml.sax.xmlreader.XMLReader:\n|\n|  getContentHandler(self)\n|      Returns the current ContentHandler.\n|\n|  getDTDHandler(self)\n|      Returns the current DTD handler.\n|\n|  getEntityResolver(self)\n|      Returns the current EntityResolver.\n|\n|  getErrorHandler(self)\n|      Returns the current ErrorHandler.\n|\n|  setContentHandler(self, handler)\n|      Registers a new object to receive document content events.\n|\n|  setErrorHandler(self, handler)\n|      Register an object to receive error-message events.\n|\n|  setLocale(self, locale)\n|      Allow an application to set the locale for errors and warnings.\n|\n|      SAX parsers are not required to provide localization for errors\n|      and warnings; if they cannot support the requested locale,\n|      however, they must raise a SAX exception. Applications may\n|      request a locale change in the middle of a parse.\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors inherited from xml.sax.xmlreader.XMLReader:\n|\n|  dict\n|      dictionary for instance variables (if defined)\n|\n|  weakref\n|      list of weak references to the object (if defined)\n"
                },
                {
                    "name": "class Locator",
                    "content": "|  Locator(locator)\n|\n|  SAX Locator adapter for libxml2.xmlTextReaderLocator\n|\n|  Method resolution order:\n|      Locator\n|      xml.sax.xmlreader.Locator\n|      builtins.object\n|\n|  Methods defined here:\n|\n|  init(self, locator)\n|      Initialize self.  See help(type(self)) for accurate signature.\n|\n|  getColumnNumber(self)\n|      Return the column number where the current event ends.\n|\n|  getLineNumber(self)\n|      Return the line number where the current event ends.\n|\n|  getPublicId(self)\n|      Return the public identifier for the current event.\n|\n|  getSystemId(self)\n|      Return the system identifier for the current event.\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors inherited from xml.sax.xmlreader.Locator:\n|\n|  dict\n|      dictionary for instance variables (if defined)\n|\n|  weakref\n|      list of weak references to the object (if defined)\n"
                }
            ]
        },
        "FUNCTIONS": {
            "content": "",
            "subsections": [
                {
                    "name": "create_parser",
                    "content": ""
                }
            ]
        },
        "DATA": {
            "content": "featureexternalges = 'http://xml.org/sax/features/external-general-e...\nfeatureexternalpes = 'http://xml.org/sax/features/external-parameter...\nfeaturenamespaceprefixes = 'http://xml.org/sax/features/namespace-pr...\nfeaturenamespaces = 'http://xml.org/sax/features/namespaces'\nfeaturestringinterning = 'http://xml.org/sax/features/string-interni...\nfeaturevalidation = 'http://xml.org/sax/features/validation'\npropertydeclarationhandler = 'http://xml.org/sax/properties/declarat...\npropertydomnode = 'http://xml.org/sax/properties/dom-node'\npropertylexicalhandler = 'http://xml.org/sax/properties/lexical-hand...\npropertyxmlstring = 'http://xml.org/sax/properties/xml-string'\n",
            "subsections": []
        },
        "VERSION": {
            "content": "0.3\n",
            "subsections": []
        },
        "AUTHOR": {
            "content": "Stéphane Bidoul <sbi@skynet.be>\n",
            "subsections": []
        },
        "FILE": {
            "content": "/usr/lib/python3/dist-packages/drvlibxml2.py\n\n",
            "subsections": []
        }
    },
    "summary": "drvlibxml2 - A SAX2 driver for libxml2, on top of it's XmlReader API",
    "flags": [],
    "examples": [],
    "see_also": []
}