+
    ih c                   sb   R t ^ RIt^ RIt^ RIHtHtHtHt ^ RI5 ^ RI	H
t
Ht ]P                  P                  P                  ]P                  P                  P                  3t ! R R]P                  P                  4      t]! ]RRR	7       ]! ]R
RR	7       ]! ]RRR	7       R tR tR tR t ! R R]4      t ! R R]4      t]! ]RRR	7       ]! ]RRR	7       ]! ]RRR	7        ! R R]4      t]! ]RRR	7       ]t ! R R ]4      t]! RR4      t ! R! R"]4      t]! ]R#R$R	7       ]! ]RR%R	7       R& t ! R' R(4      t ! R) R*]]4      t  ! R+ R,]]4      t!]! ]!RR-R	7        ! R. R/]!4      t"]! ]"R0R1R	7       ]! ]"R2R3R	7       R4 t#R5 t$ ! R6 R7]!4      t% ! R8 R9]"4      t& ! R: R;]4      t']! ]'RR<R	7        ! R= R>4      t( ! R? R@](]]4      t) ! RA RB](]4      t* ! RC RD](]]4      t+ ! RE RF]
4      t, ! RG RH]4      t-RI t. ! RJ RK]]4      t/]! ]/RLRMR	7       RN t0RO t1RP t2RTRQ lt3RURR lt4RURS lt5R# )Vac  Simple implementation of the Level 1 DOM.

Namespaces and other minor Level 2 features are also supported.

parse("foo.xml")

parseString("<foo><bar/></foo>")

Todo:
=====
 * convenience methods for getting elements and text.
 * more testing
 * bring some of the writer and linearizer code into conformance with this
        interface
 * SAX 2 namespaces
N)EMPTY_NAMESPACEEMPTY_PREFIXXMLNS_NAMESPACEdomregZ*)DOMImplementationLS
DocumentLSc                   s   a  ] tR t^"t o RtRtRtRtRt]	t
R tRR ltRR ltR tR tR tR tR	 tR
 tR tR tR tR tR tR tR tR tR tR tR tR tR t R t!Rt"V t#R# )NodeNc                    R # )T self   &(/usr/lib64/python3.14/xml/dom/minidom.py__bool__ZNode.__bool__+           c                s(    V P                  R R W4      #  )toprettyxml)r   encoding
standalone   &&&r   toxmlZ
Node.toxml.   s    B==r   c                s   Vf   \         P                  ! 4       pM-\         P                  ! \         P                  ! 4       VRRR7      pV P                  \
        P                  8X  d   V P                  VRWW44       MV P                  VRW4       Vf   VP                  4       # VP                  4       P                  4       # )NZxmlcharrefreplace
)r   ZerrorsZnewliner   )
ioZStringIOZTextIOWrapperZBytesIOnodeTyper   DOCUMENT_NODEwritexmlZgetvalueZdetach)r   indentnewlr   r   writer   &&&&& r   r   ZNode.toprettyxml1   s    [[]F%%bjjl/7-@.24F ==D...MM&"fHIMM&"f3??$$==?++--r   c                ,    \        V P                  4      # N)Zbool
childNodesr
   r   r   hasChildNodesZNode.hasChildNodesD   s    DOO$$r   c                    V P                   # r"   r#   r
   r   r   _get_childNodesZNode._get_childNodesG       r   c                sP    V P                   '       d   V P                   ^ ,          # R#     Nr&   r
   r   r   _get_firstChildZNode._get_firstChildJ   s    ?????1%% r   c                sP    V P                   '       d   V P                   R,          # R#    Nr&   r
   r   r   _get_lastChildZNode._get_lastChildN   s    ?????2&& r   c                sX   VP                   V P                  8X  d0   \        VP                  4       F  pV P	                  W24       K  	  V# VP                   V P
                  9  d9   \        P                  P                  \        V4      : R \        V 4      : 24      hVP                  e   VP                  P                  V4       Vf   V P                  V4       V#  V P                  P                  V4      pTP                   \         9   d   \#        T 4       T P                  P%                  YA4       Y!n        Yn        T'       d(   T P                  T^,
          ,          pYn        YQn        MRTn        Yn
        T#   \         d     \        P                  P                  4       hi ; i cannot be child of N)r   DOCUMENT_FRAGMENT_NODEtupler#   insertBefore_child_node_typesxmldomHierarchyRequestErrrepr
parentNoderemoveChildappendChildindex
ValueErrorNotFoundErr_nodeTypes_with_children_clear_id_cacheinsertnextSiblingpreviousSibling)r   newChildrefChildcr=   node   &&&   r   r4   ZNode.insertBeforeR   s`    ; ;;8../!!!. 0 OD$:$::''--.28nd4jIK K*++H5X&$ !,--h7   $<<%OO""53#+ '/$uQw/#+ +/(+/("&  ,gg))++,s   E? ?*F)c                s   VP                   V P                  8X  d0   \        VP                  4       F  pV P	                  V4       K  	  V# VP                   V P
                  9  d9   \        P                  P                  \        V4      : R \        V 4      : 24      hVP                   \        9   d   \        V 4       VP                  e   VP                  P                  V4       \        W4       RVn        V# r0   )r   r2   r3   r#   r<   r5   r6   r7   r8   r9   r@   rA   r:   r;   _append_childrC   )r   rH   rG      && r   r<   ZNode.appendChildr   s    ==D7774??+  # , K== 6 66''--.24j$t*EG G]]66D!??&OO''-d!r   c                s   VP                   V P                  8X  d/   VP                  pV P                  V4       V P	                  W4      # VP                   V P
                  9  d9   \        P                  P                  \        V4      : R \        V 4      : 24      hWJ d   R# VP                  e   VP                  P                  V4        V P                  P                  V4      pYP                  T&   Yn
        RTn
        TP                   \        9   g   TP                   \        9   d   \!        T 4       TP                  Tn        TP"                  Tn        RTn        RTn        TP"                  '       d   YP"                  n        TP                  '       d   YP                  n        T#   \         d     \        P                  P                  4       hi ; ir0   )r   r2   rC   r;   r4   r5   r6   r7   r8   r9   r:   r#   r=   r>   r?   r@   rA   rD   )r   rE   oldChildrF   r=      &&&  r   replaceChildZNode.replaceChild   s    ; ;;++HX&$$X88D$:$::''--.28nd4jIK K*++H5	(OO))(3E "*""!99  $<<D!'33#+#;#; ##' ###3;$$03;  0!  	(''%%''	(s   F/ /*Gc                s    V P                   P                  V4       TP                  e   TP                  TP                  n        TP                  e   TP                  TP                  n        R ;Tn        Tn        TP                  \        9   d   \        T 4       R Tn        T#   \         d     \        P                  P                  4       hi ; ir"   )r#   remover>   r6   r7   r?   rC   rD   r   r@   rA   r:   r   rL      &&r   r;   ZNode.removeChild   s    	(OO""8, +3;3K3KH  0##/3;3G3GH$$0:>>x7 88D!"  	(''%%''	(s   B& &*Cc                sV   . pV P                    EF  pVP                  \        P                  8X  Ed!   VP                  '       g`   V'       d   VP
                  VR,          n        VP
                  '       d   VP                  VP
                  n        VP                  4        K  V'       d   VR,          P                  VP                  8X  dr   VR,          pVP                  VP                  ,           Vn        VP
                  Vn        VP
                  '       d   W2P
                  n        VP                  4        EK0  VP                  V4       EKD  VP                  V4       VP                  \        P                  8X  g   EKw  VP                  4        EK  	  WP                   R&   R# )r-   NNNNr.   )r#   r   r   	TEXT_NODEdatarC   rD   unlinkappendELEMENT_NODE	normalize)r   LchildrH      &   r   rX   ZNode.normalize   s   __E~~/zzz,1,=,=")(((<A<Q<Q))9LLN1R5>>U^^;R5D $		EJJ 6DI','8'8D$(((<@))9LLNHHUO>>T%6%66OO%- %. r   c                sB    \        YV P                  ;'       g    T 4      # r"   )_clone_nodeownerDocument)r   deeprQ   r   	cloneNodeZNode.cloneNode   s    4t'9'9'A'ATBBr   c                sL    V P                   P                  P                  W4      # r"   )r]   implementation
hasFeaturer   featureversionr   r   isSupportedZNode.isSupported   s    !!00;;GMMr   c                r   r"   r	   r
   r   r   _get_localNameZNode._get_localName   s    r   c                s    WJ # r"   r	   r   ZotherrQ   r   
isSameNodeZNode.isSameNode   s
    }r   c                :    V P                  VR 4      '       d   V # R # r"   )re   r   rc   rQ   r   getInterfaceZNode.getInterface   s    GT**Kr   c                sh     V P                   V,          ^ ,          #   \        \        3 d     R# i ; ir)   )
