mò &U²Ic@sdZdZdkTdklZlZdklZdklZlZdkl Z dkl Z l Z dk Z e i d d joed eƒ‚n[ yd klZWn"ej oed eƒ‚n&Xeedƒ oed eƒ‚ndklZlZlZeiZeiZy dkZWnej od„ZnXdkZeiZ[[deifd„ƒYZdei eifd„ƒYZ!d„Z"e#djoOdkZ$e"ƒZ%e%i&e$i'i(ƒƒe%i)e$i'i*ƒƒe%i+dƒndS(s] SAX driver for the pyexpat C module. This driver works with pyexpat.__version__ == '2.22'. s0.20(t*(sfeature_validationsfeature_namespaces(sfeature_namespace_prefixes(sfeature_external_gessfeature_external_pes(sfeature_string_interning(sproperty_xml_stringsproperty_interning_dictNitjavasexpat not available in Java(sexpatsexpat not supportedt ParserCreate(s xmlreaderssaxutilsshandlercCs|S(N(to(R((t0/data/zmath/lib/python2.4/xml/sax/expatreader.pyt_mkproxy'st ExpatLocatorcBs;tZdZd„Zd„Zd„Zd„Zd„ZRS(s¼Locator for use with the ExpatParser class. This uses a weak reference to the parser object to avoid creating a circular reference between the parser and the content handler. cCst|ƒ|_dS(N(Rtparsertselft_ref(RR((Rt__init__6scCs+|i}|idjodSn|iiS(N(RR Rt_parsertNonetErrorColumnNumber(RR((RtgetColumnNumber9s cCs+|i}|idjodSn|iiS(Ni(RR RR R tErrorLineNumber(RR((Rt getLineNumber?s cCs+|i}|djodSn|iiƒS(N(RR RR t_sourcet getPublicId(RR((RREs  cCs+|i}|djodSn|iiƒS(N(RR RR Rt getSystemId(RR((RRKs  (t__name__t __module__t__doc__R RRRR(((RR0s     t ExpatParsercBs-tZdZddddd„Zd„Zd„Zd„Zd „Zd „Zd „Z d „Z dd „Z d„Z d„Z d„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd „Zd!„Zd"„Z RS(#s$SAX driver for the pyexpat C module.iiiicCsetii||ƒtiƒ|_d|_||_ d|_ d|_ g|_ d|_d|_dS(Nii(t xmlreadertIncrementalParserR Rtbufsizet InputSourceRR R tnamespaceHandlingt _namespacest_lex_handler_propt_parsingt _entity_stackt _external_gest _interning(RRR((RR Ws      cCsOti|ƒ}||_|iƒ|iit|ƒƒt i i ||ƒdS(s3Parse an XML document from a URL or an InputSource.N( tsaxutilstprepare_input_sourcetsourceRRtresett _cont_handlertsetDocumentLocatorRRRtparse(RR%((RR)ds   cCs1|iƒdjo|ii|iƒƒndS(N(R%RR RR tSetBase(RR%((Rt prepareParsermscCs/tii||ƒ|io|iƒndS(N(RRtsetContentHandlerRthandlerRt_reset_cont_handler(RR-((RR,ss cCs€|tjo |iSnU|tjo|idj Sn7|ttt fjodSn|t jo |i Snt d|ƒ‚dS(NisFeature '%s' not recognized( tnametfeature_namespacesRRtfeature_string_interningR"R tfeature_validationtfeature_external_pestfeature_namespace_prefixestfeature_external_gesR!tSAXNotRecognizedException(RR/((Rt getFeaturexs     cCs|iotdƒ‚n|tjo ||_nå|tjo ||_nË|t jo5|o!|i djo h|_ qŒqd|_ n‰|t jo|otdƒ‚qna|t jo|otdƒ‚qn9|tjo|otdƒ‚qntd|ƒ‚dS(Ns!Cannot set features while parsings!expat does not support validations/expat does not read external parameter entitiess(expat does not report namespace prefixessFeature '%s' not recognized(RRtSAXNotSupportedExceptionR/R0tstateRR5R!R1R"R R2R3R4R6(RR/R9((Rt setFeature„s*          cCs¢|tijo |iSnt|tjo |iSn\|tjoN|io4t |idƒo|ii ƒSqŠt dƒ‚qŽt dƒ‚nt d|ƒ‚dS(NtGetInputContexts=This version of expat does not support getting the XML strings.XML string cannot be returned when not parsingsProperty '%s' not recognized( R/R-tproperty_lexical_handlerRRtproperty_interning_dictR"tproperty_xml_stringR thasattrR;R6R8(RR/((Rt getProperty¢s     cCs„|tijo%||_|io|iƒq€nL|tjo ||_ n2|t jot d|ƒ‚nt d|ƒ‚dS(NsProperty '%s' cannot be setsProperty '%s' not recognized( R/R-R<tvalueRRRt_reset_lex_handler_propR=R"R>R8R6(RR/RA((Rt setProperty´s     cCs’|ip$|iƒd|_|iiƒny|ii||ƒWnFt i j o7}t t i |iƒ||ƒ}|ii|ƒnXdS(Ni(RRR&R't startDocumentR tParsetdatatisFinaltexpatterrortetSAXParseExceptiont ErrorStringtcodetexct _err_handlert fatalError(RRFRGRJRN((RtfeedÄs   cCsH|iodSn|idddƒ|iiƒd|_d|_dS(NtRGii(RR RQR't endDocumentRR R (R((RtcloseÕs    cCs(|ii|i_|ii|i_dS(N(RR'tprocessingInstructionR tProcessingInstructionHandlert characterstCharacterDataHandler(R((RR.ßscCs|i}|i}|djo1d|_d|_d|_d|_ d|_ n=|i |_|i |_|i |_|i|_ |i|_ dS(N(RRtlexR RR tCommentHandlertStartCdataSectionHandlertEndCdataSectionHandlertStartDoctypeDeclHandlertEndDoctypeDeclHandlertcommentt startCDATAtendCDATAtstart_doctype_decltendDTD(RRYR((RRBäs            cCsT|ioLtiddd|iƒ|_d|i_|i|i_ |i |i_ n7tid|iƒ|_|i |i_ |i |i_ |iƒ|i|i_|i|i_|i|i_|i|i_d|_|io|iƒn|i|i_y|i|i_Wntj onX|iiti ƒd|_!g|_"dS(Nt tinternii(#RRRHRR R"R tnamespace_prefixeststart_element_nstStartElementHandlertend_element_nstEndElementHandlert start_elementt end_elementR.tunparsed_entity_decltUnparsedEntityDeclHandlert notation_decltNotationDeclHandlertstart_namespace_decltStartNamespaceDeclHandlertend_namespace_decltEndNamespaceDeclHandlert_decl_handler_propRRBtexternal_entity_reftExternalEntityRefHandlertskipped_entity_handlertSkippedEntityHandlertAttributeErrortSetParamEntityParsingt*XML_PARAM_ENTITY_PARSING_UNLESS_STANDALONERR (R((RR&ôs2       cCs"|idjodSn|iiS(N(RR R R (R((RRscCs"|idjodSn|iiS(Ni(RR R R(R((RRscCs |iiƒS(N(RRR(R((RR$scCs |iiƒS(N(RRR(R((RR'scCs|ii|t|ƒƒdS(N(RR't startElementR/tAttributesImpltattrs(RR/R((RRk+scCs|ii|ƒdS(N(RR't endElementR/(RR/((RRl.sc CsT|iƒ} t| ƒdjod|f} n8t| ƒdjo| d| df} n t| ƒ} h} h}x¼|i ƒD]®\} }| iƒ}t|ƒ}|djo| }d| f}nT|djo0d|d|df}|d|df}n|d}t|ƒ}|| |<|||          &       "        cOs t||ŽS(N(Rtargstkwargs(R¨R©((Rt create_parser“st__main__s../../../hamlet.xml(,Rtversiontxml.sax._exceptionstxml.sax.handlerR2R0R4R5R3R1R>R=tsystplatformtSAXReaderNotAvailableR t xml.parsersRHt ImportErrorR?txml.saxRR#R-R~RŽt_weakrefRtweakreftproxytLocatorRRRRªRtxmltpR,tsaxt XMLGeneratortsetErrorHandlert ErrorHandlerR)(R¬RHR0RŽR¶R1R-R~R4R2R¹RªR¯R3RRR#R=RµRRR>RºR5((Rt?sJ        $ÿ@