o […d:ã@sdZddlmZddlmZmZddlmZmZm Z m Z m Z eƒfdd„Z eƒfdd„Z d gZd Zer7d d lZd d lZd d lZejjsPd ejvrPejd  d ¡Z[dZejd d…dkrkej e¡rkej e¡ d ¡Zddd„Zejd d…dkr€dd„Z[d Sdd„Z[d S)aÛSimple API for XML (SAX) implementation for Python. This module provides an implementation of the SAX 2 interface; information about the Java version of the interface can be found at http://www.megginson.com/SAX/. The Python version of the interface is documented at <...>. This package contains the following modules: handler -- Base classes and constants which define the SAX 2 API for the 'client-side' of SAX for Python. saxutils -- Implementation of the convenience classes commonly used to work with SAX. xmlreader -- Base classes and constants which define the SAX 2 API for the parsers used with SAX for Python. expatreader -- Driver that allows use of the Expat parser with SAX. é)Ú InputSource)ÚContentHandlerÚ ErrorHandler)Ú SAXExceptionÚSAXNotRecognizedExceptionÚSAXParseExceptionÚSAXNotSupportedExceptionÚSAXReaderNotAvailablecCs(tƒ}| |¡| |¡| |¡dS)N)Ú make_parserÚsetContentHandlerÚsetErrorHandlerÚparse)ÚsourceÚhandlerÚ errorHandlerÚparser©rú'/usr/lib/python3.10/xml/sax/__init__.pyr s  r cCspddl}|dur tƒ}tƒ}| |¡| |¡tƒ}t|tƒr)| |  |¡¡n|  |  |¡¡|  |¡dS)Né) Úiorr r r rÚ isinstanceÚstrÚsetCharacterStreamÚStringIOÚ setByteStreamÚBytesIOr )ÚstringrrrrÚinpsrcrrrÚ parseString#s   rzxml.sax.expatreaderrNÚ PY_SAX_PARSERú,zpython.xml.sax.parseréÚjavarc Cs`t|ƒtD]$}zt|ƒWSty"ddl}||jvr ‚Yqty*Yqwtddƒ‚)a3Creates and returns a SAX parser. Creates the first parser it is able to instantiate of the ones given in the iterable created by chaining parser_list and default_parser_list. The iterables must contain the names of Python modules containing both a SAX parser and a create_parser function.rNzNo parsers found)ÚlistÚdefault_parser_listÚ_create_parserÚ ImportErrorÚsysÚmodulesr )Ú parser_listÚ parser_namer'rrrr Fs  ý ý r cCs$ddlm}| |dtƒ¡}| ¡S)Nr)Úimp)Úorg.python.corer+Ú importNameÚglobalsÚ create_parser)r*r+Ú drv_modulerrrr%as r%cCst|iidgƒ}| ¡S)Nr/)Ú __import__r/)r*r0rrrr%gs)r)Ú__doc__Ú xmlreaderrrrrÚ _exceptionsrrrrr r rr$Ú_falseÚxml.sax.expatreaderÚxmlÚosr'ÚflagsÚignore_environmentÚenvironÚsplitÚ_keyÚplatformÚregistryÚ containsKeyÚ getPropertyr r%rrrrÚs.   ü