_user_dataAttributeErrorKeyErrorr   keyrQ   r   getUserDataZNode.getUserData   s2    	??3'**) 		s    11c                s    R p V P                   pW9   d   WQ,          ^ ,          pVf   R pVe   WQ V# W#3WQ&   V#   \         d    / pYPn          L?i ; ir"   )rl   rm   )r   rp   rT   handleroldds   &&&&  r   setUserDataZNode.setUserData   sm    	 A 8&)C<GF 
 _AF
  	 AO	 s   : AAc                s    \        V R 4      '       dK   \        V P                  P                  4       4       F!  w  pw  rVVf   K  VP	                  WWRV4       K#  	  R# R# )rl   N)hasattrlistrl   itemsZhandle)r   	operationZsrcZdstrp   rT   rr      &&&&   r   _call_user_data_handlerZNode._call_user_data_handler   sN    4&&(,T__-B-B-D(E$_d&NN94cB )F 'r   c                s    R ;V n         V n        V P                  '       d3   V P                   F  pVP                  4        K  	  \	        4       V n        R V n        R V n        R # r"   )r:   r]   r#   rU   NodeListrD   rC   )r   rZ      & r   rU   ZNode.unlink  sJ    /33$,??? )&jDO#r   c                s    V # r"   r	   r
   r   r   	__enter__ZNode.__enter__  s    r   c                s&    V P                  4        R # r"   )rU   )r   ZetZevZtb   &&&&r   __exit__ZNode.__exit__  s    r   )rl   r#   rC   r]   r:   rD   NN)	r   NN)$__name__
__module____qualname____firstlineno__namespaceURIr:   r]   rC   rD   r   prefixr   r   r   r$   r'   r+   r/   r4   r<   rN   r;   rX   r_   re   rf   rh   rk   rq   ru   r{   rU   r~   r   __static_attributes____classdictcell__Z__classdict__   @r   r   r   "   s     LJMKOF>.&%&'@"@ 6CN$C  r   r   
firstChildzFirst child node, or None.)doc	lastChildzLast child node, or None.	localNamez"Namespace-local name of this node.c                 s    V P                   pV'       d   VR,          pW1n        Wn        VP                  V4       Wn        R# r,   )r#   rD   rC   rV   r:   )r   rH   r#   Zlast   &&  r   rJ   rJ     s6    J"~#dOr   c                s   V'       g   R# RV9   d   VP                  RR4      pRV9   d   VP                  RR4      pRV9   d   VP                  RR4      pV'       de   RV9   d   VP                  RR	4      pR
V9   d   VP                  R
R4      pRV9   d   VP                  RR4      pRV9   d   VP                  RR4      pV P                  V4       R# )zWrites datachars to writer.NZ&z&amp;<z&lt;>z&gt;"z&quot;Zz&#13;r   z&#10;r   z&#9;)Zreplacewrite)r   Ztextattrr   r   _write_datar   (  s     d{||C)
d{||C(
d{||C($;<<X.D4<<<g.D4<<<g.D4<<<f-D
LLr   c                 s    V P                    FW  pVP                  \        P                  8X  d*   VR 8X  g   VP                  V8X  d   VP                  V4       \        W1V4       KY  	  V# r   )r#   r   r   rW   tagNamerV   _get_elements_by_tagName_helper)parentnamercrH      &&& r   r   r   ?  sR    !!==D---S[DLLD0IIdO'B7	 "
 Ir   c                 s   V P                    Fq  pVP                  \        P                  8X  g   K$  VR 8X  g   VP                  V8X  d*   VR 8X  g   VP
                  V8X  d   VP                  V4       \        WAW#4       Ks  	  V# r   )r#   r   r   rW   r   r   rV   "_get_elements_by_tagName_ns_helper)r   ZnsURIr   r   rH      &&&& r   r   r   G  sg    !!==D---c!T^^y%@#!2!2e!;		$.tIJ " Ir   c                   s   a  ] tR tRt o ]P
                  tRtRtRt	Rt
]P                  ]P                  ]P                  ]P                  ]P                  ]P                   ]P"                  3tR tRtV tR# )DocumentFragmentiP  z#document-fragmentNc                s$    \        4       V n        R # r"   )r|   r#   r
   r   r   __init__ZDocumentFragment.__init__^  s    "*r   r&   )r   r   r   r   r   r2   r   nodeName	nodeValue
attributesr:   rW   rS   CDATA_SECTION_NODEENTITY_REFERENCE_NODEPROCESSING_INSTRUCTION_NODECOMMENT_NODENOTATION_NODEr5   r   r   r   r   r   r   r   r   P  ss     **H#HIJJ**003399**++-% %r   r   c                   s  a  ] tR tRt o Rt]P                  tRtRt	Rt
]P                  ]P                  3t]RR3R ltR tR tR tR t]! ]]4      ;ttR	 tR
 t]! ]]4      ;ttR tR t]! ]]4      tR tR tR t Rt!V t"R# )Attrib  NFc                s    R V n         R V n        Wn        W n        W@n        Ve   W0n        \        4       V n        V P                  P                  \        4       4       R # r"   )
ownerElementr]   _namer   _prefix
_localNamer|   r#   rV   Text)r   qNamer   r   r      &&&&&r   r   ZAttr.__init__l  sL     !
( 'O"* 	tv&r   c                     V P                   #   \         d'    T P                  P                  R ^4      R,          u # i ; i:r.   )r   rm   r   splitr
   r   r   rf   ZAttr._get_localName|  s<    	3??" 	3==&&sA.r22	3    .??c                r%   r"   )	specifiedr
   r   r   _get_specifiedZAttr._get_specified      ~~r   c                r%   r"   )r   r
   r   r   	_get_nameZAttr._get_name      zzr   c                s\    Wn         V P                  e   \        V P                  4       R # R # r"   )r   r   rA   r   valuerQ   r   	_set_nameZAttr._set_name  s&    
(D--. )r   c                r%   r"   )_valuer
   r   r   
