e/SrSSKrSSKrSSKrSSKrSSKrSSKJr SSKJ r Sr 04Sjr 04Sjr 04S jr S r"S S \R5r"S S\ R"5rSSjrg)znA library of useful helper classes to the SAX classes, for the convenience of application and driver writers. N)handler) xmlreadercZUR5Hup#URX#5nM U$)z2Replace substrings of a string using a dictionary.)itemsreplace)sdkeyvalues 6/opt/imh/python3.13/lib/python3.13/xml/sax/saxutils.py__dict_replacer s'ggi  IIc ! HcURSS5nURSS5nURSS5nU(a [X5nU$)zEscape &, <, and > in a string of data. You can escape other strings of data by passing a dictionary as the optional entities parameter. The keys and values must all be strings; each key will be replaced with its corresponding value. &&>><<rrdataentitiess r escapersF <<W %D <<V $D <<V $Dd- KrcURSS5nURSS5nU(a [X5nURSS5$)zUnescape &, <, and > in a string of data. You can unescape other strings of data by passing a dictionary as the optional entities parameter. The keys and values must all be strings; each key will be replaced with its corresponding value. rrrrrrrrs r unescaper"sB << $D << $Dd- << %%rc0UESSSS.En[X5nSU;a%SU;aSURSS5-nU$S U-nU$SU-nU$) awEscape and quote an attribute value. Escape &, <, and > in a string of data, then quote it for use as an attribute value. The " character will be escaped as well, if necessary. You can escape other strings of data by passing a dictionary as the optional entities parameter. The keys and values must all be strings; each key will be replaced with its corresponding value. z z z )   "'z"%s"z"z'%s')rrrs r quoteattrr$0snG(F'vFH $ !D d{ $;DLLh77D KD=D K} Krc6^TcSSKnUR$[T[R5(aT$[T[ R [ R45(aT$[T[R5(a"U4SjS5nU"5nSUl OQ[R"5nSUl TRUl TRUl TRUl[R "XASSSS 9$![a N#f=f) Nrc<>\rSrSrYRrU4SjrSrg) _gettextwriter.._wrapperXc>[TU5$N)getattr)selfnameouts r __getattr__,_gettextwriter.._wrapper.__getattr__ZssD))rN)__name__ __module__ __qualname____firstlineno__ __class__r/__static_attributes__)r.sr _wrapperr'Xs I * *rr8cgr*r1r1rr  _gettextwriter..]strcg)NTr1r1rr r:r;bs$rxmlcharrefreplacerT)encodingerrorsnewline write_through)sysstdout isinstanceio TextIOBasecodecs StreamWriterStreamReaderWriter RawIOBasecloseBufferedIOBasewritablewriteseekabletellAttributeError TextIOWrapper)r.r>rBr8buffers` r _gettextwriterrTGs {zz#r}}%% #++V-F-FGHH #r||$$ * *# ""$&yy  "llFO((FK   F#6$(*. 00   s"D DDcp\rSrSrSSjrSrSSjrSrSrSr S r S r S r S r S rSrSrSrSrg) XMLGeneratorpNc[RRU5 [X5nURUlUR Ul0/UlURSUl /Ul X l X0l SUl g)NF)rContentHandler__init__rTrN_writeflush_flush _ns_contexts_current_context_undeclared_ns_maps _encoding_short_empty_elements_pending_start_element)r,r.r>short_empty_elementss r r[XMLGenerator.__init__rsn''-S+ii ii D $ 1 1" 5#% !%9"&+#rcUS(a5SUS:XaSUS-$URUSnU(a US-US-$US$)z7Builds a qualified name from a (ns_url, localname) pairrz$http://www.w3.org/XML/1998/namespacezxml:r:)r`)r,r-prefixs r _qnameXMLGenerator._qname~sY 7 6a@Q''**473F|d1g--AwrcXUR(aURS5 SUlgg)NrFrdr\)r, endElements r _finish_pending_start_element*XMLGenerator._finish_pending_start_elements$  & & KK */D ' 'rc@URSUR-5 g)Nz$ )r\rbr,s r startDocumentXMLGenerator.startDocuments ;' (rc$UR5 gr*)r^rrs r endDocumentXMLGenerator.endDocuments  rcURRURR55 XRU'URRX45 gr*)r_appendr`copyrar,riuris r startPrefixMappingXMLGenerator.startPrefixMappingsI   !6!6!;!;!=>%+c"   '' 6rcFURSUlURS g)NrY)r_r`r,ris r endPrefixMappingXMLGenerator.endPrefixMappings# $ 1 1" 5   b !rc UR5 URSU-5 UR5H'upURSU<S[U5<35 M) UR(aSUlgURS5 g)Nr =Tr)ror\rr$rcrd)r,r-attrsr s r startElementXMLGenerator.startElementsc **, C$J"[[]MT KKD)E*:; <+  % %*.D ' KK rcUR(aURS5 SUlgURSU-5 gNz/>Fzrmr,r-s r rnXMLGenerator.endElements/  & & KK */D ' KK$ 'rc UR5 URSURU5-5 URH<upEU(aURSU<SU<S35 M(URSU-5 M> /UlUR 5H6upURSURU5<S[ U5<35 M8 UR (aSUlgURS 5 g) Nrz xmlns:z="r"z xmlns="%s"rrTr)ror\rjrarr$rcrd)r,r-qnamerrir|r s r startElementNSXMLGenerator.startElementNSs **, C$++d++,33KF <= MC/0 4 $& "[[]MT KKDKK$5y7GH I+  % %*.D ' KK rcUR(aURS5 SUlgURSURU5-5 gr)rdr\rjr,r-rs r endElementNSXMLGenerator.endElementNSs9  & & KK */D ' KK$++d"33 4rcU(aUUR5 [U[5(d[XR5nUR [ U55 ggr*)rorDstrrbr\rr,contents r charactersXMLGenerator.characterssA   . . 0gs++g~~6 KKw ( rcU(aLUR5 [U[5(d[XR5nUR U5 ggr*)rorDrrbr\rs r ignorableWhitespace XMLGenerator.ignorableWhitespaces=   . . 0gs++g~~6 KK rcXUR5 URSU<SU<S35 g)Nz)ror\r,targetrs r processingInstruction"XMLGenerator.processingInstructions **, 6401r)r`rbr^r_rdrcrar\)Nz iso-8859-1F)F)r2r3r4r5r[rjrorsrvr}rrrnrrrrrr7r1rr rVrVpsH ,"0(7 "($5)!2rrVc\rSrSrSrS!SjrSrSrSrSr S r S r S r S r S rSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSr S r!g)" XMLFilterBaseaEThis class is designed to sit between an XMLReader and the client application's event handlers. By default, it does nothing but pass requests up to the reader and events on to the handlers unmodified, but subclasses can override specific methods to modify the event stream or the configuration requests as they pass through.NcN[RRU5 Xlgr*)r XMLReaderr[_parentr,parents r r[XMLFilterBase.__init__s$$T* rc:URRU5 gr*) _err_handlererrorr, exceptions r rXMLFilterBase.errors  *rc:URRU5 gr*)r fatalErrorrs r rXMLFilterBase.fatalErrors $$Y/rc:URRU5 gr*)rwarningrs r rXMLFilterBase.warnings !!),rc:URRU5 gr*) _cont_handlersetDocumentLocator)r,locators r r XMLFilterBase.setDocumentLocators --g6rc8URR5 gr*)rrsrrs r rsXMLFilterBase.startDocuments ((*rc8URR5 gr*)rrvrrs r rvXMLFilterBase.endDocuments &&(rc:URRX5 gr*)rr}r{s r r} XMLFilterBase.startPrefixMappings --f:rc:URRU5 gr*)rrrs r rXMLFilterBase.endPrefixMappings ++F3rc:URRX5 gr*)rr)r,r-rs r rXMLFilterBase.startElement  ''4rc:URRU5 gr*)rrnrs r rnXMLFilterBase.endElements %%d+rc<URRXU5 gr*)rr)r,r-rrs r rXMLFilterBase.startElementNSs ))$u=rc:URRX5 gr*)rrrs r rXMLFilterBase.endElementNSrrc:URRU5 gr*)rrrs r rXMLFilterBase.characterss %%g.rc:URRU5 gr*)rr)r,charss r r!XMLFilterBase.ignorableWhitespaces ..u5rc:URRX5 gr*)rrrs r r#XMLFilterBase.processingInstructions 00>rc:URRU5 gr*)r skippedEntityrs r rXMLFilterBase.skippedEntity s ((.rc<URRXU5 gr*) _dtd_handler notationDecl)r,r-publicIdsystemIds r rXMLFilterBase.notationDecl%s &&tx@rc<URRXX45 gr*)runparsedEntityDecl)r,r-rrndatas r r XMLFilterBase.unparsedEntityDecl(s ,,TXMrc8URRX5$r*) _ent_handler resolveEntity)r,rrs r rXMLFilterBase.resolveEntity-s  ..xBBrcURRU5 URRU5 URRU5 URR U5 URR U5 gr*)rsetContentHandlersetErrorHandlersetEntityResolver setDTDHandlerparse)r,sources r rXMLFilterBase.parse2s\ &&t, $$T* &&t, ""4( 6"rc:URRU5 gr*)r setLocale)r,locales r rXMLFilterBase.setLocale9s v&rc8URRU5$r*)r getFeaturers r rXMLFilterBase.getFeature<s||&&t,,rc:URRX5 gr*)r setFeature)r,r-states r rXMLFilterBase.setFeature?s ,rc8URRU5$r*)r getPropertyrs r rXMLFilterBase.getPropertyBs||''--rc:URRX5 gr*)r setProperty)r,r-r s r rXMLFilterBase.setPropertyEs   -rcUR$r*rrrs r getParentXMLFilterBase.getParentJs ||rcXlgr*rrs r setParentXMLFilterBase.setParentMs rrr*)"r2r3r4r5__doc__r[rrrrrsrvr}rrrnrrrrrrrrrrrrrrrrrr7r1rr rrs +0- 7+);45,>5/6?/ AN C #'--.. rrc[U[R5(a[R"U5n[U[5(a[ R "U5nO[US5(aUn[ R "5n[URS5[5(aURU5 OURU5 [US5(a:[UR[5(aURUR5 UR5Gc+UR5GcUR5n[R R#[R R%U55n[R R'XC5n[R R)U5(aURU5 [+US5nO[UR[,R.R1X55 [,R2R5UR55nURU5 U$)z~This function takes an InputSource and an optional base URL and returns a fully resolved InputSource object ready for reading.readrr-rb)rDosPathLikefspathrr InputSourcehasattrrsetCharacterStream setByteStreamr- setSystemIdgetCharacterStream getByteStream getSystemIdpathdirnamenormpathjoinisfileopenurllibrurljoinrequesturlopen)rbasefsysidbasehead sysidfilenames r prepare_input_sourcer$Rs&"++&&6"&#&&v.  &&( affQi % %  % %a (   # 1f  *QVVS"9"9   qvv &   "*v/C/C/E/M""$77??277#3#3D#9: X5 77>>- ( (   } -]D)A   v||33D@ A&&v'9'9';r(sv ('    & .'0Rp27))p2fkI''k^r