em SrSSKJrJrJr SSKJrJrJr SSKJ r SSK J r J r SSK Jr \Rr\R r\R"r\R$R&r\R$R(r\R$R*r\R$R,r\R."5r\R2"SS5\R2"SS 5\R2"SS 5\R2"SS 5\R2"SS 5\R2"SS 5\R2"SS5\R2"SS5\R2"SS5S. r"SS\5rSrSr"SS5r\\\4r "SS\5r!"SS\5r""SS\"5r#"SS\"5r$S r%S!\%-r&"S"S#\5r'"S$S%5r("S&S'\(\5r)"S(S)\(\'5r*"S*S+\+5r,"S,S-\5r-S3S.jr.S3S/jr/S3S0jr0S3S1jr1S2r2g)4zFacility to use the Expat parser to load a minidom instance from a string or file. This avoids all the overhead of SAX and pulldom to gain performance. ) xmlbuilderminidomNode)EMPTY_NAMESPACE EMPTY_PREFIXXMLNS_NAMESPACE)expat) _append_child_set_attribute_node) NodeFilterNcdata enumerationentityentitiesididrefidrefsnmtokennmtokens) CDATAENUMENTITYENTITIESIDIDREFIDREFSNMTOKENNMTOKENScR\rSrSrSrS SjrSrSrSrSr S r S r S r S r Srg) ElementInfo< _attr_info_modeltagNameNc*Xl/UlX lgN)r%r#r$)selfr%models :/opt/imh/python3.13/lib/python3.13/xml/dom/expatbuilder.py__init__ElementInfo.__init__?s  cHURURUR4$r'r"r(s r* __getstate__ElementInfo.__getstate__Ds T\\99r-c.UuUlUlUlgr'r")r(states r* __setstate__ElementInfo.__setstate__Gs5:2dlr-cURH3nUSU:XdMUSnUSS:Xa [Ss $[USs $ [R$)Nr(r)r# _typeinfo_mapr_no_type)r(anameinfots r*getAttributeTypeElementInfo.getAttributeTypeJsXOODAw%HQ43;(00(b22 $r-c"[R$r')rr;)r( namespaceURI localNames r*getAttributeTypeNSElementInfo.getAttributeTypeNSTsr-cUR(aFURSnU[RR[RR4;$gNrF)r$r r) XML_CTYPE_ANYXML_CTYPE_MIXED)r(types r*isElementContentElementInfo.isElementContentWsF ;;;;q>D 9 9 % ; ; == =r-czUR(a*URS[RR:H$grG)r$r r)XML_CTYPE_EMPTYr/s r*isEmptyElementInfo.isEmpty_s) ;;;;q>U[[%@%@@ @r-cPURHnUSU:XdMUSS:Hs $ g)Nr7r8rF)r#)r(r<r=s r*isIdElementInfo.isIdes0OODAw%Bx4''$r-c&URX445$r')rR)r(eurienameaurir<s r*isIdNSElementInfo.isIdNSksyy$''r-r')__name__ __module__ __qualname____firstlineno__ __slots__r+r0r4r?rDrKrOrRrX__static_attributes__r-r*r r <s41I :;    (r-r c$URX5$r')_intern_setdefault)builderss r*_internreos  % %a ++r-c0SU;deURS5nURn[U5S:Xa'UupEnU"Xf5nU<SU<3nU"Xw5nU"XU5nO1[U5S:XaUupE[nU"XU5=puO[ SU-5eU"XD5XVU4$)N :z4Unsupported syntax: spaces in URIs not supported: %r)splitrblenr ValueError)rcnamepartsinternuri localnameprefixqnames r*_parse_ns_namerurs $;; JJsOE  ' 'F 5zQ!&'!9-u$90 Uq"988 ORVVWW # Y 55r-c\rSrSrSrS!SjrSrSrSrSr S r S r S r S r S rSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSr S r!g)" ExpatBuilderzLDocument builder that uses Expat to build a ParsedXML.DOM document instance.Nc Uc[R"5nXlURRb%[ URR5UlOSUl[ UlSUlUR5 gr') rOptions_optionsfilterFilterVisibilityController_filterr_finish_start_element_parserreset)r(optionss r*r+ExpatBuilder.__init__sa ? ((*G ==   +5dmm6J6JKDLDL*,D &  r-c,[R"5$)zCreate a new parser object.)r ParserCreater/s r* createParserExpatBuilder.createParsers!!##r-cLUR(dUR5UlURRRUlSURlSURlSURlURUR5 UR$)z7Return the parser object, creating a new one if needed.T) rrrp setdefaultrb buffer_textordered_attributesspecified_attributesinstallr/s r* getParserExpatBuilder.getParserso||,,.DL&*ll&9&9&D&DD #'+DLL $.2DLL +04DLL - LL &||r-c[R[SS5UlURUlURR UlSUlg)z6Free all data structures used during DOM construction.NF)theDOMImplementationcreateDocumentrdocumentcurNode _elem_info_cdatar/s r*rExpatBuilder.resets>,;; T4) }} --22 r-cURUlURUlURUlUR UlURR(aURUl URUl URR(aURUlURR"(a4UR$UlUR(UlUR,UlOUR0UlUR2UlUR6UlUR:UlUR>Ul g)z>Install the callbacks needed to build the DOM into the parser.N)!start_doctype_decl_handlerStartDoctypeDeclHandlerfirst_element_handlerStartElementHandlerend_element_handlerEndElementHandler pi_handlerProcessingInstructionHandlerr{rentity_decl_handlerEntityDeclHandlernotation_decl_handlerNotationDeclHandlercommentscomment_handlerCommentHandlercdata_sectionsstart_cdata_section_handlerStartCdataSectionHandlerend_cdata_section_handlerEndCdataSectionHandlercharacter_data_handler_cdataCharacterDataHandlercharacter_data_handlerexternal_entity_ref_handlerExternalEntityRefHandlerxml_decl_handlerXmlDeclHandlerelement_decl_handlerElementDeclHandlerattlist_decl_handlerAttlistDeclHandlerr(parsers r*rExpatBuilder.installs*.)H)H&%)%?%?"#'#;#; .2oo+ == ! !'+'?'?F $%)%?%?" == ! !$($8$8F ! == ' '.2.N.NF +,0,J,JF )*.*K*KF '*.*E*EF '*.*J*J' $ 5 5$($=$=!$($=$=!r-cUR5nSnURS5=n(aaURUS5 U(a,URR(aUR U5 SnURS5=n(aMaURSS5 URnUR5 SUlU$![ a N1f=f)zAParse a document from a file object, returning the document node.Ti@Fr-N) rreadParserdocumentElement _setup_subset ParseEscaperr)r(filer first_bufferbufferdocs r* parseFileExpatBuilder.parseFiles!   IIg..&. VU+DMM$A$A&&v.$ !IIg..&. LLd #mm      sA7C C CCcUR5nURUS5 URU5 URnUR 5 SUlU$![a N1f=f)z*>DLL '48OO 14<<')D $$0r-cURRX5n[URU5 UR(a@URR U5[ :XaURRU5 gggr')rcreateProcessingInstructionr rr~rr removeChild)r(targetdatanodes r*rExpatBuilder.pi_handler s[}}88FdllD) <DII$EI <<>DI!%D dllD)r-c@URRnU(a1USR[:XaUSnURU-Ulg[ R "5nURU-UlURUl[URU5 gr) rrrrrrrrrr )r(rrrs r*r#ExpatBuilder.character_data_handler#sv\\,, *R.11Y>b>D D(DI ||~II$ !]]dllD)r-c*U(agURR(dgURRXXW5nUb6URR U5n UR R U 5 URRRRR U5 UR(aPURRU5[:Xa,URRRRS gggr) r{rr_create_entitycreateTextNoderappendrrr~rr) r( entityNameis_parameter_entityrbaserr notationNamerchilds r*r ExpatBuilder.entity_decl_handler.s  }}%% }}++J,4D  MM007E OO " "5 ) &&++2248 <r?s r*rExpatBuilder.xml_decl_handlers= ' !)  ?+/ (+0 ( r-) rrrr~rrrbr{rrrr')"rZr[r\r]__doc__r+rrrrrrrrrrrrrrrrrrrrrrrr-rrrr_r`r-r*rwrws $ >.& :O**+ *( *8$9 + %%5 -".* !$" B1r-rwcB\rSrSrSrSrSrSrSr\ R\ R\ R\ R\ R\ R \ R"\ R$\ R&\ R(\ R*\ R,\ R.\ R0\ R2\ R4\ R6\ R8\ R:\ R<\ R>\ R@\ RB\ RD0 r#Sr$g)r}izkWrapper around a DOMBuilderFilter which implements the checks to make the whatToShow filter attribute work.r|cXlgr'rC)r(r|s r*r+#FilterVisibilityController.__init__s r-cURURnURRU-(aNURR U5nU[ :Xa[ eU[;a[S[U5-5eU$[$)Nz)startContainer() returned illegal value: ) _nodetype_maskrr| whatToShowr!FILTER_INTERRUPTr_ALLOWED_FILTER_RETURNSrmreprr)r(rmaskvals r*r!)FilterVisibilityController.startContainersz""4==1 ;; ! !D (++,,T2C&&!!11 ADIMOOJ r-cURURnURRU-(aURR U5nU[ :Xa[ eU[:Xa9URnURSSHnURU5 M [$U[;a[S[U5-5eU$[$)Nz%acceptNode() returned illegal value: )rGrr|rHrrIrr#r%r appendChildrrJrmrKr)r(rrLrMparentrs r*r%FilterVisibilityController.acceptNodes""4==1 ;; ! !D (++((.C&&!!k!!__Q/E&&u-0%$11 =S IKKJ r-N)%rZr[r\r]rAr^r+r!rr ELEMENT_NODEr SHOW_ELEMENTATTRIBUTE_NODESHOW_ATTRIBUTEr SHOW_TEXTrSHOW_CDATA_SECTIONENTITY_REFERENCE_NODESHOW_ENTITY_REFERENCE ENTITY_NODE SHOW_ENTITYPROCESSING_INSTRUCTION_NODESHOW_PROCESSING_INSTRUCTION COMMENT_NODE SHOW_COMMENT DOCUMENT_NODE SHOW_DOCUMENTDOCUMENT_TYPE_NODESHOW_DOCUMENT_TYPEDOCUMENT_FRAGMENT_NODESHOW_DOCUMENT_FRAGMENT NOTATION_NODE SHOW_NOTATIONrGr_r`r-r*r}r}s5I !!* **A*A **C*C **>*> **G*G ""**J*J **@*@ ((**P*P **A*A **B*B **G*G ##**K*K **B*B  Nr-r}c\rSrSrSrSrSrg) FilterCrutchi)_builder_level _old_start_old_endcSUlXlURnURUlUR UlURUlURUlgr7) rlrkrrrmrrnrr)r(rcrs r*r+FilterCrutch.__init__sM   4400 %)%?%?"#'#;#; r-)rkrlrnrmN)rZr[r\r]r^r+r_r`r-r*rjrjs >I %%s ]> &fragment-builder-internal;cF\rSrSrSrS SjrSrSrSrSr S r S r S r g) FragmentBuilderiOzBuilder which constructs document fragments given XML source text and a context node. The context node is expected to provide information about the namespace declarations which are in scope at the start of the fragment. NcUR[:Xa XlXlOURUlXl[ R X5 gr')rraoriginalDocumentrrrwr+)r(rrs r*r+FragmentBuilder.__init__Xs<   } ,$+ !"L$+$9$9D !"Ld,r-c<[RU5 SUlgr')rwrfragmentr/s r*rFragmentBuilder.resetas4  r-c@URUR55$)zJParse a document fragment from a file object, returning the fragment node.)rrr(rs r*rFragmentBuilder.parseFilees ,,r-cXlUR5nURRnSnU(auUR=(d UR 5nUR (a SUR <SUR<S3nO#UR(aSUR-nOSnUR5n[XEU4-nURUS5 URnUR5 U$! UR5 e=f)zEParse a document fragment from a string, returning the fragment node.zPUBLIC "z" ""z SYSTEM "%s"T) _sourcerrrr_getDeclarationsrr _getNSattrs_FRAGMENT_BUILDER_TEMPLATErrr) r(rrridentrnsattrsrrs r*rFragmentBuilder.parseStringjs !''// ++Ft/D/D/FF#,,g.>.>@!!%(8(88F""$-0HH  LL4 (==    JJL s C99D cURRRnSnU(Ga[URR 5HnURR U5nU(aUS-nU<SUR<3nUR(a$U<SUR<SUR<S3nMrU<SUR<S3nM [URR 5HnURR U5nU(aUS-nU<SUR<3nUR(a#U<SUR<SUR<S 3nODUR(aU<SUR<S 3nOU<S URR<S 3nUR(aU<S UR<3nUS -nM U$) zRe-create the internal subset from the DocumentType node. This is only needed if we don't already have the internalSubset as a string. rz z z SYSTEM "z )rrrrrlengthitemnodeNamerrr firstChildrr)r(rrdrnotationrs r*r FragmentBuilder._getDeclarationssc ,,,,44  7,,334",,11!4F A)*H,=,=>$$h//1B1BDA./0A0ABA57++223 ))..q1F A'(&//:??foov@A__,-v?A%&(9(9(>(>?A&&,-v/B/BCAG4r-cg)Nrr`r/s r*rFragmentBuilder._getNSattrssr-cU[:XaURnURnURR U5nUR UlURR 5UlURUlURURS5 X`lXPlSUl g[RXX#U5$!X`lXPlSUl f=f)NTr) $_FRAGMENT_BUILDER_INTERNAL_SYSTEM_IDrrrExternalEntityParserCreatercreateDocumentFragmentrrrrwr)r(rrrr old_document old_cur_noders r*r+FragmentBuilder.external_entity_ref_handlers ; ; ==L<\rSrSrSrSrSrSrSrSr Sr S r g ) Namespacesiz7Mix-in class for builders; adds support for namespaces.c/Ulgr')_ns_ordered_prefixesr/s r*_initNamespacesNamespaces._initNamespacess %'!r-c<[R"SS9nSUlU$)z'Create a new namespace-handling parser.rg)namespace_separatorT)r rnamespace_prefixesrs r*rNamespaces.createParsers##<$(! r-c[RX5 URR(aURUlgg)z.Insert the namespace-handlers onto the parser.N)rwrr{namespace_declarationsstart_namespace_decl_handlerStartNamespaceDeclHandlerrs r*rNamespaces.installs3T* == / /11  , 0r-c<URRX45 g)z/Push this namespace declaration on our storage.N)rr)r(rsrqs r*r'Namespaces.start_namespace_decl_handlers !!((&7r-cSU;a[X5up4pVO[nUnSn[n[R"XcXT5nUR Ul[URU5 XplUR(aURHzupSU(a+[R"[USU-5[US5nO![R"S[S[5nX8l UR Ul[Xx5 M| URSS2 U(aUR5 UR n UR"n [%S['U5S5Hn X+n X+S-n SU ;a/[X 5up4pV[R"XcXE5nXU'XX44'O/[R"U [U [5nXU 'X[U 4'UR UlXl XxlM gg)Nrgxmlns:xmlnsrrjr7)rurrrElementrrr rrrrerrr _ensure_attributes_attrs_attrsNSrrl ownerElement)r(rnrrqrrrsrtrrrrrr<rs r*r Namespaces.start_element_handlers $;,:4,F )CFE!CEI!Fu6=!]]dllD)  $ $#88  WT8f3D%E%4fgGA Wo%,lt0J-,,3#--:#NNf4???54''4/@?@/++>DCD>"--DL  $ $W -r-)rrN) rZr[r\r]rArrrrrrr_r`r-r*rrs)A'  38-&^  .r-rc\rSrSrSrSrSrg)ExpatBuilderNSi#z*Document builder that supports namespaces.cN[RU5 UR5 gr')rwrrr/s r*rExpatBuilderNS.reset&s4  r-r`N)rZr[r\r]rArr_r`r-r*rr#s 4r-rc$\rSrSrSrSrSrSrg)FragmentBuilderNSi+z*Fragment builder that supports namespaces.cN[RU5 UR5 gr')rrrr/s r*rFragmentBuilderNS.reset.sd# r-cXSnURn/nU(a[US5(alURR5HNupEXC;aM UR U5 U(aSU-nOSnU(aU<SU<SU<S3nMCSU<SU<S3nMP UR nU(aMU$) zFReturn string of namespace attributes from this element and ancestors.r_ns_prefix_urirrz z=''rg)rhasattrritemsrr%)r(attrsrr2rsrqdeclnames r*rFragmentBuilderNS._getNSattrs2s,, w 011#*#9#9#?#?#AKF{ HHV$#+f#4#*5:Hc J/7 <$B((Gg  r-r`N)rZr[r\r]rArrr_r`r-r*rr+s4r-rc\rSrSrSrSrg)riPzEException raised to short-circuit parsing in InternalSubsetExtractor.r`N)rZr[r\r]rAr_r`r-r*rrPsOr-rcF\rSrSrSrSrSrSrSrSr Sr S r S r S r g) riTzBXML processor which can rip out the internal document type subset.NcUR$)z'Return the internal subset as a string.rr/s r*r!InternalSubsetExtractor.getSubsetYs {{r-cP[RX5 g![a gf=fr')rwrrrs r*r!InternalSubsetExtractor.parseFile]s'   " "4 .     %%cP[RX5 g![a gf=fr')rwrr)r(rs r*r#InternalSubsetExtractor.parseStringcs'   $ $T 2   rcHURUlURUlgr')rrrrrs r*rInternalSubsetExtractor.installis)-)H)H&%)%?%?"r-cU(aDUR5n/UlURRUlURUlg[ 5er')rrrDefaultHandlerrrr)r(rnrrrrs r*r2InternalSubsetExtractor.start_doctype_decl_handlerms@ ^^%FDK$(KK$6$6F !+/+H+HF (- r-cSRUR5RSS5RSS5nXl[5e)Nrz   )joinrreplacer)r(rds r*r0InternalSubsetExtractor.end_doctype_decl_handlerws; GGDKK ( ( 6 > >tT J mr-c[5er')r)r(rnrs r*r-InternalSubsetExtractor.start_element_handler|s mr-r)rZr[r\r]rArrrrrrrrr_r`r-r*rrTs.L F  @  r-rcU(a [5nO [5n[U[5(a([ US5nUR U5nSSS5 U$UR U5nU$!,(df  W$=f)zsParse a document, returning the resulting Document node. 'file' may be either a file name or an open file object. rbN)rrw isinstancestropenr)r namespacesrcfpresults r*parsersr  ".$ $ &&r*F M""4( M   Ms A-- A<c\U(a [5nO [5nURU5$)zGParse a document from a string, returning the resulting Document node. )rrwr)rrrcs r*rrs' ".   v &&r-cU(a [U5nO [U5n[U[5(a([ US5nUR U5nSSS5 U$UR U5nU$!,(df  W$=f)zParse a fragment of a document, given the context from which it was originally extracted. context should be the parent of the node(s) which are in the fragment. 'file' may be either a file name or an open file object. rN)rrrrrr)rrrrcrrs r* parseFragmentrsw#G,!'*$ $ &&r*F M""4( M   Ms A// A>c`U(a [U5nO [U5nURU5$)zParse a fragment of a document from a string, given the context from which it was originally extracted. context should be the parent of the node(s) which are in the fragment. )rrr)rrrrcs r*parseFragmentStringrs, #G,!'*   v &&r-cPUR(a [U5$[U5$)z,Create a builder based on an Options object.)rrrw)rs r* makeBuilderrs!g&&G$$r-)T)3rAxml.domrrrrrr xml.parsersr xml.dom.minidomr r xml.dom.NodeFilterr rrraDOMBuilderFilterrrr#rIgetDOMImplementationrTypeInfor:objectr rerurwrJr}rjr"r$rrrrrr Exceptionrrrrrrrr`r-r*rs:.-BB>) NN ,,"" ++99 ++99 ))55 ..??335  w/  }5  x0  z2  t,  w/  x0  y1  z2  1(&1(f,6&y1y1| )-E7 7 t <6 <*|*8!l!2?%*+ +r9lr9j\.\.~Z" O"J ) )l)X$'( '%r-