_get_valueZAttr._get_value      {{r   c                s    Wn         WP                  ^ ,          n        V P                  e   \	        V P                  4       WP                  ^ ,          n        R# r)   )r   r#   rT   r   rA   r   rQ   r   
_set_valueZAttr._set_value  s?    "'(D--."'r   c                r%   r"   )r   r
   r   r   _get_prefixZAttr._get_prefix      ||r   c                s>   V P                   pVR 8X  d3   V'       d+   V\        8w  d    \        P                  P	                  R4      hWn        Vf   V P                  pMV: RV P                  : 2pV P                  '       d   \        V P                  4       W0n	        R# )xmlnsz5illegal use of 'xmlns' prefix for the wrong namespaceNr   )
r   r   r6   r7   NamespaceErrr   r   r   rA   r   )r   r   ZnsuriZnewNamer   r   _set_prefixZAttr._set_prefix  s{    !!W/1gg**KM M>nnG!'8GD--.	r   c                s   V P                   pVe   VP                  V P                   VP                  V P                  V P
                  3 V P                  '       dD   RV n        V;P                  ^,          un        V P                  ;P                  ^,          un	        V P                   F  pVP                  4        K  	  V P                  R R # )NFrR   )r   _attrsr   _attrsNSr   r   _is_id_magic_id_nodesr]   _magic_id_countr#   rU   )r   elemrZ      &  r   rU   ZAttr.unlink  s    
   DMM*t00$..AB{{{#$$)$""22a72__ELLN %OOAr   c                sB   V P                   '       d   R # V P                  pV P                  pVe   Vf   R# VP                  V4      pVf   R# V P                  '       d'   VP                  V P                  V P                  4      # VP                  V P                  4      # TF)	r   r]   r   _get_elem_infor   isIdNSr   isIdr   r   r   r   infor[   r   	_get_isIdZAttr._get_isId  s    ;;;    ;$,!!$'<;;t00$..AA99T]]++r   c                s*   V P                   pV P                  pVe   Vf   \        # VP                  V4      pVf   \        # V P                  '       d'   VP                  V P                  V P                  4      # VP                  V P                  4      # r"   )	r]   r   _no_typer   r   getAttributeTypeNSr   getAttributeTyper   r   r[   r   _get_schemaTypeZAttr._get_schemaType  s~        ;$,O!!$'<O**4+<+<dnnMM((77r   )
r   r   r   r   r   r#   r   r   r]   r   )r   r   r   r   r#   r   r]   r   )#r   r   r   r   	__slots__r   ATTRIBUTE_NODEr   r   r   r   rS   r   r5   r    r   rf   r   r   r   propertyr   r   r   r   r   r   r   r   r   rU   r   r   r   r   r   r   r   r   r   b  s     WI""HJIF)C)CD+:d' 3/
 y)44Ht( !Z88I k;/F", 8 8r   r   r   z True if this attribute is an ID.z'Namespace-local name of this attribute.
schemaTypezSchema type for this attribute.c                   s   a  ] tR tRt o RtRtR tR tR tR t	R t
R tR	 tR
 tR tR R lt]tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR t R t!Rt"V t#R# )!NamedNodeMapi  zThe attribute list is a transient interface to the underlying
dictionaries.  Mutations here will change the underlying element's
dictionary.

Ordering is imposed artificially and does not reflect the order of
attributes as found in an input document.
c                s*    Wn         W n        W0n        R # r"   r   r   _ownerElement)r   attrsZattrsNSr   r   r   r   ZNamedNodeMap.__init__  s    )r   c                r!   r"   )lenr   r
   r   r   _get_lengthZNamedNodeMap._get_length  s    4;;r   c                s     V \        V P                  P                  4       4      V,          ,          #   \         d     R # i ; ir"   )rw   r   keys
IndexErrorr   r=   rQ   r   itemZNamedNodeMap.item  s;    	T[[--/0788 		s   03 AAc                s    . pV P                   P                  4        F*  pVP                  VP                  VP                  34       K,  	  V# r"   )r   valuesrV   r   r   r   rY   rH   r   r   rx   ZNamedNodeMap.items  s<    KK&&(DHHdmmTZZ01 )r   c                s    . pV P                   P                  4        F6  pVP                  VP                  VP                  3VP
                  34       K8  	  V# r"   )r   r   rV   r   r   r   r   r   r   itemsNSZNamedNodeMap.itemsNS  sG    KK&&(DHHt(($..94::FG )r   c                sf    \        V\        4      '       d   WP                  9   # WP                  9   # r"   )
isinstancestrr   r   ro   rQ   r   __contains__ZNamedNodeMap.__contains__  s)    c3++%%--''r   c                6    V P                   P                  4       # r"   )r   r   r
   r   r   r   ZNamedNodeMap.keys  s    {{!!r   c                r   r"   )r   r   r
   r   r   keysNSZNamedNodeMap.keysNS  s    }}!!##r   c                r   r"   )r   r   r
   r   r   r   ZNamedNodeMap.values  s    {{!!##r   Nc                8    V P                   P                  W4      # r"   r   get)r   r   r   r   r   r   ZNamedNodeMap.get  s    {{t++r   c                s    V P                   \        VR R4      J d   ^ # \        V 4      \        V4      8  \        V 4      \        V4      8  ,
          # )r   N)r   Zgetattridrg   rQ   r   _cmpZNamedNodeMap._cmp  s?    ;;'%488tHr%y(RX5	-ABBr   c                s*    V P                  V4      ^ 8H  # r*   r   rg   rQ   r   __eq__ZNamedNodeMap.__eq__"      yy1$$r   c                s*    V P                  V4      ^ 8  # r   r   rg   rQ   r   __ge__ZNamedNodeMap.__ge__%  r   r   c                s*    V P                  V4      ^ 8  # r   r   rg   rQ   r   __gt__ZNamedNodeMap.__gt__(      yy!##r   c                s*    V P                  V4      ^ 8*  # r   r   rg   rQ   r   __le__ZNamedNodeMap.__le__+  r   r   c                s*    V P                  V4      ^ 8  # r   r   rg   rQ   r   __lt__ZNamedNodeMap.__lt__.  r   r   c                sz    \        V\        4      '       d   V P                  V,          # V P                  V,          # r"   )r   r3   r   r   )r   attname_or_tuplerQ   r   __getitem__ZNamedNodeMap.__getitem__1  s0    &..==!122;;/00r   c                sb   \        V\        4      '       d    V P                  V,          pW#n        R# \        V\        4      '       g   \        R 4      hTpV P                  V4       R#   \         d;    \	        T4      pT P
                  P                  Tn        T P                  T4        Li ; i)z%value must be a string or Attr objectN)
r   r   r   rn   r   r   r]   setNamedItemr   	TypeError)r   attnamer   rH   r   r   __setitem__ZNamedNodeMap.__setitem__8  s    eS!!({{7+
 JeT** GHHDd#  (G}%)%7%7%E%E"!!$'(s   A) )AB.-B.c                sN     V P                   V,          #   \         d     R # i ; ir"   )r   rn   r   r   rQ   r   getNamedItemZNamedNodeMap.getNamedItemG  s(    	;;t$$ 		s    $$c                sP     V P                   W3,          #   \         d     R # i ; ir"   )r   rn   r   r   r   r   r   getNamedItemNSZNamedNodeMap.getNamedItemNSM  s+    	==,!:;; 		s    %%c                s<   V P                  V4      pVek   \        V P                  4       V P                  VP                   V P
                  VP                  VP                  3 \        VR4      '       d   R Vn	        V# \        P                  P                  4       hNr   )r  rA   r   r   r   r   r   r   rv   r   r6   r7   r?   r   r   nrK   r   removeNamedItemZNamedNodeMap.removeNamedItemS  sz    d#=D../AJJ'q~~q{{;<q.))!%H''%%''r   c                s<   V P                  W4      pVek   \        V P                  4       V P                  VP                  VP
                  3 V P                  VP                   \        VR4      '       d   R Vn	        V# \        P                  P                  4       hr  )r  rA   r   r   r   r   r   r   rv   r   r6   r7   r?   r   r   r   r
  r   r   removeNamedItemNSZNamedNodeMap.removeNamedItemNS_  sz    8=D../q~~q{{;<AJJ'q.))!%H''%%''r   c                s   \        V\        4      '       g9   \        P                  P	                  \        V4      : R \        V 4      : 24      hV P                  P                  VP                  4      pV'       d   VP                  4        WP                  VP                  &   WP                  VP                  VP                  3&   V P                  Vn        \        VP                  4       V# )r1   )r   r   r6   r7   r8   r9   r   r   r   rU   r   r   r   r   r   rA   )r   rH   rs   rK   r   r   ZNamedNodeMap.setNamedItemk  s    $%%''--.24j$t*EG Gkkoodii(JJL!%DII=At(($..9: ..))*
r   c                s$    V P                  V4      # r"   )r   r   rH   rQ   r   setNamedItemNSZNamedNodeMap.setNamedItemNSx  s      &&r   c                s`    W,          p\        VP                  4       VP                  4        R # r"   )rA   r   rU   )r   r   rH   rK   r   __delitem__ZNamedNodeMap.__delitem__{  s!    %))*r   c                sH    V P                   V P                  V P                  3# r"   r   r
   r   r   __getstate__ZNamedNodeMap.__getstate__  s    {{DMM4+=+===r   c                s0    Vw  V n         V n        V n        R # r"   r   r   ZstaterQ   r   __setstate__ZNamedNodeMap.__setstate__  s    9>6T]D$6r   r   r"   )$r   r   r   r   __doc__r   r   r   r   rx   r   r   r   r   r   r   __len__r   r   r   r   r   r   r   r  r  r  r  r  r   r  r  r  r  r   r   r   r   r   r   r     s      8I*
 ("$$, GC%%$%$1$
(
('
>? ?r   r   Zlengthz$Number of nodes in the NamedNodeMap.c                   s<   a  ] tR tRt o RtR tR tR tR tRt	V t
R# )	TypeInfoi  c                    Wn         W n        R # r"   	namespacer   )r   r  r   r   r   r   ZTypeInfo.__init__  s    "	r   c                s    V P                   '       d8   R V P                  P                  : RV P                  : RV P                   : R2# R V P                  P                  : RV P                  : R2# )r    z (from z)>r   )r  	__class__r   r   r
   r   r   __repr__ZTypeInfo.__repr__  sO    >>>*...*A*A499*...: :  !% 7 7CCr   c                r%   r"   )r   r
   r   r   r   ZTypeInfo._get_name      yyr   c                r%   r"   )r  r
   r   r   _get_namespaceZTypeInfo._get_namespace  r   r   )r   r  Nr  )r   r   r   r   r   r   r  r   r  r   r   r   r   r   r  r    s$     #ID r   r  c                   s  a  ] tR tRt o Rt]P                  tRt]	t
^ t]P                  ]P                  ]P                  ]P                  ]P                  ]P                   3t]RR3R ltR tR tR tR tR tR	 tR
 tR tR tR tR t]tR t R t!R t"]"t#R t$R t%R t&R t'R t(RR lt)R t*R t+R t,R t-R t.Rt/V t0R# ) Elementi  Nc                s    R V n         R V n        V;V n        V n        W0n        W n        \        4       V n        R ;V n        V n	        R V n
        R V n        R # r"   )r]   r:   r   r   r   r   r|   r#   rC   rD   r   r   )r   r   r   r   r   r   r   r   ZElement.__init__  sS    !'..t}("*2664/ r   c                sB    V P                   f   / V n         / V n        R # R # r"   )r   r   r
   r   r   _ensure_attributesZElement._ensure_attributes  s    ;;DKDM r   c                r   r   )r   rm   r   r   r
   r   r   rf   ZElement._get_localName  s<    	2??" 	2<<%%c1-b11	2r   c                r%   r"   r   r
   r   r   _get_tagNameZElement._get_tagName  r   r   c                s    V P                   e;   \        V P                   P                  4       4       F  pVP                  4        K  	  R V n         R V n        \
        P                  V 4       R # r"   )r   rw   r   rU   r   r   )r   r   r}   r   rU   ZElement.unlink  sK    ;;"T[[//12 3Dr   c                s    V P                   f   R#  V P                   V,          P                  #   \         d     R# i ; i)aV  Returns the value of the specified attribute.

Returns the value of the element's attribute named attname as
a string. An empty string is returned if the element does not
have such an attribute. Note that an empty string may also be
returned as an explicitly given attribute value, use the
hasAttribute method to distinguish these two cases.
r   )r   r   rn   )r   r  rQ   r   getAttributeZElement.getAttribute  s=     ;;	;;w'--- 		s   / >>c                s    V P                   f   R#  V P                   W3,          P                  #   \         d     R# i ; iNr   )r   r   rn   r  r   r   getAttributeNSZElement.getAttributeNS  s>    == 	==,!:;AAA 		s   0 ??c                s   V P                  V4      pVf6   \        V4      pW#n        V P                  Vn        V P	                  V4       R # W#P                  8w  d(   W#n        VP
                  '       d   \        V 4       R # R # R # r"   )getAttributeNoder   r   r]   setAttributeNoder   rA   )r   r  r   r   r   r   setAttributeZElement.setAttribute  sk    $$W-<=DJ!%!3!3D!!$'jj Jyyy%  !r   c                sZ   \        V4      w  rEV P                  W4      pVf7   \        W!WT4      pW6n        V P                  Vn        V P                  V4       R # W6P                  8w  d$   W6n        VP                  '       d   \        V 4       VP                  V8w  d   WFn        W&n	        R # R # r"   )
