{
    "content": [
        {
            "type": "text",
            "text": "# drv_libxml2 (pydoc)\n\n**Summary:** drvlibxml2 - A SAX2 driver for libxml2, on top of it's XmlReader API\n\n## Section Outline\n\n- **NAME** (2 lines)\n- **DESCRIPTION** (31 lines)\n- **CLASSES** (5 lines) — 2 subsections\n  - class LibXml2Reader (69 lines)\n  - class Locator (35 lines)\n- **FUNCTIONS** (1 lines) — 1 subsections\n  - create_parser (1 lines)\n- **DATA** (11 lines)\n- **VERSION** (2 lines)\n- **AUTHOR** (2 lines)\n- **FILE** (3 lines)\n\n## Full Content\n\n### NAME\n\ndrvlibxml2 - A SAX2 driver for libxml2, on top of it's XmlReader API\n\n### DESCRIPTION\n\nUSAGE\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\n### CLASSES\n\nxml.sax.xmlreader.Locator(builtins.object)\nLocator\nxml.sax.xmlreader.XMLReader(builtins.object)\nLibXml2Reader\n\n#### class LibXml2Reader\n\n|  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\n#### class Locator\n\n|  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\n### FUNCTIONS\n\n#### create_parser\n\n### DATA\n\nfeatureexternalges = '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\n### VERSION\n\n0.3\n\n### AUTHOR\n\nStéphane Bidoul <sbi@skynet.be>\n\n### FILE\n\n/usr/lib/python3/dist-packages/drvlibxml2.py\n\n"
        }
    ],
    "structuredContent": {
        "command": "drv_libxml2",
        "section": "",
        "mode": "pydoc",
        "summary": "drvlibxml2 - A SAX2 driver for libxml2, on top of it's XmlReader API",
        "synopsis": null,
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 31,
                "subsections": []
            },
            {
                "name": "CLASSES",
                "lines": 5,
                "subsections": [
                    {
                        "name": "class LibXml2Reader",
                        "lines": 69
                    },
                    {
                        "name": "class Locator",
                        "lines": 35
                    }
                ]
            },
            {
                "name": "FUNCTIONS",
                "lines": 1,
                "subsections": [
                    {
                        "name": "create_parser",
                        "lines": 1
                    }
                ]
            },
            {
                "name": "DATA",
                "lines": 11,
                "subsections": []
            },
            {
                "name": "VERSION",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "AUTHOR",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "FILE",
                "lines": 3,
                "subsections": []
            }
        ]
    }
}