\d:dZddlmZddlmZmZddlmZmZm Z m Z m Z efdZ efdZ dgZdZerdd lZdd lZdd lZejjs)d ejvr ejd d Z[d Zejd d dkrGejer-ejed ZddZejd d dkrdZndZ[d S)aSimple 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) SAXExceptionSAXNotRecognizedExceptionSAXParseExceptionSAXNotSupportedExceptionSAXReaderNotAvailablect}||||||dS)N) make_parsersetContentHandlersetErrorHandlerparse)sourcehandler errorHandlerparsers !..\python\lib\xml\sax\__init__.pyrrsK ]]F W%%% <((( LLcddl}|t}t}||||t }t |tr)|| |n(| | || |dS)N) iorr r rr isinstancestrsetCharacterStreamStringIO setByteStreamBytesIOr)stringrrrrinpsrcs r parseStringr!#s III#~~ ]]F W%%% <((( ]]F&#1!!"++f"5"56666RZZ//000 LLrzxml.sax.expatreaderrN PY_SAX_PARSER,zpython.xml.sax.parserjavact|tzD]<} t|cS#t$rddl}||jvrY.t $rY9wxYwt dd)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)listdefault_parser_list_create_parser ImportErrorsysmodulesr ) parser_list parser_namer,s rr r FsK((+>>    !+.. . . .    JJJck))*)%    D  2D 9 99s,A AAc|ddlm}||dt}|S)Nr)imp)org.python.corer1 importNameglobals create_parser)r/r1 drv_modules rr*r*as?''''''^^KGII>> '')))rcPt|iidg}|S)Nr5) __import__r5)r/r6s rr*r*gs* Br?2CDD '')))r)r&)__doc__ xmlreaderrrrr _exceptionsrrrr r rr!r)_falsexml.sax.expatreaderxmlosr,flagsignore_environmentenvironsplit_keyplatformregistry containsKey getPropertyr r*r&rrrIs*#"""""11111111.............. )5  /;lnn    $--   y#A2:(E(E*_5;;C@@<v#,":":4"@"@,22488>>sCC::::4<1**** ***CCr