_nssplitgetAttributeNodeNSr   r   r]   r'  r   rA   r   r   )r   r   qualifiedNamer   r   	localnamer   rz   r   setAttributeNSZElement.setAttributeNS  s    $]3&&|?<YGDJ!%!3!3D!!$'

""
999#D){{f$$ - %r   c                sX    V P                   f   R # V P                   P                  V4      # r"   r   )r   ZattrnamerQ   r   r&  ZElement.getAttributeNode  s"    ;;{{x((r   c                sZ    V P                   f   R # V P                   P                  W34      # r"   )r   r   r  r   r   r*  ZElement.getAttributeNodeNS  s'    == }}  ,!:;;r   c                s   VP                   R V 39  d    \        P                  P                  R4      hV P	                  4        V P
                  P                  VP                  R 4      pVe   V P                  V4       V P                  P                  VP                  VP                  3R 4      pVe   W2Jd   V P                  V4       \        W4       W!Jd   V# W1Jd   V# R # )Nzattribute node already owned)r   r6   r7   ZInuseAttributeErrr   r   r   r   removeAttributeNoder   r   r   _set_attribute_node)r   r   Zold1Zold2r   r   r'  ZElement.setAttributeNode  s    T4L0''++,JKK!{{tyy$/$$T*}}  $"3"3T^^!DdK 0$$T*D' KK r   c                s   V P                   f   \        P                  P                  4       h V P                  V,          pT P                  T4       R #   \
         d     \        P                  P                  4       hi ; ir"   )r   r6   r7   r?   r   rn   r.  )r   r   r   rK   r   removeAttributeZElement.removeAttribute2  sf    == ''%%''	(;;t$D 	  &  	(''%%''	(s   A *A>c                s   V P                   f   \        P                  P                  4       h V P                   W3,          pT P                  T4       R #   \         d     \        P                  P                  4       hi ; ir"   )r   r6   r7   r?   rn   r.  )r   r   r   r   r   r   removeAttributeNSZElement.removeAttributeNS;  si    == ''%%''	(==,!:;D 	  &  	(''%%''	(s   A *A?c                s8   Vf   \         P                  P                  4       h V P                  VP                  ,           \        T 4       TP                  4        T P                  Tn        T#   \
         d     \         P                  P                  4       hi ; ir"   )	r6   r7   r?   r   r   rn   rA   rU   r]   r  rQ   r   r.  ZElement.removeAttributeNodeD  s{    <''%%''	(KK		" 	 "//  	(''%%''	(s   A/ /*Bc                s>    V P                   f   R# WP                   9   # )zChecks whether the element has an attribute with the specified name.

Returns True if the element has an attribute with the specified name.
Otherwise, returns False.
Fr   r  rQ   r   hasAttributeZElement.hasAttributeT  s     ;;{{""r   c                sB    V P                   f   R# W3V P                   9   # )NF)r   r  r   r   hasAttributeNSZElement.hasAttributeNS^  s!    == (DMM99r   c                *    \        W\        4       4      # )zReturns all descendant elements with the given tag name.

Returns the list of all descendant elements (not direct children
only) with the specified tag name.
r   r|   r  rQ   r   getElementsByTagNameZElement.getElementsByTagNamec  s     /t8:FFr   c                ,    \        WV\        4       4      # r"   r   r|   r  r   r   getElementsByTagNameNSZElement.getElementsByTagNameNSk      1	8:7 	7r   c                s>    R V P                   \        V 4      3,          # )z<DOM Element: %s at %#x>)r   r   r
   r   r   r  ZElement.__repr__o  s    )T\\2d8,DDDr   c                s   VP                  VR,           V P                  ,           4       V P                  4       pVP                  4        FI  pVP                  RV,          4       \	        WV,          P
                  R4       VP                  R4       KK  	  V P                  '       Ed   VP                  R4       \        V P                  4      ^8X  dg   V P                  ^ ,          P                  \        P                  \        P                  39   d'   V P                  ^ ,          P                  VRRR4       MNVP                  V4       V P                   F  pVP                  WV,           W44       K  	  VP                  V4       VP                  RV P                  : RV: 24       R	# VP                  RV,          4       R	# )
zWrite an XML element to a file-like object

Write the element to the writer object that must provide
a write method (e.g. a file or StringIO object).
r   z %s="Tr   r   r   z</z/>%sN)r   r   _get_attributesr   r   r   r#   r   r   r   rS   r   r   )r   r   r   	addindentr   r   Za_namerH   s   &&&&&   r   r   ZElement.writexmlr  s<    	VCZ$,,./$$&jjlFLLF*+f 3 3T:LL # ???LLDOO$)"++(?(?0A A"++FBB?T" OODMM&*:IL ,V$LLdllD9:LL'r   c                sd    V P                  4        \        V P                  V P                  V 4      # r"   )r   r   r   r   r
   r   r   r<  ZElement._get_attributes  s%    !DKK==r   c                s.    V P                   '       d   R # R# r   r2  r
   r   r   hasAttributesZElement.hasAttributes  s    ;;;r   c                sJ    V P                  V4      pV P                  V4       R # r"   )r&  setIdAttributeNode)r   r   idAttrrK   r   setIdAttributeZElement.setIdAttribute  s     &&t,'r   c                sJ    V P                  W4      pV P                  V4       R # r"   )r*  r?  )r   r   r   r@  r   r   setIdAttributeNSZElement.setIdAttributeNS  s     ((A'r   c                s   Ve"   V P                  VP                  4      '       g   \        P                  P	                  4       h\        V 4      e   \        P                  P                  4       hVP                  '       gQ   RVn        V ;P                  ^,          un        V P                  ;P                  ^,          un
        \        V 4       R # R # )NT)rh   r   r6   r7   r?   _get_containing_entrefNoModificationAllowedErrr   r   r]   r   rA   )r   r@  rQ   r   r?  ZElement.setIdAttributeNode  s    >1D1D!E!E''%%''!$'3''2244}}} FM  A% ..!3.D!	 r   )r   r   r#   r   rC   r   r]   r:   r   rD   r   )r]   r:   r   r   r   r   r   r#   r   r   rC   rD   r   r   r   )1r   r   r   r   r   r   rW   r   r   r   r   r   r   r   rS   r   r   r5   r    r   r   rf   r"  rU   r#  r%  r(  r-  r&  r*  r'  ZsetAttributeNodeNSr0  r1  r.  ZremoveAttributeNodeNSr3  r4  r7  r:  r  r   r<  r>  rA  rB  r?  r   r   r   r   r   r  r    s    1I   HIJO**99**00335 .=T*
2 
&.")
<
& *'' 0#:
G7E(@>((	" 	"r   r  r   z*NamedNodeMap of attributes on the element.z%Namespace-local name of this element.c                 s    \        V 4       V P                  4        WP                  VP                  &   WP                  VP
                  VP                  3&   Wn        R # r"   )rA   r   r   r   r   r   r   r   )elementr   rQ   r   r/  r/    sK    G  $NN499<@d''89
  r   c                   sr   a  ] tR tRt o RtRtRt]! 4       tRt	Rt
R tR tR tR tR tR	 tR
 tR tRtV tR# )	Childlessi  zyMixin that makes childless-ness easy to implement and avoids
the complexity of the Node methods that deal with children.
Nc                r   r"   r	   r
   r   r   r+   ZChildless._get_firstChild  r   r   c                r   r"   r	   r
   r   r   r/   ZChildless._get_lastChild  r   r   c                b    \         P                  P                  V P                  R ,           4      h)z nodes cannot have childrenr6   r7   r8   r   r  rQ   r   r<   ZChildless.appendChild  &    gg))MM99; 	;r   c                r   Fr	   r
   r   r   r$   ZChildless.hasChildNodes      r   c                rH  z nodes do not have childrenrI  r   rE   rF   r   r   r4   ZChildless.insertBefore  rJ  r   c                rH  rM  )r6   r7   r?   r   rP   rQ   r   r;   ZChildless.removeChild  s&    gg!!MM99; 	;r   c                r   r"   r	   r
   r   r   rX   ZChildless.normalize  s    r   c                rH  rM  rI  r   rE   rL   r   r   rN   ZChildless.replaceChild  rJ  r   r	   )r   r   r   r   r  r   r   ZEmptyNodeListr#   r   r   r+   r/   r<   r$   r4   r;   rX   rN   r   r   r   r   r   rG  rG    sT      IJJJI;;;; ;r   rG  c                   s   a  ] tR tRt o ]P
                  tR
tR tR t	R t
]! ]	]
4      tR tR t]! ]]4      tRR ltRtV tR	# )ProcessingInstructioni  c                r  r"   targetrT   )r   rR  rT   r   r   r   ZProcessingInstruction.__init__  s    	r   c                r%   r"   rT   r
   r   r   _get_nodeValueZ$ProcessingInstruction._get_nodeValue  r  r   c                    Wn         R # r"   rS  r   rQ   r   _set_nodeValueZ$ProcessingInstruction._set_nodeValue  s    	r   c                r%   r"   rR  r
   r   r   _get_nodeNameZ#ProcessingInstruction._get_nodeName  r   r   c                rU  r"   rW  r   rQ   r   _set_nodeNameZ#ProcessingInstruction._set_nodeName  s    r   c           	     sn    VP                  V: R V P                  : RV P                  : RV: 24       R# )z<?r  ?>N)r   rR  rT   r   r   r   r=  r   r   r   r   ZProcessingInstruction.writexml  s    t{{DIItLMr   )rT   rR  NrQ  rE  )r   r   r   r   r   r   r   r   r   rT  rV  r   r   rX  rY  r   r   r   r   r   r   r   rP  rP    sR     //H"I
