+
     Bi                    h   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 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/ R0]"4      t#]! ]#R1R2R	7       ]! ]#R3R4R	7       R5 t$R6 t% ! R7 R8]"4      t& ! R9 R:]#4      t' ! R; R<]4      t(]! ](RR=R	7        ! R> R?4      t) ! R@ RA])] ]4      t* ! RB RC])]4      t+ ! RD RE])] ]4      t, ! RF RG]
4      t- ! RH RI]4      t.RJ t/ ! RK RL]]4      t0]! ]0RMRNR	7       RO t1RP t2RQ t3RURR lt4RVRS lt5RVRT lt6R# )Wac  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*)DOMImplementationLS
DocumentLSc                      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 selfs   &&/usr/lib/python3.14/xml/dom/minidom.py__bool__Node.__bool__+           c                (    V P                  R R W4      #  )toprettyxml)r   encoding
standalones   &&&r   toxml
Node.toxml.   s    B==r   c                   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       # )Nxmlcharrefreplace
)r   errorsnewliner   )
ioStringIOTextIOWrapperBytesIOnodeTyper   DOCUMENT_NODEwritexmlgetvaluedetach)r   indentnewlr   r   writers   &&&&& r   r   Node.toprettyxml1   s    [[]F%%bjjl/7-@.24F ==D...MM&"fHIMM&"f3??$$==?++--r   c                ,    \        V P                  4      # N)bool
childNodesr   s   &r   hasChildNodesNode.hasChildNodesD   s    DOO$$r   c                    V P                   # r0   r2   r   s   &r   _get_childNodesNode._get_childNodesG       r   c                P    V P                   '       d   V P                   ^ ,          # R#     Nr6   r   s   &r   _get_firstChildNode._get_firstChildJ   s    ?????1%% r   c                P    V P                   '       d   V P                   R,          # R#    Nr6   r   s   &r   _get_lastChildNode._get_lastChildN   s    ?????2&& r   c                X   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tupler2   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crS   nodes   &&&   r   rJ   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                   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# rF   )r&   rH   rI   r2   rR   rK   rL   rM   rN   rO   rV   rW   rP   rQ   _append_childrY   )r   r^   r]   s   && r   rR   Node.appendChildr   s    ==D7774??+  # , K== 6 66''--.24j$t*EG G]]66D!??&OO''-d!r   c                   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rF   )r&   rH   rY   rQ   rJ   rK   rL   rM   rN   rO   rP   r2   rS   rT   rU   rV   rW   rZ   )r   r[   oldChildr\   rS   s   &&&  r   replaceChild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                    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r0   )r2   removerT   rL   rM   rU   rY   rZ   r&   rV   rW   rP   r   rd   s   &&r   rQ   Node.removeChild   s    	(OO""8, +3;3K3KH  0##/3;3G3GH$$0:>>x7 88D!"  	(''%%''	(s   B& &*Cc                V   . 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# )rA   NNNNrB   )r2   r&   r   	TEXT_NODEdatarY   rZ   unlinkappendELEMENT_NODE	normalize)r   Lchildr^   s   &   r   rr   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                B    \        YV P                  ;'       g    T 4      # r0   )_clone_nodeownerDocument)r   deeps   &&r   	cloneNodeNode.cloneNode   s    4t'9'9'A'ATBBr   c                L    V P                   P                  P                  W4      # r0   )rx   implementation
hasFeaturer   featureversions   &&&r   isSupportedNode.isSupported   s    !!00;;GMMr   c                    R # r0   r   r   s   &r   _get_localNameNode._get_localName   s    r   c                    WJ # r0   r   r   others   &&r   
isSameNodeNode.isSameNode   s
    }r   c                :    V P                  VR 4      '       d   V # R # r0   )r   r   r   s   &&r   getInterfaceNode.getInterface   s    GT**Kr   c                h     V P                   V,          ^ ,          #   \        \        3 d     R# i ; ir;   )
_user_dataAttributeErrorKeyErrorr   keys   &&r   getUserDataNode.getUserData   s2    	??3'**) 		s    11c                    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r0   )r   r   )r   r   rn   handleroldds   &&&&  r   setUserDataNode.setUserData   sm    	 A 8&)C<GF 
 _AF
  	 AO	 s   : AAc                    \        V R 4      '       dK   \        V P                  P                  4       4       F!  w  pw  rVVf   K  VP	                  WWRV4       K#  	  R# R# )r   N)hasattrlistr   itemshandle)r   	operationsrcdstr   rn   r   s   &&&&   r   _call_user_data_handlerNode._call_user_data_handler   sN    4&&(,T__-B-B-D(E$_d&NN94cB )F 'r   c                    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 # r0   )rP   rx   r2   ro   NodeListrZ   rY   )r   rt   s   & r   ro   Node.unlink  sJ    /33$,??? )&jDO#r   c                    V # r0   r   r   s   &r   	__enter__Node.__enter__  s    r   c                &    V P                  4        R # r0   )ro   )r   etevtbs   &&&&r   __exit__Node.__exit__  s    r   )r   r2   rY   rx   rP   rZ   NN)	r   NN)$__name__
__module____qualname____firstlineno__namespaceURIrP   rx   rY   rZ   r   prefixr   r   r   r3   r7   r=   rC   rJ   rR   re   rQ   rr   rz   r   r   r   r   r   r   r   ro   r   r   __static_attributes____classdictcell____classdict__s   @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                     V P                   pV'       d   VR,          pW1n        Wn        VP                  V4       Wn        R# r@   )r2   rZ   rY   rp   rP   )r   r^   r2   lasts   &&  r   ra   ra     s6    J"~#dOr   c                 l    V e0   V P                   \        P                  8X  d   R# V P                  p K3  R# )NTF)r&   r   r'   rP   r^   s   &r   _in_documentr   '  s)    