8I}5HN Nr   rP  c                   sz   a  ] tR tRt o RtR tR t]tR tR t	]
! ]]	4      ;ttR tR tR tR	 tR
 tR tRtV tR# )CharacterDatai  c                sv    R ;V n         V n        R ;V n        V n        RV n        \
        P                  V 4       R # r$  )r]   r:   rD   rC   _datar   r   r
   r   r   r   ZCharacterData.__init__  s4    /33T_266t/
dr   c                r!   r"   )r   rT   r
   r   r   r   ZCharacterData._get_length      499~r   c                r%   r"   r]  r
   r   r   	_get_dataZCharacterData._get_data  r   r   c                rU  r"   r_  r   rT   rQ   r   	_set_dataZCharacterData._set_data  s    
r   c                s    V P                   p\        V4      ^
8  d   RpMRpRV P                  P                  : RVR,          : V: R2# )
   z...r   z<DOM z node ":r*   rc  Nz">)rT   r   r  r   )r   rT   Z	dotdotdotr   r   r  ZCharacterData.__repr__  s@    yyt9r>IINN##T$Z< 	<r   c                s6   V^ 8  d    \         P                  P                  R4      hV\        V P                  4      8  d    \         P                  P                  R4      hV^ 8  d    \         P                  P                  R4      hV P                  WV,            # )r*   offset cannot be negative#offset cannot be beyond end of datacount cannot be negativer6   r7   IndexSizeErrr   rT   r   offsetcountr   r   substringDataZCharacterData.substringData"  su    A:''&&'BCCS^#''&&'LMM19''&&'ABByyu--r   c                s6    V P                   V,           V n         R # r"   rS  )r   argrQ   r   
appendDataZCharacterData.appendData+  s    IIO	r   c                s,   V^ 8  d    \         P                  P                  R4      hV\        V P                  4      8  d    \         P                  P                  R4      hV'       d-   V P                  RV : V: V P                  VR : 2V n        R# R# )r*   rd  re  Nrg  )r   rj  rm  r   r   
insertDataZCharacterData.insertData.  ss    A:''&&'BCCS^#''&&'LMM		'6"C67);=DI r   c                s   V^ 8  d    \         P                  P                  R4      hV\        V P                  4      8  d    \         P                  P                  R4      hV^ 8  d    \         P                  P                  R4      hV'       d1   V P                  RV V P                  W,           R ,           V n        R# R# r*   rd  re  rf  Nrg  ri  r   r   
deleteDataZCharacterData.deleteData7  s    A:''&&'BCCS^#''&&'LMM19''&&'ABB		'6*TYYv|}-EEDI r   c                s   V^ 8  d    \         P                  P                  R4      hV\        V P                  4      8  d    \         P                  P                  R4      hV^ 8  d    \         P                  P                  R4      hV'       d3   V P                  RV : V: V P                  W,           R : 2V n        R# R# rp  rg  )r   rj  rk  rm  r   r   replaceDataZCharacterData.replaceDataA  s    A:''&&'BCCS^#''&&'LMM19''&&'ABB		'6"C6<=)ACDI r   )r]  rT   rC   r]   r:   rD   N)r]  r]   r:   rD   rC   )r   r   r   r   r   r   r   r  r`  rb  r   rT   r   r  rl  rn  ro  rq  rr  r   r   r   r   r   r\  r\    s\     WIG  	955D9<.$=F	C 	Cr   r\  zLength of the string data.c                   sf   a  ] tR tRt o R
t]P                  tRtRt	R t
RR ltR tR tR tR	tV tR# )r   iO  z#textNc                s   V^ 8  g   V\        V P                  4      8  d    \        P                  P	                  R4      hV P                  4       pV P                  VR Vn        V P                  Vn        V P                  pV P                  '       dV   W P                  P                  9   d<   Vf   V P                  P                  V4       MV P                  P                  W#4       V P                  RV V n        V# )r*   zillegal offset valueN)r   rT   r6   r7   rh  r  r]   rC   r:   r#   r<   r4   )r   rj  ZnewTextnextr   r   	splitTextZText.splitTextV  s    A:#dii.0''&&'=>>.."yy) $ 2 2???t'A'AA|++G4,,W;IIgv&	r   c                sD    \        W: V P                  : V: 2R 4       R# )FN)r   rT   r[  r   r   r   ZText.writexmle  s    F		4@%Hr   c                s   V P                   .pV P                  pVe[   VP                  \        P                  \        P
                  39   d+   VP                  ^ VP                   4       VP                  pK]   V P                  pVeZ   VP                  \        P                  \        P
                  39   d*   VP                  VP                   4       VP                  pK\   RP                  V4      # r$  )
rT   rD   r   r   rS   r   rB   rC   rV   join)r   rY   r
  r   r   _get_wholeTextZText._get_wholeTextj  s    YYK  mzzdnnd.E.EFFAFF#%%mzzdnnd.E.EFF MMwwqzr   c                s   V P                   pV P                  pVeR   VP                  \        P                  \        P
                  39   d"   VP                  pVP                  V4       TpKT   V P                  pV'       g   VP                  V 4       VeR   VP                  \        P                  \        P
                  39   d"   VP                  pVP                  V4       TpKT   V'       d	   Wn        V # R # r"   )	r:   rD   r   r   rS   r   r;   rC   rT   )r   Zcontentr   r
  rs     &&   r   replaceWholeTextZText.replaceWholeText|  s       mzzdnnd.E.EFF((""1%t$mzzdnnd.E.EFF}}""1%IKr   c                s    V P                   P                  4       '       d   R # \        V 4      pVf   R # V P                  P	                  V4      pVf   R # VP                  4       # rK  )rT   Zstrip_get_containing_elementr]   r   isElementContent)r   r   r   r   r   !_get_isWhitespaceInElementContentZ&Text._get_isWhitespaceInElementContent  sU    99??&t,<!!006<((**r   rS  r	   rE  )r   r   r   r   r   r   rS   r   r   r   rt  r   rv  rx  r{  r   r   r   r   r   r   r   O  s<     I~~HHJI
$8
+ 
+r   r   ZisWhitespaceInElementContentzKTrue iff this text node contains only whitespace and is in element content.Z	wholeTextz.The text of all logically-adjacent text nodes.c                     V P                   pVe0   VP                  \        P                  8X  d   V# VP                   pK3  R # r"   )r:   r   r   rW   rH   rG   r}   r   ry  ry    s3    A
-::***HLLr   c                 r|  r"   )r:   r   r   r   r}  r}   r   rC  rC    s3    A
-::333HLLr   c                   sL   a  ] tR tRt o ]P
                  tRtR tRR lt	Rt
V tR# )Commenti  z#commentc                s<    \         P                  V 4       Wn        R # r"   )r\  r   r]  ra  rQ   r   r   ZComment.__init__  s    t$
r   c                s    R V P                   9   d   \        R4      hVP                  V: RV P                   : RV: 24       R# )z--z%'--' is not allowed in a comment nodez<!--z-->N)rT   r>   r   r[  r   r   r   ZComment.writexml  s1    499DEE		4@Ar   r_  NrE  )r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r~  r~    s&       HHB Br   r~  c                   sJ   a  ] tR tRt o Rt]P                  tRtRR lt	Rt
V tR# )CDATASectioni  z#cdata-sectionc                s    V P                   P                  R 4      ^ 8  d   \        R4      hVP                  RV P                   ,          4       R# )z]]>z$']]>' not allowed in a CDATA sectionz<![CDATA[%s]]>N)rT   Zfindr>   r   r[  r   r   r   ZCDATASection.writexml  s9    99>>% A%CDD%		12r   r	   NrE  )r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r    s$     I&&HH3 3r   r  c                   sv   a  ] tR tRt o RtRR ltR tR tR tR t	R t
R tR	 tR
 tR tR tR tR tRtV tR# )ReadOnlySequentialNamedNodeMapi  c                rU  r"   _seq)r   ZseqrQ   r   r   Z'ReadOnlySequentialNamedNodeMap.__init__  s    	r   c                r!   r"   r   r  r
   r   r   r  Z&ReadOnlySequentialNamedNodeMap.__len__  r^  r   c                r!   r"   r  r
   r   r   r   Z*ReadOnlySequentialNamedNodeMap._get_length  r^  r   c                sV    V P                    F  pVP                  V8X  g   K  Vu # 	  R # r"   )r  r   r	  rK   r   r  Z+ReadOnlySequentialNamedNodeMap.getNamedItem  s!    AzzT! r   c                s|    V P                    F+  pVP                  V8X  g   K  VP                  V8X  g   K)  Vu # 	  R # r"   )r  r   r   r  r   r   r  Z-ReadOnlySequentialNamedNodeMap.getNamedItemNS  s,    A~~-!++2J r   c                s    \        V\        4      '       d   V P                  ! V!  pMV P                  V4      pVf   \	        V4      hV# r"   )r   r3   r  r  rn   )r   Zname_or_tuplerH   rK   r   r   Z*ReadOnlySequentialNamedNodeMap.__getitem__  sD    mU++&&6D$$]3D<=))r   c                s`    V^ 8  d   R#  V P                   V,          #   \         d     R# i ; ir)   )r  r   r   rQ   r   r   Z#ReadOnlySequentialNamedNodeMap.item  s2    19	99U## 		s    --c                @    \         P                  P                  R 4      hz"NamedNodeMap instance is read-onlyr6   r7   rD  r  rQ   r   r  Z.ReadOnlySequentialNamedNodeMap.removeNamedItem      gg..02 	2r   c                r  r  r  r  r   r   r  Z0ReadOnlySequentialNamedNodeMap.removeNamedItemNS  r  r   c                r  r  r  r  rQ   r   r   Z+ReadOnlySequentialNamedNodeMap.setNamedItem  r  r   c                r  r  r  r  rQ   r   r  Z-ReadOnlySequentialNamedNodeMap.setNamedItemNS
  r  r   c                s    V P                   .# r"   r  r
   r   r   r  Z+ReadOnlySequentialNamedNodeMap.__getstate__  s    		{r   c                s"    V^ ,          V n         R# r)   r  r  rQ   r   r  Z+ReadOnlySequentialNamedNodeMap.__setstate__  s    !H	r   r  N)r	   )r   r   r   r   r   r   r  r   r  r  r   r   r  r  r   r  r  r  r   r   r   r   r   r  r    sP     I

2222 r   r  z&Number of entries in the NamedNodeMap.c                   s:   a  ] tR tRt o RtRtR tR tR tRt	V t
R# )
Identifiedi  z@Mix-in class that supports the publicId and systemId attributes.c                r  r"   publicIdsystemId)r   r  r  r   r   _identified_mixin_initZ!Identified._identified_mixin_init  s      r   c                r%   r"   )r  r
   r   r   _get_publicIdZIdentified._get_publicId!      }}r   c                r%   r"   )r  r
   r   r   _get_systemIdZIdentified._get_systemId$  r  r   r  N)r   r   r   r   r  r   r  r  r  r   r   r   r   r   r  r    s!     J&I! r   r  c                   sh   a  ] tR tRt o ]P
                  tRtRtRt	Rt