==D...r   c                   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.N&z&amp;<z&lt;>z&gt;"z&quot;z&#13;r   z&#10;r   z&#9;)replacewrite)r-   textattrs   &&&r   _write_datar   /  s     d{||C)
d{||C(
d{||C($;<<X.D4<<<g.D4<<<g.D4<<<f-D
LLr   c                     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   )r2   r&   r   rq   tagNamerp   _get_elements_by_tagName_helper)parentnamercr^   s   &&& r   r   r   F  sR    !!==D---S[DLLD0IIdO'B7	 "
 Ir   c                    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   )r2   r&   r   rq   r   r   rp   "_get_elements_by_tagName_ns_helper)r   nsURIr   r   r^   s   &&&& r   r   r   N  sg    !!==D---c!T^^y%@#!2!2e!;		$.tIJ " Ir   c                      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# )DocumentFragmentiW  z#document-fragmentNc                $    \        4       V n        R # r0   )r   r2   r   s   &r   __init__DocumentFragment.__init__e  s    "*r   r6   )r   r   r   r   r   rH   r&   nodeName	nodeValue
attributesrP   rq   rm   CDATA_SECTION_NODEENTITY_REFERENCE_NODEPROCESSING_INSTRUCTION_NODECOMMENT_NODENOTATION_NODErK   r   r   r   r   s   @r   r   r   W  ss     **H#HIJJ**003399**++-% %r   r   c                     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# )Attrii  NFc                    R V n         Wn        W n        W@n        Ve   W0n        \        4       V n        V P                  P                  \        4       4       R # r0   )	ownerElement_namer   _prefix
_localNamer   r2   rp   Text)r   qNamer   r   r   s   &&&&&r   r   Attr.__init__s  sD     
( 'O"* 	tv&r   c                     V P                   #   \         d'    T P                  P                  R ^4      R,          u # i ; i:rB   )r   r   r   splitr   s   &r   r   Attr._get_localName  s<    	3??" 	3==&&sA.r22	3    .??c                    V P                   # r0   )	specifiedr   s   &r   _get_specifiedAttr._get_specified      ~~r   c                    V P                   # r0   )r   r   s   &r   	_get_nameAttr._get_name      zzr   c                \    Wn         V P                  e   \        V P                  4       R # R # r0   )r   r   rW   r   values   &&r   	_set_nameAttr._set_name  s&    
(D--. )r   c                    V P                   # r0   )_valuer   s   &r   
_get_valueAttr._get_value      {{r   c                    Wn         WP                  ^ ,          n        V P                  e   \	        V P                  4       WP                  ^ ,          n        R# r;   )r	  r2   rn   r   rW   r  s   &&r   
_set_valueAttr._set_value  s?    "'(D--."'r   c                    V P                   # r0   )r   r   s   &r   _get_prefixAttr._get_prefix      ||r   c                >   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   rL   rM   NamespaceErrr   r   r   rW   r   )r   r   nsurinewNames   &&  r   _set_prefixAttr._set_prefix  s{    !!W/1gg**KM M>nnG!'8GD--.	r   c                   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 # )NFrl   )r   _attrsr   _attrsNSr   r   _is_id_magic_id_nodesrx   _magic_id_countr2   ro   )r   elemrt   s   &  r   ro   Attr.unlink  s    
   DMM*t00$..AB{{{#$$)$""22a72__ELLN %OOAr   c                B   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  rx   r   _get_elem_infor   isIdNSr   isIdr   r   r   r!  infos   &   r   	_get_isIdAttr._get_isId  s    ;;;    ;$,!!$'<;;t00$..AA99T]]++r   c                *   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      # r0   )	rx   r   _no_typer%  r   getAttributeTypeNSr   getAttributeTyper   r(  s   &   r   _get_schemaTypeAttr._get_schemaType  s~        ;$,O!!$'<O**4+<+<dnnMM((77r   )	r  r   r   r   r	  r2   r   r   r   )r   r	  r   r   r2   r   rx   r   )#r   r   r   r   	__slots__r   ATTRIBUTE_NODEr&   r   r   r  rm   r   rK   r   r   r   r   r   r  propertyr   r   r
  r  r   r  r  r  r   ro   r*  r0  r   r   r   s   @r   r   r   i  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                      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                *    Wn         W n        W0n        R # r0   r  r  _ownerElement)r   attrsattrsNSr   s   &&&&r   r   NamedNodeMap.__init__  s    )r   c                ,    \        V P                  4      # r0   )lenr  r   s   &r   _get_lengthNamedNodeMap._get_length  s    4;;r   c                     V \        V P                  P                  4       4      V,          ,          #   \         d     R # i ; ir0   )r   r  keys
IndexErrorr   rS   s   &&r   itemNamedNodeMap.item  s;    	T[[--/0788 		s   03 AAc                    . pV P                   P                  4        F*  pVP                  VP                  VP                  34       K,  	  V# r0   )r  valuesrp   r   r  r   rs   r^   s   &  r   r   NamedNodeMap.items  s<    KK&&(DHHdmmTZZ01 )r   c                    . pV P                   P                  4        F6  pVP                  VP                  VP                  3VP
                  34       K8  	  V# r0   )r  rI  rp   r   r   r  rJ  s   &  r   itemsNSNamedNodeMap.itemsNS  sG    KK&&(DHHt(($..94::FG )r   c                f    \        V\        4      '       d   WP                  9   # WP                  9   # r0   )
isinstancestrr  r  r   s   &&r   __contains__NamedNodeMap.__contains__  s)    c3++%%--''r   c                6    V P                   P                  4       # r0   )r  rC  r   s   &r   rC  NamedNodeMap.keys  s    {{!!r   c                6    V P                   P                  4       # r0   )r  rC  r   s   &r   keysNSNamedNodeMap.keysNS  s    }}!!##r   c                6    V P                   P                  4       # r0   )r  rI  r   s   &r   rI  NamedNodeMap.values  s    {{!!##r   Nc                8    V P                   P                  W4      # r0   r  get)r   r   r  s   &&&r   r]  NamedNodeMap.get  s    {{t++r   c                    V P                   \        VR R4      J d   ^ # \        V 4      \        V4      8  \        V 4      \        V4      8  ,
          # )r  N)r  getattridr   s   &&r   _cmpNamedNodeMap._cmp"  s?    ;;'%488tHr%y(RX5	-ABBr   c                *    V P                  V4      ^ 8H  # r<   rb  r   s   &&r   __eq__NamedNodeMap.__eq__(      yy1$$r   c                *    V P                  V4      ^ 8  # re  rf  r   s   &&r   __ge__NamedNodeMap.__ge__+  ri  r   c                *    V P                  V4      ^ 8  # re  rf  r   s   &&r   __gt__NamedNodeMap.__gt__.      yy!##r   c                *    V P                  V4      ^ 8*  # re  rf  r   s   &&r   __le__NamedNodeMap.__le__1  ri  r   c                *    V P                  V4      ^ 8  # re  rf  r   s   &&r   __lt__NamedNodeMap.__lt__4  rp  r   c                z    \        V\        4      '       d   V P                  V,          # V P                  V,          # r0   )rP  rI   r  r  )r   attname_or_tuples   &&r   __getitem__NamedNodeMap.__getitem__7  s0    &..==!122;;/00r   c                b   \        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)
rP  rQ  r  r   r   r:  rx   setNamedItemr  	TypeError)r   attnamer  r^   s   &&& r   __setitem__NamedNodeMap.__setitem__>  s    eS!!({{7+
 JeT** GHHDd#  (G}%)%7%7%E%E"!!$'(s   A) )AB.-B.c                N     V P                   V,          #   \         d     R # i ; ir0   )r  r   r   r   s   &&r   getNamedItemNamedNodeMap.getNamedItemM  s(    	;;t$$ 		s    $$c                P     V P                   W3,          #   \         d     R # i ; ir0   )r  r   r   r   r   s   &&&r   getNamedItemNSNamedNodeMap.getNamedItemNSS  s+    	==,!:;; 		s    %%c                <   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  rW   r:  r  r   r  r   r   r   r   rL   rM   rU   r   r   ns   && r   removeNamedItemNamedNodeMap.removeNamedItemY  sz    d#=D../AJJ'q~~q{{;<q.))!%H''%%''r   c                <   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  rW   r:  r  r   r   r  r   r   r   rL   rM   rU   r   r   r   r  s   &&& r   removeNamedItemNSNamedNodeMap.removeNamedItemNSe  sz    8=D../q~~q{{;<AJJ'q.))!%H''%%''r   c                   \        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# )rG   )rP  r   rL   rM   rN   rO   r  r]  r   ro   r  r   r   r:  r   rW   )r   r^   r   s   && r   r|  NamedNodeMap.setNamedItemq  s    $%%''--.24j$t*EG Gkkoodii(JJL!%DII=At(($..9: ..))*
r   c                $    V P                  V4      # r0   )r|  r   r^   s   &&r   setNamedItemNSNamedNodeMap.setNamedItemNS~  s      &&r   c                `    W,          p\        VP                  4       VP                  4        R # r0   )rW   r   ro   )r   rx  r^   s   && r   __delitem__NamedNodeMap.__delitem__  s!    %))*r   c                H    V P                   V P                  V P                  3# r0   r9  r   s   &r   __getstate__NamedNodeMap.__getstate__  s    {{DMM4+=+===r   c                0    Vw  V n         V n        V n        R # r0   r9  r   states   &&r   __setstate__NamedNodeMap.__setstate__  s    9>6T]D$6r   r9  r0   )$r   r   r   r   __doc__r2  r   r@  rF  r   rM  rR  rC  rW  rI  r]  __len__rb  rg  rk  rn  rr  ru  ry  r  r  r  r  r  r|  r  r  r  r  r   r   r   s   @r   r7  r7    s      8I*
 ("$$, GC%%$%$1$
(
('
>? ?r   r7  lengthz$Number of nodes in the NamedNodeMap.c                   <   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 # r0   	namespacer   )r   r  r   s   &&&r   r   TypeInfo.__init__  s    "	r   c                    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   s   &r   __repr__TypeInfo.__repr__  sO    >>>*...*A*A499*...: :  !% 7 7CCr   c                    V P                   # r0   )r   r   s   &r   r   TypeInfo._get_name      yyr   c                    V P                   # r0   )r  r   s   &r   _get_namespaceTypeInfo._get_namespace  r   r   )r   r  Nr  )r   r   r   r   r2  r   r  r   r  r   r   r   s   @r   r  r    s$     #ID r   r  c                     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                    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 # r0   )rP   r   r   r   r   r   r2   rY   rZ   r  r  )r   r   r   r   r   s   &&&&&r   r   Element.__init__  sK    '..t}("*2664/ r   c                B    V P                   f   / V n         / V n        R # R # r0   )r  r  r   s   &r   _ensure_attributesElement._ensure_attributes  s    ;;DKDM r   c                     V P                   #   \         d'    T P                  P                  R ^4      R,          u # i ; ir   )r   r   r   r   r   s   &r   r   Element._get_localName  s<    	2??" 	2<<%%c1-b11	2r   c                    V P                   # r0   r   r   s   &r   _get_tagNameElement._get_tagName  r  r   c                    V P                   e;   \        V P                   P                  4       4       F  pVP                  4        K  	  R V n         R V n        \
        P                  V 4       R # r0   )r  r   rI  ro   r  r   )r   r   s   & r   ro   Element.unlink  sK    ;;"T[[//12 3Dr   c                    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  r   )r   r~  s   &&r   getAttributeElement.getAttribute  s=     ;;	;;w'--- 		s   / >>c                    V P                   f   R#  V P                   W3,          P                  #   \         d     R# i ; iNr   )r  r  r   r  s   &&&r   getAttributeNSElement.getAttributeNS  s>    == 	==,!:;AAA 		s   0 ??c                   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 # r0   )getAttributeNoder   r  rx   setAttributeNoder'  rW   )r   r~  r  r   s   &&& r   setAttributeElement.setAttribute  sk    $$W-<=DJ!%!3!3D!!$'jj Jyyy%  !r   c                Z   \        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 # r0   )
_nssplitgetAttributeNodeNSr   r  rx   r  r'  rW   r   r   )r   r   qualifiedNamer  r   	localnamer   s   &&&&   r   setAttributeNSElement.setAttributeNS  s    $]3&&|?<YGDJ!%!3!3D!!$'

""
999#D){{f$$ - %r   c                X    V P                   f   R # V P                   P                  V4      # r0   r\  )r   attrnames   &&r   r  Element.getAttributeNode  s"    ;;{{x((r   c                Z    V P                   f   R # V P                   P                  W34      # r0   )r  r]  r  s   &&&r   r  Element.getAttributeNodeNS  s'    == }}  ,!:;;r   c                   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   rL   rM   InuseAttributeErrr  r  r]  r   removeAttributeNoder  r   r   _set_attribute_node)r   r   old1old2s   &&  r   r  Element.setAttributeNode"  s    T4L0''++,JKK!{{tyy$/$$T*}}  $"3"3T^^!DdK 0$$T*D' KK r   c                   V P                   f   \        P                  P                  4       h V P                  V,          pT P                  T4       R #   \
         d     \        P                  P                  4       hi ; ir0   )r  rL   rM   rU   r  r   r  )r   r   r   s   && r   removeAttributeElement.removeAttribute7  sf    == ''%%''	(;;t$D 	  &  	(''%%''	(s   A *A>c                   V P                   f   \        P                  P                  4       h V P                   W3,          pT P                  T4       R #   \         d     \        P                  P                  4       hi ; ir0   )r  rL   rM   rU   r   r  )r   r   r   r   s   &&& r   removeAttributeNSElement.removeAttributeNS@  si    == ''%%''	(==,!:;D 	  &  	(''%%''	(s   A *A?c                8   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r0   )	rL   rM   rU   r  r   r   rW   ro   rx   r  s   &&r   r  Element.removeAttributeNodeI  s{    <''%%''	(KK		" 	 "//  	(''%%''	(s   A/ /*Bc                >    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  s   &&r   hasAttributeElement.hasAttributeY  s     ;;{{""r   c                B    V P                   f   R# W3V P                   9   # )NF)r  r  s   &&&r   hasAttributeNSElement.hasAttributeNSc  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  s   &&r   getElementsByTagNameElement.getElementsByTagNameh  s     /t8:FFr   c                ,    \        WV\        4       4      # r0   r   r   r  s   &&&r   getElementsByTagNameNSElement.getElementsByTagNameNSp      1	8:7 	7r   c                >    R V P                   \        V 4      3,          # )z<DOM Element: %s at %#x>)r   ra  r   s   &r   r  Element.__repr__t  s    )T\\2d8,DDDr   c                   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_attributesrC  r   r  r2   r?  r&   r   rm   r   r(   )r   r-   r+   	addindentr,   r;  a_namer^   s   &&&&&   r   r(   Element.writexmlw  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                d    V P                  4        \        V P                  V P                  V 4      # r0   )r  r7  r  r  r   s   &r   r  Element._get_attributes  s%    !DKK==r   c                .    V P                   '       d   R # R# r$  r  r   s   &r   hasAttributesElement.hasAttributes  s    ;;;r   c                J    V P                  V4      pV P                  V4       R # r0   )r  setIdAttributeNode)r   r   idAttrs   && r   setIdAttributeElement.setIdAttribute  s     &&t,'r   c                J    V P                  W4      pV P                  V4       R # r0   )r  r  )r   r   r   r  s   &&& r   setIdAttributeNSElement.setIdAttributeNS  s     ((A'r   c                   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)r   r   rL   rM   rU   _get_containing_entrefNoModificationAllowedErrr  r  rx   r   rW   )r   r  s   &&r   r  Element.setIdAttributeNode  s    >1D1D!E!E''%%''!$'3''2244}}} FM  A% ..!3.D!	 r   )
r  r  r2   r   rY   r   rP   r   rZ   r   )rx   rP   r   r   r   r   r   r2   r  r  rY   rZ   r   r   r   )1r   r   r   r   r2  r   rq   r&   r   r-  r5  r  r   r   rm   r   r   rK   r   r   r  r   r  ro   r  r  r  r  r  r  r  setAttributeNodeNSr  r  r  removeAttributeNodeNSr  r  r  r  r  r(   r  r  r  r  r  r   r   r   s   @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                     \        V 4       V P                  4        WP                  VP                  &   WP                  VP
                  VP                  3&   Wn        R # r0   )rW   r  r  r   r  r   r   r   )elementr   s   &&r   r  r    sK    G  $NN499<@d''89
  r   c                   r   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 # r0   r   r   s   &r   r=   Childless._get_firstChild  r   r   c                    R # r0   r   r   s   &r   rC   Childless._get_lastChild  r   r   c                b    \         P                  P                  V P                  R ,           4      h)z nodes cannot have childrenrL   rM   rN   r   r  s   &&r   rR   Childless.appendChild  &    gg))MM99; 	;r   c                    R # Fr   r   s   &r   r3   Childless.hasChildNodes      r   c                b    \         P                  P                  V P                  R ,           4      hz nodes do not have childrenr"  r   r[   r\   s   &&&r   rJ   Childless.insertBefore  r$  r   c                b    \         P                  P                  V P                  R ,           4      hr*  )rL   rM   rU   r   ri   s   &&r   rQ   Childless.removeChild  s&    gg!!MM99; 	;r   c                    R # r0   r   r   s   &r   rr   Childless.normalize  s    r   c                b    \         P                  P                  V P                  R ,           4      hr*  r"  r   r[   rd   s   &&&r   re   Childless.replaceChild  r$  r   r   )r   r   r   r   r  r2  r   EmptyNodeListr2   r   r   r=   rC   rR   r3   rJ   rQ   rr   re   r   r   r   s   @r   r  r    sT      IJJJI;;;; ;r   r  c                      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                    Wn         W n        R # r0   targetrn   )r   r9  rn   s   &&&r   r   ProcessingInstruction.__init__  s    	r   c                    V P                   # r0   rn   r   s   &r   _get_nodeValue$ProcessingInstruction._get_nodeValue  r  r   c                    Wn         R # r0   r<  r  s   &&r   _set_nodeValue$ProcessingInstruction._set_nodeValue  s    	r   c                    V P                   # r0   r9  r   s   &r   _get_nodeName#ProcessingInstruction._get_nodeName   r  r   c                    Wn         R # r0   rC  r  s   &&r   _set_nodeName#ProcessingInstruction._set_nodeName  s    r   c           	     n    VP                  V: R V P                  : RV P                  : RV: 24       R# )z<?r  ?>N)r   r9  rn   r   r-   r+   r  r,   s   &&&&&r   r(   ProcessingInstruction.writexml  s    t{{DIItLMr   )rn   r9  Nr8  r  )r   r   r   r   r   r   r&   r2  r   r=  r@  r4  r   rD  rG  r   r(   r   r   r   s   @r   r6  r6    sR     //H"I
8I}5HN Nr   r6  c                   z   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                v    R ;V n         V n        R ;V n        V n        RV n        \
        P                  V 4       R # r  )rx   rP   rZ   rY   _datar   r   r   s   &r   r   CharacterData.__init__  s4    /33T_266t/
dr   c                ,    \        V P                  4      # r0   )r?  rn   r   s   &r   r@  CharacterData._get_length      499~r   c                    V P                   # r0   rP  r   s   &r   	_get_dataCharacterData._get_data  r  r   c                    Wn         R # r0   rV  r   rn   s   &&r   	_set_dataCharacterData._set_data  s    
r   c                    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<   r^  Nz">)rn   r?  r  r   )r   rn   	dotdotdots   &  r   r  CharacterData.__repr__  s@    yyt9r>IINN##T$Z< 	<r   c                6   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rL   rM   IndexSizeErrr?  rn   r   offsetcounts   &&&r   substringDataCharacterData.substringData'  su    A:''&&'BCCS^#''&&'LMM19''&&'ABByyu--r   c                6    V P                   V,           V n         R # r0   r<  )r   args   &&r   
appendDataCharacterData.appendData0  s    IIO	r   c                ,   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<   rb  rc  Nre  )r   rh  rm  s   &&&r   
insertDataCharacterData.insertData3  ss    A:''&&'BCCS^#''&&'LMM		'6"C67);=DI r   c                   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<   rb  rc  rd  Nre  rg  s   &&&r   
deleteDataCharacterData.deleteData<  s    A:''&&'BCCS^#''&&'LMM19''&&'ABB		'6*TYYv|}-EEDI r   c                   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# rt  re  )r   rh  ri  rm  s   &&&&r   replaceDataCharacterData.replaceDataF  s    A:''&&'BCCS^#''&&'LMM19''&&'ABB		'6"C6<=)ACDI r   )rP  rn   rY   rx   rP   rZ   N)rP  rx   rP   rZ   rY   )r   r   r   r   r2  r   r@  r  rW  r[  r4  rn   r   r  rj  rn  rq  ru  rx  r   r   r   s   @r   rN  rN  
  s\     WIG  	955D9<.$=F	C 	Cr   rN  zLength of the string data.c                   f   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   iT  z#textNc                   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?  rn   rL   rM   rf  r  rx   rY   rP   r2   rR   rJ   )r   rh  newTextnexts   &&  r   	splitTextText.splitText[  s    A:#dii.0''&&'=>>.."yy) $ 2 2???t'A'AA|++G4,,W;IIgv&	r   c                D    \        W: V P                  : V: 2R 4       R# )FN)r   rn   rK  s   &&&&&r   r(   Text.writexmlj  s    F		4@%Hr   c                   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  )
rn   rZ   r&   r   rm   r   rX   rY   rp   join)r   rs   r  s   &  r   _get_wholeTextText._get_wholeTexto  s    YYK  mzzdnnd.E.EFFAFF#%%mzzdnnd.E.EFF MMwwqzr   c                   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 # r0   )	rP   rZ   r&   r   rm   r   rQ   rY   rn   )r   contentr   r  r}  s   &&   r   replaceWholeTextText.replaceWholeText  s       mzzdnnd.E.EFF((""1%t$mzzdnnd.E.EFF}}""1%IKr   c                    V P                   P                  4       '       d   R # \        V 4      pVf   R # V P                  P	                  V4      pVf   R # VP                  4       # r&  )rn   strip_get_containing_elementrx   r%  isElementContent)r   r!  r)  s   &  r   !_get_isWhitespaceInElementContent&Text._get_isWhitespaceInElementContent  sU    99??&t,<!!006<((**r   r<  r   r  )r   r   r   r   r2  r   rm   r&   r   r   r~  r(   r  r  r  r   r   r   s   @r   r   r   T  s<     I~~HHJI
$8
+ 
+r   r   isWhitespaceInElementContentzKTrue iff this text node contains only whitespace and is in element content.	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 # r0   )rP   r&   r   rq   r^   r]   s   & r   r  r    s3    A
-::***HLLr   c                     V P                   pVe0   VP                  \        P                  8X  d   V# VP                   pK3  R # r0   )rP   r&   r   r   r  s   & r   r  r    s3    A
-::333HLLr   c                   L   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                <    \         P                  V 4       Wn        R # r0   )rN  r   rP  rZ  s   &&r   r   Comment.__init__  s    t$
r   c                    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)rn   rT   r   rK  s   &&&&&r   r(   Comment.writexml  s1    499DEE		4@Ar   rV  Nr  )r   r   r   r   r   r   r&   r   r   r(   r   r   r   s   @r   r  r    s&       HHB Br   r  c                   J   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                    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)rn   findrT   r   rK  s   &&&&&r   r(   CDATASection.writexml  s9    99>>% A%CDD%		12r   r   Nr  )r   r   r   r   r2  r   r   r&   r   r(   r   r   r   s   @r   r  r    s$     I&&HH3 3r   r  c                   v   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                    Wn         R # r0   _seq)r   seqs   &&r   r   'ReadOnlySequentialNamedNodeMap.__init__  s    	r   c                ,    \        V P                  4      # r0   r?  r  r   s   &r   r  &ReadOnlySequentialNamedNodeMap.__len__  rT  r   c                ,    \        V P                  4      # r0   r  r   s   &r   r@  *ReadOnlySequentialNamedNodeMap._get_length  rT  r   c                V    V P                    F  pVP                  V8X  g   K  Vu # 	  R # r0   )r  r   r  s   && r   r  +ReadOnlySequentialNamedNodeMap.getNamedItem  s!    AzzT! r   c                |    V P                    F+  pVP                  V8X  g   K  VP                  V8X  g   K)  Vu # 	  R # r0   )r  r   r   r  s   &&& r   r  -ReadOnlySequentialNamedNodeMap.getNamedItemNS  s,    A~~-!++2J r   c                    \        V\        4      '       d   V P                  ! V!  pMV P                  V4      pVf   \	        V4      hV# r0   )rP  rI   r  r  r   )r   name_or_tupler^   s   && r   ry  *ReadOnlySequentialNamedNodeMap.__getitem__  sD    mU++&&6D$$]3D<=))r   c                `    V^ 8  d   R#  V P                   V,          #   \         d     R# i ; ir;   )r  rD  rE  s   &&r   rF  #ReadOnlySequentialNamedNodeMap.item  s2    19	99U## 		s    --c                @    \         P                  P                  R 4      hz"NamedNodeMap instance is read-onlyrL   rM   r  r  s   &&r   r  .ReadOnlySequentialNamedNodeMap.removeNamedItem      gg..02 	2r   c                @    \         P                  P                  R 4      hr  r  r  s   &&&r   r  0ReadOnlySequentialNamedNodeMap.removeNamedItemNS  r  r   c                @    \         P                  P                  R 4      hr  r  r  s   &&r   r|  +ReadOnlySequentialNamedNodeMap.setNamedItem  r  r   c                @    \         P                  P                  R 4      hr  r  r  s   &&r   r  -ReadOnlySequentialNamedNodeMap.setNamedItemNS  r  r   c                    V P                   .# r0   r  r   s   &r   r  +ReadOnlySequentialNamedNodeMap.__getstate__  s    		{r   c                "    V^ ,          V n         R# r;   r  r  s   &&r   r  +ReadOnlySequentialNamedNodeMap.__setstate__  s    !H	r   r  N)r   )r   r   r   r   r2  r   r  r@  r  r  ry  rF  r  r  r|  r  r  r  r   r   r   s   @r   r  r    sP     I

2222 r   r  z&Number of entries in the NamedNodeMap.c                   :   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                    Wn         W n        R # r0   publicIdsystemId)r   r  r  s   &&&r   _identified_mixin_init!Identified._identified_mixin_init"  s      r   c                    V P                   # r0   )r  r   s   &r   _get_publicIdIdentified._get_publicId&      }}r   c                    V P                   # r0   )r  r   s   &r   _get_systemIdIdentified._get_systemId)  r  r   r  N)r   r   r   r   r  r2  r  r  r  r   r   r   s   @r   r  r    s!     J&I! r   r  c                   h   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                    \        4       V n        \        4       V n        V'       d   \        V4      w  r#W0n        V P                  V n        R # r0   )r  entities	notationsr  r   r   )r   r  r   r  s   &&  r   r   DocumentType.__init__4  s6    6879 ( 7F!I		r   c                    V P                   # r0   )internalSubsetr   s   &r   _get_internalSubset DocumentType._get_internalSubset<      """r   c                   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 # r0   )rx   r  r   r   rL   rM   UserDataHandlerNODE_CLONEDr  r  r  Notationr  r  rp   r   EntitynotationNameactualEncodingr   r   )r   ry   cloner   r  notationeentitys   &&      r   rz   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           
        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
  SYSTEM 'Nz []r   )r   r   r  r  r  rK  s   &&&&&r   r(   DocumentType.writexmlZ  s    \"TYY===LL $--t}}F G]]]LLdDMMBC*LLLL,,-LLSXr   )r  r   r   r  r  )r   r   r   r   r   DOCUMENT_TYPE_NODEr&   r   r   r  r  r  r   r  rz   r(   r   r   r   s   @r   r  r  ,  sB     &&HIDHHN"#6 r   r  c                   |   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  ih  Nc                ^    Wn         W@n        \        4       V n        V P	                  W#4       R # r0   )r   r  r   r2   r  )r   r   r  r  r  s   &&&&&r   r   Entity.__init__q  s$    $"*##H7r   c                    V P                   # r0   r  r   s   &r   _get_actualEncodingEntity._get_actualEncodingw  r  r   c                    V P                   # r0   r   r   s   &r   _get_encodingEntity._get_encodingz  r  r   c                    V P                   # r0   r   r   s   &r   _get_versionEntity._get_version}  r  r   c                @    \         P                  P                  R 4      h)z(cannot append children to an entity noderL   rM   rN   )r   r[   s   &&r   rR   Entity.appendChild  s    gg))68 	8r   c                @    \         P                  P                  R 4      h)z+cannot insert children below an entity noder  r+  s   &&&r   rJ   Entity.insertBefore  s    gg))9; 	;r   c                @    \         P                  P                  R 4      h)z*cannot remove children from an entity noder  ri   s   &&r   rQ   Entity.removeChild  s    gg))8: 	:r   c                @    \         P                  P                  R 4      h)z)cannot replace children of an entity noder  r2  s   &&&r   re   Entity.replaceChild  s    gg))79 	9r   )r2   r   r  )r   r   r   r   r   r   ENTITY_NODEr&   r   r  r   r   r   r  r  r  rR   rJ   rQ   re   r   r   r   s   @r   r  r  h  sV     JHINHG8#8;:9 9r   r  c                   B   a  ] tR tRt o ]P
                  tRtR tRt	V t
R# )r  i  Nc                4    Wn         V P                  W#4       R # r0   )r   r  )r   r   r  r  s   &&&&r   r   Notation.__init__  s    ##H7r   )r   )r   r   r   r   r   r   r&   r   r   r   r   r   s   @r   r  r    s     !!HI8 8r   r  c                   F   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                R    VR 8X  d   RpVP                  4       V3V P                  9   # )r   N)lower	_featuresr   s   &&&r   r~   DOMImplementation.hasFeature  s(    b=G)T^^;;r   c                   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 namerL   z$http://www.w3.org/XML/1998/namespacezillegal use of 'xml' prefixz(illegal use of prefix without namespaces)rP   rL   rM   WrongDocumentErr_create_documentInvalidCharacterErrr  r  createElementNSrR   rx   doctyper}   )	r   r   r  r  r   add_root_elementr   r  r  s	   &&&&     r   createDocument 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                4    \        V4      pW$n        W4n        V# r0   )r  r  r  )r   r  r  r  r  s   &&&& r   createDocumentType$DOMImplementation.createDocumentType  s    }-##r   c                :    V P                  VR 4      '       d   V # R # r0   )r~   r   s   &&r   r   DOMImplementation.getInterface  s    ??7D))Kr   c                    \        4       # r0   )Documentr   s   &r   r  "DOMImplementation._create_document  s
    zr   r   ))core1.0)r"  2.0)r"  N)rL   r#  )rL   r$  )rL   N)ls-loadz3.0)r%  N)r   r   r   r   r  r~   r  r  r   r  r   r   r   s   @r   r  r    s+     I<
+Z r   r  c                   ^   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                    Wn         R # r0   r  r  s   &&r   r   ElementInfo.__init__  s    r   c                    \         # r0   r-  r   anames   &&r   r/  ElementInfo.getAttributeType      r   c                    \         # r0   r+  r  s   &&&r   r.  ElementInfo.getAttributeTypeNS  r/  r   c                    R # r&  r   r   s   &r   r  ElementInfo.isElementContent  r(  r   c                    R# )zIReturns true iff this element is declared to have an EMPTY
content model.Fr   r   s   &r   isEmptyElementInfo.isEmpty  s     r   c                    R# )z7Returns true iff the named attribute is a DTD-style ID.Fr   r,  s   &&r   r'  ElementInfo.isId      r   c                    R# )z<Returns true iff the identified attribute is a DTD-style ID.Fr   r  s   &&&r   r&  ElementInfo.isIdNS  r9  r   c                    V P                   # r0   r  r   s   &r   r  ElementInfo.__getstate__  r  r   c                    Wn         R # r0   r  r  s   &&r   r  ElementInfo.__setstate__  s    r   r  N)r   r   r   r   r  r2  r   r/  r.  r  r5  r'  r&  r  r  r   r   r   s   @r   r'  r'    sC      I
 r   r'  c                    V P                   \        P                  8X  d$   V P                  P	                  4        R V n        R # \        V 4      '       d8   V P                  P                  P	                  4        R V P                  n        R # R # r0   )r&   r   r'   	_id_cacheclear_id_search_stackr   rx   r   s   &r   rW   rW     sb    }}*** $	d		$$**,-1+ 
r   c                     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                \    R V n         \        4       V n        / V n        / V n        R V n        R # r0   )r  r   r2   
_elem_inforA  rC  r   s   &r   r   Document.__init__5  s*    "*  $r   c                    VP                   '       d   VP                   VP                  3pMVP                  pV P                  P	                  V4      # r0   )r   r   r   rF  r]  )r   r  r   s   && r   r%  Document._get_elem_info>  sB    &&(9(99C//C""3''r   c                    V P                   # r0   r  r   s   &r   r  Document._get_actualEncodingE  r  r   c                    V P                   # r0   )r  r   s   &r   _get_doctypeDocument._get_doctypeH  r  r   c                    V P                   # r0   )documentURIr   s   &r   _get_documentURIDocument._get_documentURIK  s    r   c                    V P                   # r0   r  r   s   &r   r  Document._get_encodingN  r  r   c                    V P                   # r0   )errorHandlerr   s   &r   _get_errorHandlerDocument._get_errorHandlerQ  s       r   c                    V P                   # r0   )r   r   s   &r   _get_standaloneDocument._get_standaloneT  r9   r   c                    V P                   # r0   )strictErrorCheckingr   s   &r   _get_strictErrorChecking!Document._get_strictErrorCheckingW  s    '''r   c                    V P                   # r0   r  r   s   &r   r  Document._get_versionZ  r  r   c                   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      # )rG   z two document elements disallowed)r&   rK   rL   rM   rN   rO   rP   rQ   r   rq   _get_documentElementrR   r  s   &&r   rR   Document.appendChild]  s    == 6 66''--.24j$t*EG G??& OO''-==D---((**''--24 4++r   c                     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r0   )
r2   rh   rT   rL   rM   rU   rY   rZ   rP   documentElementri   s   &&r   rQ   Document.removeChildm  sr    	(OO""8, ;?>x7"8+#'D   	(''%%''	(s   A *A5c                r    V P                    F&  pVP                  \        P                  8X  g   K$  Vu # 	  R # r0   )r2   r&   r   rq   r  s   & r   rc  Document._get_documentElementy  s'    OOD}} 1 11 $r   c                    V P                   e"   V P                   P                  4        R V n         \        P                  V 4       R # r0   )r  ro   r   r   s   &r   ro   Document.unlink~  s/    <<#LL!DLDr   c                ,   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# r0   )r}   r  r   r   r   r2   rw   rp   r&   r   r'   r  r  rP   r   rL   rM   r  r  )r   ry   r  r  
childclones   &&   r   rz   Document.cloneNode  s    ##224tD??A$Qe4J##J/""d&8&88$$(?(?? *$)! ! 	$$SWW%<%<%H%H%)	2r   c                &    \        4       pWn        V# r0   )r   rx   )r   r   s   & r   createDocumentFragmentDocument.createDocumentFragment  s    r   c                (    \        V4      pWn        V# r0   )r  rx   )r   r   r  s   && r   createElement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)rP  rQ  r}  r   rn   rx   )r   rn   ts   && r   createTextNodeDocument.createTextNode  s1    $$$<==Fr   c                t    \        V\        4      '       g   \        R 4      h\        4       pWn        Wn        V# rv  )rP  rQ  r}  r  rn   rx   r   rn   r]   s   && r   createCDATASectionDocument.createCDATASection  s1    $$$<==Nr   c                (    \        V4      pWn        V# r0   )r  rx   r{  s   && r   createCommentDocument.createComment  s    DMr   c                (    \        W4      pWn        V# r0   )r6  rx   )r   r9  rn   ps   &&& r   createProcessingInstruction$Document.createProcessingInstruction  s    !&/r   c                6    \        V4      pWn        R Vn        V# r   )r   rx   r  )r   r   as   && r   createAttributeDocument.createAttribute  s    Kr   c                D    \        V4      w  r4\        W!V4      pWn        V# r0   )r  r  rx   )r   r   r  r   r   r  s   &&&   r   r  Document.createElementNS  s%    $]3M8r   c                R    \        V4      w  r4\        W!WC4      pWn        R Vn        V# r   )r  r   rx   r  )r   r   r  r   r   r  s   &&&   r   createAttributeNSDocument.createAttributeNS  s,    $]3i@r   c                *    \        WW44      pWn        V# r0   )r  rx   )r   r   r  r  r  r  s   &&&&& r   _create_entityDocument._create_entity  s    48:r   c                *    \        WV4      pWn        V# r0   )r  rx   )r   r   r  r  r  s   &&&& r   _create_notationDocument._create_notation  s    TX.r   c                   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 r0   )rA  rF  r   rC  rf  popextendr2   r&   rV   r%  r   rI  r   r&  r   r  r  r'  r   r  )r   ra  stackresultr^   rt   r)  r   s   &&      r   getElementById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                *    \        W\        4       4      # r0   r  r  s   &&r   r  Document.getElementsByTagName  s    .t8:FFr   c                ,    \        WV\        4       4      # r0   r  r  s   &&&r   r  Document.getElementsByTagNameNS  r  r   c                8    V P                   P                  W4      # r0   )r}   r~   r   s   &&&r   r   Document.isSupported  s    ""--g??r   c                   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'   rL   rM   NotSupportedErrr  rw   )r   r^   ry   s   &&&r   
importNodeDocument.importNode!  s_    ==D...''))*HII]]d555''))*MNN4t,,r   c                    . 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="yesnoz<?xml version="1.0" r  rJ  )rp   r   r  r2   r(   )	r   r-   r+   r  r,   r   r   declarationsr^   s	   &&&&&&&  r   r(   Document.writexml(  s    *XJa 89!,
u.MQ OP+CHH\,B+C2dVLMOODMM&): $r   c                Z   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)rx   rL   rM   r  r&   r   rq   r3  r  r   r   r   r  r   r  r  r   r   r   r   r   r   r  r  )r   r  r   r   r   r   r  is_ids   &&&&    r   
renameNodeDocument.renameNode8  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   )rF  rA  rC  r2   r  rf  )rF  r  rC  r2   rA  )r   r   r   NN)@r   r   r   r   r2  r   rq   r   r   r  rK   r  r}   r'   r&   r   r   r   rP   rZ   rY   r  r   r   r   r]  rV  rP  r   r   r%  r  rM  rQ  r  rW  rZ  r^  r  rR   rQ   rc  ro   rz   rp  rs  rx  r|  r  r  r  r  r  r  r  r  r  r  r   r  r(   r  r   r   r   s   @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   rf  z#Top-level element of this document.c                X   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)9rx   r   rL   rM   r  r  NODE_IMPORTEDr&   r   rq   r  r   r   r   rI  r  r  r  r   r   r2   rw   rR   rH   rp  rm   rx  rn   r   r|  r   r  r9  r   r  r3  r  r  r}   r  r   r  r  r  r  r  r  rp   r   r   r  r  r  r   r   r  rO   )r^   ry   newOwnerDocumentr   r  r   r  rt   r]   r  r  r  r  s   &&&          r   rw   rw   q  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                 `    V P                  R ^4      p\        V4      ^8X  d   V# RV^ ,          3# )r   N)r   r?  )r  fieldss   & r   r  r    s4      a(F
6{afQi  r   c                 |    V ! V/ VB pVP                  4       w  rEVP                  V4       VP                  4        V# r0   )getEvent
expandNoderB  )funcargskwargseventstoktyperootNodes   &&&   r   _do_pulldom_parser    s<    4"6"F)G
h
LLNOr   c                    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  )filer  r  r  r  s   &&&  r   r  r    sC    ~g(!!$''# vy'24 	4r   c                x    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  )stringr  r  r  s   &&  r   r  r    s?    ~(''//# !4!4vi"*F!35 	5r   c                     V '       d`   \        V \        4      '       d   \        P                  ! V 4      p V  F-  w  r\        P
                  P                  W4      '       d   K,   R # 	  \        P
                  # r0   )rP  rQ  r   _parse_feature_stringr   r}   r~   )featuresfvs   &  r   getDOMImplementationr    sV    h$$33H=HDA**55a;;  """r   r   r0   )7r  r"   r  rL   r   r   r   r   xml.dom.minicompatxml.dom.xmlbuilderr   r	   rM   r   rq   r   rV   defpropertyra   r   r   r   r   r   r   objectr7  AttributeListr  r-  r  r  r  r6  rN  r   r  r  r  r  r  r  r  r  r  r  r'  rW   r   rw   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 %$y84 y8v D&$F G D+$M N D,$E Fa?6 a?F L(68 v ( D$L"d L"\ 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   