RtR tR tR tRR ltRtV tR# )	DocumentTypei'  Nc                s    \        4       V n        \        4       V n        V'       d   \        V4      w  r#W0n        V P                  V n        R # r"   )r  entities	notationsr)  r   r   )r   r+  r   r,  r   r   r   ZDocumentType.__init__/  s6    6879 ( 7F!I		r   c                r%   r"   )internalSubsetr
   r   r   _get_internalSubsetZ DocumentType._get_internalSubset7      """r   c                s   V P                   Ef   \        R 4      pV P                  Vn        V P                  Vn        \        P
                  P                  P                  pV'       Ed_   . VP                  n	        . VP                  n	        V P                  P                   Fe  p\        VP                  VP                  VP                  4      pVP                  P                  P                  V4       VP                  W4V4       Kg  	  V P                  P                   F  p\!        VP                  VP                  VP                  VP"                  4      pVP$                  Vn        VP&                  Vn        VP(                  Vn        VP                  P                  P                  V4       VP                  W6V4       K  	  V P                  W0V4       V# R # r"   )r]   r  r   r   r6   r7   UserDataHandlerNODE_CLONEDr  r  r  Notationr  r  rV   r{   EntitynotationNameactualEncodingr   rd   )r   r^   clonery   r
  notationeentity   &&      r   r_   ZDocumentType.cloneNode:  sU   % &EEJ!YYEN//;;It&(#')$,,A'

AJJ

KHOO((//9--iHE - ++A#AJJ

AJJ$%NN4F,-,<,<F)&'jjFO%&YYFNNN''..v6--iFC , ((%@Lr   c           
     s   VP                  R 4       VP                  V P                  4       V P                  '       d7   VP                  V: RV P                  : RV: RV P                  : R24       M5V P                  '       d$   VP                  V: RV P                  : R24       V P                  e>   VP                  R4       VP                  V P                  4       VP                  R4       VP                  RV,           4       R# )	z
<!DOCTYPE z
  PUBLIC 'Z'z  'z
  SYSTEM 'Nz [Z]r   )r   r   r  r  r  r[  r   r   r   ZDocumentType.writexmlU  s    \"TYY===LL $--t}}F G]]]LLdDMMBC*LLLL,,-LLSXr   )r  r   r   r  rE  )r   r   r   r   r   DOCUMENT_TYPE_NODEr   r   r   r  r  r  r   r  r_   r   r   r   r   r   r   r  r  '  sB     &&HIDHHN"#6 r   r  c                   s|   a  ] tR tRt o Rt]P                  tRtRt	Rt
RtR tR tR tR tR tR tR	 tR
 tRtV tR# )r  ic  Nc                s^    Wn         W@n        \        4       V n        V P	                  W#4       R # r"   )r   r  r|   r#   r  )r   r   r  r  r  r   r   r   ZEntity.__init__l  s$    $"*##H7r   c                r%   r"   r  r
   r   r   _get_actualEncodingZEntity._get_actualEncodingr  r  r   c                r%   r"   r   r
   r   r   _get_encodingZEntity._get_encodingu  r  r   c                r%   r"   rd   r
   r   r   _get_versionZEntity._get_versionx  r   r   c                r  )z(cannot append children to an entity noder6   r7   r8   )r   rE   rQ   r   r<   ZEntity.appendChild{  s    gg))68 	8r   c                r  )z+cannot insert children below an entity noder  rN  r   r   r4   ZEntity.insertBefore  s    gg))9; 	;r   c                r  )z*cannot remove children from an entity noder  rP   rQ   r   r;   ZEntity.removeChild  s    gg))8: 	:r   c                r  )z)cannot replace children of an entity noder  rO  r   r   rN   ZEntity.replaceChild  s    gg))79 	9r   )r#   r   r  )r   r   r   r   r   r   ZENTITY_NODEr   r   r  r   rd   r   r  r  r  r<   r4   r;   rN   r   r   r   r   r   r  r  c  sV     JHINHG8#8;:9 9r   r  c                   sB   a  ] tR tRt o ]P
                  tRtR tRt	V t
R# )r  i  Nc                s4    Wn         V P                  W#4       R # r"   )r   r  )r   r   r  r  r   r   r   ZNotation.__init__  s    ##H7r   )r   )r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r    s     !!HI8 8r   r  c                   sF   a  ] tR tRt o . R	OtR tR tR tR tR t	Rt
V tR# )
DOMImplementationi  Nc                sR    VR 8X  d   RpVP                  4       V3V P                  9   # )r   N)Zlower	_featuresrb   r   r   ra   ZDOMImplementation.hasFeature  s(    b=G)T^^;;r   c                s   V'       d.   VP                   e    \        P                  P                  R4      hV P	                  4       pVR J ;'       d    VR J ;'       d    VR J '       * pV'       g(   V'       d    \        P                  P                  R4      hV'       d   \        V4      w  rgVR8X  d'   VR8w  d    \        P                  P                  R4      hV'       d(   V'       g    \        P                  P                  R4      hVP                  W4      pV'       d   VP                  V4       VP                  V4       V'       d   V;Vn         Vn
        W4n        Wn        V# )Nz(doctype object owned by another DOM treezElement with no namer6   z$http://www.w3.org/XML/1998/namespacezillegal use of 'xml' prefixz(illegal use of prefix without namespaces)r:   r6   r7   WrongDocumentErr_create_documentZInvalidCharacterErrr)  r   createElementNSr<   r]   doctyper`   )	r   r   r+  r  r   Zadd_root_elementr   r,  rF  s	   &&&&     r   createDocumentZ DOMImplementation.createDocument  s0   w))5''**:< <##% , 4 !4 !4$1T$9!4 !4$+tO5 !1 ''--.DEE ( 7F#IIgg**+HIIlgg**>@ @)),FG(OOG$9<<G!6!
r   c                s4    \        V4      pW$n        W4n        V# r"   )r  r  r  )r   r+  r  r  r  r   r   createDocumentTypeZ$DOMImplementation.createDocumentType  s    }-##r   c                ri   r"   )ra   rj   rQ   r   rk   ZDOMImplementation.getInterface  s    ??7D))Kr   c                s    \        4       # r"   )Documentr
   r   r   r  Z"DOMImplementation._create_document  s
    zr   r	   ))core1.0)r  2.0)r  N)r6   r  )r6   r  )r6   N)ls-loadz3.0)r  N)r   r   r   r   r  ra   r  r  rk   r  r   r   r   r   r   r  r    s+     I<
+Z r   r  c                   s^   a  ] tR tRt o RtRtR tR tR tR t	R t
R tR	 tR
 tR tRtV tR# )ElementInfoi  zObject that represents content-model information for an element.

This implementation is not expected to be used in practice; DOM
builders should provide implementations which do the right thing
using information available to it.

c                rU  r"   r!  r  rQ   r   r   ZElementInfo.__init__  s    r   c                    \         # r"   r   r   ZanamerQ   r   r   ZElementInfo.getAttributeType      r   c                r  r"   r  r  r   r   r   ZElementInfo.getAttributeTypeNS  r  r   c                r   rK  r	   r
   r   r   rz  ZElementInfo.isElementContent  rL  r   c                    R# )zIReturns true iff this element is declared to have an EMPTY
content model.Fr	   r
   r   r   isEmptyZElementInfo.isEmpty  s     r   c                r  )z7Returns true iff the named attribute is a DTD-style ID.Fr	   r  rQ   r   r   ZElementInfo.isId      r   c                r  )z<Returns true iff the identified attribute is a DTD-style ID.Fr	   r  r   r   r   ZElementInfo.isIdNS  r  r   c                r%   r"   r!  r
   r   r   r  ZElementInfo.__getstate__  r   r   c                rU  r"   r!  r  rQ   r   r  ZElementInfo.__setstate__
  s    r   r!  N)r   r   r   r   r  r   r   r   r   rz  r  r   r   r  r  r   r   r   r   r   r  r    sC      I
 r   r  c                 s   V P                   \        P                  8X  d$   V P                  P	                  4        R V n        R # V P                  '       d8   V P                  P                  P	                  4        R V P                  n        R # R # r"   )r   r   r   	_id_cacheclear_id_search_stackr]   )rH   r   r   rA   rA     sc    }}*** $				$$**,-1+ 
r   c                   s  a  ] tR tRt o R't]P                  ]P                  ]P                  ]P                  3t
]! 4       t]P                  tRtRtRtRtR;ttRtRtRtRtRtRtRt^ tR tR tR tR t R	 t!R
 t"R t#R t$R t%R t&R t'R t(R t)R t*R t+R t,R t-R t.R t/R t0R t1R t2R t3R t4R t5R t6R t7R  t8R! t9R" t:R# t;R(R$ lt<R% t=R&t>V t?R# ))r  i  z	#documentNFc                s\    R V n         \        4       V n        / V n        / V n        R V n        R # r"   )r  r|   r#   
_elem_infor  r  r
   r   r   r   ZDocument.__init__0  s*    "*  $r   c                s    VP                   '       d   VP                   VP                  3pMVP                  pV P                  P	                  V4      # r"   )r   r   r   r  r   )r   rF  rp   rK   r   r   ZDocument._get_elem_info9  sB    &&(9(99C//C""3''r   c                r%   r"   r  r
   r   r   r  ZDocument._get_actualEncoding@  r  r   c                r%   r"   )r  r
   r   r   _get_doctypeZDocument._get_doctypeC  r   r   c                r%   r"   )documentURIr
   r   r   _get_documentURIZDocument._get_documentURIF  s    r   c                r%   r"   r  r
   r   r   r  ZDocument._get_encodingI  r  r   c                r%   r"   )errorHandlerr
   r   r   _get_errorHandlerZDocument._get_errorHandlerL  s       r   c                r%   r"   )r   r
   r   r   _get_standaloneZDocument._get_standaloneO  r(   r   c                r%   r"   )strictErrorCheckingr
   r   r   _get_strictErrorCheckingZ!Document._get_strictErrorCheckingR  s    '''r   c                r%   r"   r  r
   r   r   r  ZDocument._get_versionU  r   r   c                s   VP                   V P                  9  d9   \        P                  P	                  \        V4      : R \        V 4      : 24      hVP                  e   VP                  P                  V4       VP                   \        P                  8X  d6   V P                  4       '       d    \        P                  P	                  R4      h\        P                  W4      # )r1   z two document elements disallowed)r   r5   r6   r7   r8   r9   r:   r;   r   rW   _get_documentElementr<   r  rQ   r   r<   ZDocument.appendChildX  s    == 6 66''--.24j$t*EG G??& OO''-==D---((**''--24 4++r   c                s     V P                   P                  V4       R ;Tn        Tn        R Tn        T P                  TJ d   R T n	        T#   \         d     \        P                  P                  4       hi ; ir"   )
r#   rO   r>   r6   r7   r?   rC   rD   r:   documentElementrP   rQ   r   r;   ZDocument.removeChildh  sr    	(OO""8, ;?>x7"8+#'D   	(''%%''	(s   A *A5c                sr    V P                    F&  pVP                  \        P                  8X  g   K$  Vu # 	  R # r"   )r#   r   r   rW   r  r}   r   r  ZDocument._get_documentElementt  s'    OOD}} 1 11 $r   c                s    V P                   e"   V P                   P                  4        R V n         \        P                  V 4       R # r"   )r  rU   r   r
   r   r   rU   ZDocument.unlinky  s/    <<#LL!DLDr   c                s,   V'       g   R # V P                   P                  R R R 4      pV P                  Vn        V P                  Vn        V P                  Vn        V P
                   Fu  p\        W1V4      pVP
                  P                  V4       VP                  \        P                  8X  d   M%VP                  \        P                  8X  d   WBn        W$n        Kw  	  V P                  \        P                   P"                  P$                  W4       V# r"   )r`   r  r   r   rd   r#   r\   rV   r   r   r   r  r  r:   r{   r6   r7   r  r  )r   r^   r  r
  Z
childclonerw  r   r_   ZDocument.cloneNode  s    ##224tD??A$Qe4J##J/""d&8&88$$(?(?? *$)! ! 	$$SWW%<%<%H%H%)	2r   c                s&    \        4       pWn        V# r"   )r   r]   )r   rt   r}   r   createDocumentFragmentZDocument.createDocumentFragment  s    r   c                (    \        V4      pWn        V# r"   )r  r]   )r   r   r  rK   r   createElementZDocument.createElement  s    Gr   c                t    \        V\        4      '       g   \        R 4      h\        4       pWn        Wn        V# znode contents must be a string)r   r   r  r   rT   r]   )r   rT   ZtrK   r   createTextNodeZDocument.createTextNode  s1    $$$<==Fr   c                r  r  )r   r   r  r  rT   r]   r   rT   rG   rK   r   createCDATASectionZDocument.createCDATASection  s1    $$$<==Nr   c                r  r"   )r~  r]   r  rK   r   createCommentZDocument.createComment  s    DMr   c                s(    \        W4      pWn        V# r"   )rP  r]   )r   rR  rT   Zpr   r   createProcessingInstructionZ$Document.createProcessingInstruction  s    !&/r   c                s6    \        V4      pWn        R Vn        V# r   )r   r]   r   )r   r   arK   r   createAttributeZDocument.createAttribute  s    Kr   c                sD    \        V4      w  r4\        W!V4      pWn        V# r"   )r)  r  r]   )r   r   r+  r   r   r  rI   r   r  ZDocument.createElementNS  s%    $]3M8r   c                sR    \        V4      w  r4\        W!WC4      pWn        R Vn        V# r   )r)  r   r]   r   )r   r   r+  r   r   r  rI   r   createAttributeNSZDocument.createAttributeNS  s,    $]3i@r   c                s*    \        WW44      pWn        V# r"   )r  r]   )r   r   r  r  r  r  r    r   _create_entityZDocument._create_entity  s    48:r   c                s*    \        WV4      pWn        V# r"   )r  r]   )r   r   r  r  r
  r   r   _create_notationZDocument._create_notation  s    TX.r   c                s   WP                   9   d   V P                   V,          # V P                  '       g   V P                  '       g   R # V P                  pVf   V P                  .pW n        M
V'       g   R # R pV'       EdM   VP                  4       pTP                  VP                   Uu. uF  pVP                  \        9   g   K  VNK  	  up4       V P                  V4      pV'       Edc   VP                  P                  4        EFB  pVP                  '       ds   VP                  VP                  VP                  4      '       dE   W@P                   VP                   &   VP                   V8X  d   TpKo  VP"                  '       g    EM8K  K  VP%                  VP&                  4      '       dD   W@P                   VP                   &   VP                   V8X  d   TpK  VP"                  '       g    MK  VP(                  '       g   EK  W@P                   VP                   &   VP                   V8X  d   TpEK/  VP"                  ^8X  g   EKC   Mw	  MtVP"                  '       dc   VP                  P                  4        FD  pVP(                  '       g   K  W@P                   VP                   &   VP                   V8X  g   KB  TpKF  	  Vf   EKR   V# V# u upi r"   )r  r  r   r  r  ZpopZextendr#   r   r@   r   r   r   r   r   r   r   r   r   r   r   )r   r   ZstackZresultrH   rZ   r   r   r  r   getElementByIdZDocument.getElementById  s.   >>"%%4#7#7#7%%=))*E$)! e99;DLLT__ I_E"^^/GG  %_ I J &&t,Dt !OO224D(((;;t'8'8$..II9=NN4::6#zzR/)-%)%9%9%9 % &:	 J 499--59tzz2::+%)F!%!5!5!5! "659tzz2::+%)F!11Q6!' 5( %%% OO224D{{{59tzz2::+%)F	 5
 !vIIs   ,KKc                r5  r"   r6  r  rQ   r   r7  ZDocument.getElementsByTagName  s    .t8:FFr   c                r8  r"   r9  r  r   r   r:  ZDocument.getElementsByTagNameNS  r;  r   c                r   r"   )r`   ra   rb   r   r   re   ZDocument.isSupported  s    ""--g??r   c                s   VP                   \        P                  8X  d    \        P                  P                  R 4      hVP                   \        P                  8X  d    \        P                  P                  R4      h\        WV 4      # )zcannot import document nodesz!cannot import document type nodes)r   r   r   r6   r7   NotSupportedErrr  r\   )r   rH   r^   r   r   
importNodeZDocument.importNode  s_    ==D...''))*HII]]d555''))*MNN4t,,r   c                s    . pV'       d   VP                  R V R24       Ve    TP                  RV'       d   RMR R24       VP                  RRP                  V4       RV 24       V P                   F  pVP	                  WW44       K  	  R# )	z
encoding="r   Nzstandalone="ZyesZnoz<?xml version="1.0" r  rZ  )rV   r   ru  r#   r   )	r   r   r   r=  r   r   r   ZdeclarationsrH   s	   &&&&&&&  r   r   ZDocument.writexml#  s    *XJa 89!,
u.MQ OP+CHH\,B+C2dVLMOODMM&): $r   c                sZ   VP                   V Jd2   \        P                  P                  R V : RVP                   : 24      hVP                  \
        P                  \
        P                  39  d    \        P                  P                  R4      hV\        8w  d   RV9   d[   VP                  R^4      w  rEVR8X  d?   V\        P                  P                  8w  d    \        P                  P                  R4      hMmVR8X  d^   V\        P                  P                  8w  d?   VP                  \
        P                  8X  d    \        P                  P                  R4      hRpTpMRpRpVP                  \
        P                  8X  d/   VP                  pVe   VP                  pVP                  V4       MRpWAn        WQn        W!n        W1n        VP                  \
        P                  8X  d	   W1n        V# W1n        Ve+   VP-                  V4       X'       d   VP/                  V4       V# )z3cannot rename nodes from other documents;
expected z,
found z8renameNode() only applies to element and attribute nodesr   r   zillegal use of 'xmlns' prefixz$illegal use of the 'xmlns' attributeN)r]   r6   r7   r  r   r   rW   r   r  r    r   r   r   r   r   r.  r   r   r   r   r   r   r'  r?  )r   r
  r   r   r   r   rF  Zis_ids   &&&&    r   
renameNodeZDocument.renameNode3  s   ??$&''**,0!//CD D ::d//1D1DEE''))JL L?*d{$(JJsA$6!'&#''*A*AA''..79 9 go&#''*A*AA**(;(;;''..>@ @ 	FI::,,,nnG"++A.G %
::***I  F"((+..q1 r   )r  r  r  r#   r  r  )r  r  r  r#   r  )r   r   r   NN)@r   r   r   r   r   r   rW   r   r   r  r5   r  r`   r   r   r   r   r   r:   rD   rC   r  r   r   rd   r  r  r  r   r   r   r  r  r  r  r  r  r  r  r<   r;   r  rU   r_   r  r  r  r  r  r  r  r  r  r  r  r  r7  r:  re   r  r   r  r   r   r   r   r   r  r    sC    @I**D,L,L**D,C,CE '(N!!HHIJJ$((Ok
 NHJGLKO%(# !(, 

*





8tG7@-; 3 3r   r  r  z#Top-level element of this document.c                sX   V P                   P                  V4      '       d&   \        P                  P                  P
                  pM$\        P                  P                  P                  pV P                  \        P                  8X  d   VP                  V P                  V P                  4      pV P                  P                  4        Fk  pVP                  VP                  VP                  VP                   4       VP#                  VP                  VP$                  4      pVP&                  Vn        Km  	  V'       d1   V P(                   F   p\+        WqV4      pVP-                  V4       K"  	  EMV P                  \        P.                  8X  dK   VP1                  4       pV'       d1   V P(                   F   p\+        WqV4      pVP-                  V4       K"  	  EMV P                  \        P2                  8X  d   VP5                  V P6                  4      pEMnV P                  \        P8                  8X  d   VP;                  V P6                  4      pEM2V P                  \        P<                  8X  d)   VP?                  V P@                  V P6                  4      pEMV P                  \        PB                  8X  d   VPE                  V P6                  4      pEMV P                  \        PF                  8X  dA   VPI                  V P                  V P                  4      pRVn        V P                   Vn        EMPV P                  \        PJ                  8X  Ed   \        P                  P                  P                  pVPL                  PO                  V PP                  V PR                  V PT                  4      pW$n         V'       Ed   . VPV                  n,        . VPZ                  n,        V PZ                  PX                   F  p	\]        V	P                  V	PR                  V	PT                  4      p
W*n         VPZ                  PX                  P_                  V
4       \a        V	R4      '       g   Km  V	Pc                  W9V
4       K  	  V PV                  PX                   F  p\e        VP                  VPR                  VPT                  VPf                  4      pVPh                  Vn4        VPj                  Vn5        VPl                  Vn6        W,n         VPV                  PX                  P_                  V4       \a        VR4      '       g   K  VPc                  W;V4       K  	  M/\        P                  Po                  R\q        V 4      ,          4      h\a        V R4      '       d   V Pc                  W0V4       V# )zc
Clone a node and give it the new owner document.
Called by Node.cloneNode and Document.importNode
Tr{   zCannot clone node %s)9r]   rh   r6   r7   r  r  ZNODE_IMPORTEDr   r   rW   r  r   r   r   r   r-  r   r*  r   r   r#   r\   r<   r2   r  rS   r  rT   r   r  r   r  rR  r   r  r   r  r  r`   r  r   r  r  r  r  r  r  rV   rv   r{   r  r  r  r   rd   r  r9   )rH   r^   ZnewOwnerDocumentry   r  r   r  rZ   rG   r
  r  r  r  s   &&&          r   r\   r\   l  s   
 $$%566GG++77	GG++99	}}))) 001B1B15@OO**,D  !2!2DMM4::N(():):DNNKA..AK -
 -=>!!!$ ) 
$55	5 779-=>!!!$ ) 
$..	( //		:	$11	1 33DII>	$::	: <<T[[=AYYH	$++	+ ..tyy9	$--	- 2243D3D37==Bjj	$11	1GG++99	 //BBIIt}}dmm5.4"$ENN#%EOO ^^((#AJJ

AJJG)9&$$++H51788--iHE ) ]]''

AJJ

 !0()(8(8%"#**!"'7$##**621788--iFC ( gg%%&<tDz&IJJ
 t.//$$Ye<Lr   c                 s`    V P                  R ^4      p\        V4      ^8X  d   V# RV^ ,          3# )r   N)r   r   )r+  Zfieldsr}   r   r)  r)    s4      a(F
6{afQi  r   c                 s|    V ! V/ VB pVP                  4       w  rEVP                  V4       VP                  4        V# r"   )ZgetEventZ
expandNoder  )ZfuncZargsZkwargsZeventsZtoktypeZrootNoderI   r   _do_pulldom_parser    s<    4"6"F)G
h
LLNOr   c                s    Vf    V'       g   ^ RI Hp VP                  V 4      # ^ RI Hp \	        VP                  V 3RVRV/4      # )z3Parse a file into a DOM by filename or file object.expatbuilderpulldomparserbufsize)xml.domr  parser  r  )Zfiler  r  r  r  rM   r   r  r    sC    ~g(!!$''# vy'24 	4r   c                sx    Vf   ^ RI Hp VP                  V 4      # ^ RI Hp \	        VP                  V 3RV/4      # )z&Parse a file into a DOM from a string.r  r  r  )r  r  parseStringr  r  )Zstringr  r  r  r   r   r  r    s?    ~(''//# !4!4vi"*F!35 	5r   c                 s    V '       d`   \        V \        4      '       d   \        P                  ! V 4      p V  F-  w  r\        P
                  P                  W4      '       d   K,   R # 	  \        P
                  # r"   )r   r   r   Z_parse_feature_stringr  r`   ra   )ZfeaturesZfZvr   r   getDOMImplementationr    sV    h$$33H=HDA**55a;;  """r   r   r"   )6r  r   r  r6   r    r   r   r   Zxml.dom.minicompatZxml.dom.xmlbuilderr   r   r7   r   rW   r   r@   ZdefpropertyrJ   r   r   r   r   r   Zobjectr   ZAttributeListr  r   r  r/  rG  rP  r\  r   ry  rC  r~  r  r  r  r  r  r  r  r  rA   r  r\   r)  r  r  r  r  r	   r   r   <module>r     s  " 
  J J   >  GGLL55GGLL>>@ t377<< tl D,$@ A D+$? @ D+$H I.%t %$z84 z8x D&$F G D+$M N D,$E Fa?6 a?F L(68 v ( D$M"d M"^ G\<> G[79	 &; &;RNIt N4ECIt ECN M8)E FS+= S+j D0./ D+@BBm B	34 	3<V <| *H8: ::y$ :x&9Z &9P8z9d 8M+ M^(& (T2QtZ Qf
 H'57Od!45#r   