
bc           @   s  d  Z  d d l Z d d l m Z m Z m Z m Z d d l Td d l m	 Z	 m
 Z
 e j j j e j j j f Z d e j j f d     YZ e e d d	 d
 e e d d	 d e e d d	 d d   Z d   Z d   Z d   Z d   Z d e f d     YZ d e f d     YZ e e d d	 d e e d d	 d e e d d	 d d e f d     YZ e e d d	 d  e Z d! e f d"     YZ e e e  Z d# e f d$     YZ e e d% d	 d& e e d d	 d' d(   Z d) f  d*     YZ  d+ e  e f d,     YZ! d- e  e f d.     YZ" e e" d d	 d/ d0 e" f d1     YZ# e e# d2 d	 d3 e e# d4 d	 d5 d6   Z$ d7   Z% d8 e  e" f d9     YZ& d: e# f d;     YZ' d< e f d=     YZ( e e( d d	 d> d? f  d@     YZ) dA e) e  e f dB     YZ* dC e) e f dD     YZ+ dE e) e  e f dF     YZ, dG e	 f dH     YZ- dI e f dJ     YZ. dK   Z/ dL e e
 f dM     YZ0 e e0 dN d	 dO dP   Z1 dQ   Z2 dR   Z3 dS   Z4 e e dT  Z5 e dU  Z6 e dV  Z7 d S(W   sc  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
iN(   t   EMPTY_NAMESPACEt   EMPTY_PREFIXt   XMLNS_NAMESPACEt   domreg(   t   *(   t   DOMImplementationLSt
   DocumentLSt   Nodec           B   s   e  Z d Z d Z d Z d Z d Z e Z	 d    Z
 d d  Z d d d d  Z d   Z d   Z d   Z d   Z d	   Z d
   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z RS(   c         C   s   t  S(   N(   t   True(   t   self(    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyt   __nonzero__*   s    c         C   s   |  j  d d |  S(   Nt    (   t   toprettyxml(   R	   t   encoding(    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyt   toxml-   s    s   	s   
c         C   s   t    } | d  k	 r= d d  l } | j |  d |  } n  |  j t j k rk |  j | d | | |  n |  j | d | |  | j   S(   Nii   R   (	   t   _get_StringIOt   Nonet   codecst   lookupt   nodeTypeR   t   DOCUMENT_NODEt   writexmlt   getvalue(   R	   t   indentt   newlR   t   writerR   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyR   0   s    	c         C   s   |  j  r t St Sd  S(   N(   t
   childNodesR   t   False(   R	   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyt   hasChildNodes?   s    	c         C   s   |  j  S(   N(   R   (   R	   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyt   _get_childNodesE   s    c         C   s   |  j  r |  j  d Sd  S(   Ni    (   R   (   R	   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyt   _get_firstChildH   s    	c         C   s   |  j  r |  j  d Sd  S(   Ni(   R   (   R	   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyt   _get_lastChildL   s    	c         C   sw  | j  |  j k r@ x' t | j  D] } |  j | |  q" W| S| j  |  j k r} t j j d t	 |  t	 |   f   n  | j
 d  k	 r | j
 j |  n  | d  k r |  j |  n y |  j j |  } Wn  t k
 r t j j    n X| j  t k rt |   n  |  j j | |  | | _ | | _ | ra|  j | d } | | _ | | _ n	 d  | _ |  | _
 | S(   Ns   %s cannot be child of %si   (   R   t   DOCUMENT_FRAGMENT_NODEt   tupleR   t   insertBeforet   _child_node_typest   xmlt   domt   HierarchyRequestErrt   reprt
   parentNodeR   t   removeChildt   appendChildt   indext
   ValueErrort   NotFoundErrt   _nodeTypes_with_childrent   _clear_id_cachet   insertt   nextSiblingt   previousSibling(   R	   t   newChildt   refChildt   cR+   t   node(    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyR"   P   s6    	"					c         C   s   | j  |  j k r= x$ t | j  D] } |  j |  q" W| S| j  |  j k rz t j j d t	 |  t	 |   f   n | j  t
 k r t |   n  | j d  k	 r | j j |  n  t |  |  d  | _ | S(   Ns   %s cannot be child of %s(   R   R    R!   R   R*   R#   R$   R%   R&   R'   R.   R/   R(   R   R)   t   _append_childR1   (   R	   R6   R5   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyR*   p   s    	"	c         C   s  | j  |  j k r8 | j } |  j |  |  j | |  S| j  |  j k ru t j j d t	 |  t	 |   f   n  | | k r d  S| j
 d  k	 r | j
 j |  n  y |  j j |  } Wn  t k
 r t j j    n X| |  j | <|  | _
 d  | _
 | j  t k s| j  t k r*t |   n  | j | _ | j | _ d  | _ d  | _ | j rl| | j _ n  | j r| | j _ n  | S(   Ns   %s cannot be child of %s(   R   R    R1   R)   R"   R#   R$   R%   R&   R'   R(   R   R   R+   R,   R-   R.   R/   R2   (   R	   R3   t   oldChildR4   R+   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyt   replaceChild   s<    		"						c         C   s   y |  j  j |  Wn  t k
 r6 t j j    n X| j d  k	 rX | j | j _ n  | j d  k	 ry | j | j _ n  d  | _ | _ | j	 t
 k r t |   n  d  | _ | S(   N(   R   t   removeR,   R$   R%   R-   R1   R   R2   R   R.   R/   R(   (   R	   R8   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyR)      s    	c         C   s*  g  } x|  j  D]} | j t j k r | j sr | rJ | j | d _ n  | j re | j | j _ n  | j   q| r | d j | j k r | d } | j | j | _ | j | _ | j r | | j _ n  | j   q| j |  q | j |  | j t j	 k r | j
   q q W| |  j  (d  S(   Ni(   R   R   R   t	   TEXT_NODEt   dataR1   R2   t   unlinkt   appendt   ELEMENT_NODEt	   normalize(   R	   t   Lt   childR6   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyR@      s*    		
	c         C   s   t  |  | |  j p |   S(   N(   t   _clone_nodet   ownerDocument(   R	   t   deep(    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyt	   cloneNode   s    c         C   s   |  j  j j | |  S(   N(   RD   t   implementationt
   hasFeature(   R	   t   featuret   version(    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyt   isSupported   s    c         C   s   d  S(   N(   R   (   R	   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyt   _get_localName   s    c         C   s
   |  | k S(   N(    (   R	   t   other(    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyt
   isSameNode   s    c         C   s   |  j  | d   r |  Sd  Sd  S(   N(   RK   R   (   R	   RI   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyt   getInterface   s    c         C   s2   y |  j  | d SWn t t f k
 r- d  SXd  S(   Ni    (   t
   _user_datat   AttributeErrort   KeyErrorR   (   R	   t   key(    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyt   getUserData   s    c         C   s   d  } y |  j } Wn  t k
 r5 i  } | |  _ n X| | k rS | | d } n  | d  k r~ d  } | d  k	 r | | =q n | | f | | <| S(   Ni    (   R   RP   RQ   (   R	   RS   R<   t   handlert   oldt   d(    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyt   setUserData   s    c         C   sd   t  |  d  r` xN |  j j   D]: \ } \ } } | d  k	 r | j | | | | |  q q Wn  d  S(   NRP   (   t   hasattrRP   t   itemsR   t   handle(   R	   t	   operationt   srct   dstRS   R<   RU   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyt   _call_user_data_handler   s    "c         C   s\   d  |  _ |  _ |  j rF x |  j D] } | j   q# Wt   |  _ n  d  |  _ d  |  _ d  S(   N(   R   R(   RD   R   R=   t   NodeListR2   R1   (   R	   RB   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyR=     s    		N(   t   __name__t
   __module__R   t   namespaceURIR(   RD   R1   R2   R   t   prefixR
   R   R   R   R   R   R   R"   R*   R9   R)   R@   RF   RK   RL   RN   RO   RT   RX   R_   R=   (    (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyR   !   s6   						 		 							
			t
   firstChildt   docs   First child node, or None.t	   lastChilds   Last child node, or None.t	   localNames"   Namespace-local name of this node.c         C   sT   |  j  } | r6 | d } | | j d <| | j d <n  | j |  |  | j d <d  S(   NiR2   R1   R(   (   R   t   __dict__R>   (   R	   R6   R   t   last(    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyR7     s    	
c         C   s6   x/ |  d  k	 r1 |  j t j k r% t S|  j }  q Wt S(   N(   R   R   R   R   R   R(   R   (   R6   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyt   _in_document  s
    c         C   sP   | rL | j  d d  j  d d  j  d d  j  d d  } |  j |  n  d	 S(
   s   Writes datachars to writer.t   &s   &amp;t   <s   &lt;s   "s   &quot;t   >s   &gt;N(   t   replacet   write(   R   R<   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyt   _write_data%  s    c         C   se   x^ |  j  D]S } | j t j k rM | d k s= | j | k rM | j |  n  t | | |  q
 W| S(   NR   (   R   R   R   R?   t   tagNameR>   t   _get_elements_by_tagName_helper(   t   parentt   namet   rcR6   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyRs   ,  s    c         C   s   x |  j  D]t } | j t j k r
 | d k s= | j | k rh | d k sX | j | k rh | j |  n  t | | | |  q
 q
 W| S(   NR   (   R   R   R   R?   Rh   Rc   R>   t"   _get_elements_by_tagName_ns_helper(   Rt   t   nsURIRh   Rv   R6   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyRw   4  s    t   DocumentFragmentc           B   sb   e  Z e j Z d  Z d Z d Z d Z	 e j
 e j e j e j e j e j e j f Z d   Z RS(   s   #document-fragmentc         C   s   t    |  _ d  S(   N(   R`   R   (   R	   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyt   __init__K  s    N(   Ra   Rb   R   R    R   t   nodeNameR   t	   nodeValuet
   attributesR(   R?   R;   t   CDATA_SECTION_NODEt   ENTITY_REFERENCE_NODEt   PROCESSING_INSTRUCTION_NODEt   COMMENT_NODEt   NOTATION_NODER#   Rz   (    (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyRy   =  s   	t   Attrc           B   s   e  Z e j Z d	 Z d	 Z e Z	 e Z
 e j e j f Z e d	 d	 d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z RS(
   c         C   sS   |  j  } | | d <| d <| | d <| | d <t   | d <|  j j t    d  S(   NR{   Ru   Rc   Rd   R   (   Ri   R`   R   R>   t   Text(   R	   t   qNameRc   Rh   Rd   RW   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyRz   X  s    	

c         C   s   |  j  j d d  d S(   Nt   :i   i(   R{   t   split(   R	   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyRL   f  s    c         C   s   |  j  S(   N(   t	   specified(   R	   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyt   _get_specifiedi  s    c         C   s   |  j  } | d k rk | | d <| d <|  j d j  } | | d <| d <|  j d  k	 r t |  j  q nJ | d k r | | d <| d <|  j d  k	 r t |  j  q n
 | | | <d  S(	   Nt   valueR|   i    R<   Ru   R{   (   R   R|   (   Ru   R{   (   Ri   R   t   ownerElementR   R/   (   R	   Ru   R   RW   t   d2(    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyt   __setattr__l  s    	c         C   s   |  j  } | d k r? | r? | t k r? t j j d   q? n  |  j } | | d <| d  k rj |  j } n d | |  j f } |  j r t	 |  j  n  | | d <| d <d  S(   Nt   xmlnss5   illegal use of 'xmlns' prefix for the wrong namespaceRd   s   %s:%sR{   Ru   (
   Rc   R   R$   R%   t   NamespaceErrRi   R   Rh   R   R/   (   R	   Rd   t   nsuriRW   t   newName(    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyt   _set_prefix{  s    			
	c         C   sH   |  j  } | | d <| d <|  j r4 t |  j  n  | |  j d _ d  S(   NR   R|   i    (   Ri   R   R/   R   R<   (   R	   R   RW   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyt
   _set_value  s
    		c         C   s   |  j  } | d  k	 rq | j |  j =| j |  j |  j f =|  j rq t |  _ | j	 d 8_	 |  j
 j d 8_ qq n  x |  j D] } | j   q{ W|  j 2d  S(   Ni   (   R   R   t   _attrsR{   t   _attrsNSRc   Rh   t   _is_idR   t   _magic_id_nodesRD   t   _magic_id_countR   R=   (   R	   t   elemRB   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyR=     s    			c         C   s   |  j  r t S|  j } |  j } | d  k s7 | d  k r; t S| j |  } | d  k rZ t S|  j ry | j |  j |  j	  S| j
 |  j  Sd  S(   N(   R   R   RD   R   R   R   t   _get_elem_infoRc   t   isIdNSRh   t   isIdR{   (   R	   Rf   R   t   info(    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyt	   _get_isId  s    				c         C   s   |  j  } |  j } | d  k s* | d  k r. t S| j |  } | d  k rM t S|  j rl | j |  j |  j  S| j |  j	  Sd  S(   N(
   RD   R   R   t   _no_typeR   Rc   t   getAttributeTypeNSRh   t   getAttributeTypeR{   (   R	   Rf   R   R   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyt   _get_schemaType  s    			N(   Ra   Rb   R   t   ATTRIBUTE_NODER   R   R}   R   R   R   R   R;   R   R#   R    Rz   RL   R   R   R   R   R=   R   R   (    (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyR   O  s    								R   s    True if this attribute is an ID.s'   Namespace-local name of this attribute.t
   schemaTypes   Schema type for this attribute.t   NamedNodeMapc           B   s   e  Z d  Z d Z d   Z d   Z d   Z d   Z d   Z d	   Z	 d
   Z
 d   Z d   Z d d  Z e Z d Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z RS(   s  The 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.
    R   R   t   _ownerElementc         C   s   | |  _  | |  _ | |  _ d  S(   N(   R   R   R   (   R	   t   attrst   attrsNSR   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyRz     s    		c         C   s   t  |  j  S(   N(   t   lenR   (   R	   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyt   _get_length  s    c         C   s2   y |  |  j  j   | SWn t k
 r- d  SXd  S(   N(   R   t   keyst
   IndexErrorR   (   R	   R+   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyt   item  s    c         C   s=   g  } x0 |  j  j   D] } | j | j | j f  q W| S(   N(   R   t   valuesR>   R{   R   (   R	   RA   R6   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyRZ     s    c         C   sF   g  } x9 |  j  j   D]( } | j | j | j f | j f  q W| S(   N(   R   R   R>   Rc   Rh   R   (   R	   RA   R6   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyt   itemsNS  s    &c         C   s-   t  | t  r | |  j k S| |  j k Sd  S(   N(   t
   isinstancet   StringTypesR   R   (   R	   RS   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyt   has_key  s    c         C   s   |  j  j   S(   N(   R   R   (   R	   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyR     s    c         C   s   |  j  j   S(   N(   R   R   (   R	   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyt   keysNS  s    c         C   s   |  j  j   S(   N(   R   R   (   R	   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyR     s    c         C   s   |  j  j | |  S(   N(   R   t   get(   R	   Ru   R   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyR     s    c         C   s<   |  j  t | d d   k r d St t |   t |   Sd  S(   NR   i    (   R   t   getattrR   t   cmpt   id(   R	   RM   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyt   __cmp__   s    c         C   s)   t  | t  r |  j | S|  j | Sd  S(   N(   R   R!   R   R   (   R	   t   attname_or_tuple(    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyt   __getitem__  s    c         C   s   t  | t  rh y |  j | } Wn9 t k
 r[ t |  } |  j j | _ |  j |  n X| | _ n. t  | t  s t	 d  n  | } |  j |  d  S(   Ns%   value must be a string or Attr object(
   R   R   R   RR   R   R   RD   t   setNamedItemR   t	   TypeError(   R	   t   attnameR   R6   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyt   __setitem__  s    c         C   s(   y |  j  | SWn t k
 r# d  SXd  S(   N(   R   RR   R   (   R	   Ru   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyt   getNamedItem  s    c         C   s.   y |  j  | | f SWn t k
 r) d  SXd  S(   N(   R   RR   R   (   R	   Rc   Rh   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyt   getNamedItemNS"  s    c         C   s   |  j  |  } | d  k	 rn t |  j  |  j | j =|  j | j | j f =d | j	 k rj d  | j	 d <n  | St
 j j    d  S(   NR   (   R   R   R/   R   R   R{   R   Rc   Rh   Ri   R$   R%   R-   (   R	   Ru   t   n(    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyt   removeNamedItem(  s    c         C   s   |  j  | |  } | d  k	 rq t |  j  |  j | j | j f =|  j | j =d | j	 k rm d  | j	 d <n  | St
 j j    d  S(   NR   (   R   R   R/   R   R   Rc   Rh   R   R{   Ri   R$   R%   R-   (   R	   Rc   Rh   R   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyt   removeNamedItemNS4  s    c         C   s   t  | t  s: t j j d t |  t |   f   n  |  j j | j  } | rb | j	   n  | |  j | j <| |  j
 | j | j f <|  j | _ t | j  | S(   Ns   %s cannot be child of %s(   R   R   R$   R%   R&   R'   R   R   Ru   R=   R   Rc   Rh   R   R   R/   (   R	   R6   RV   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyR   @  s    	"c         C   s   |  j  |  S(   N(   R   (   R	   R6   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyt   setNamedItemNSM  s    c         C   s%   |  | } t  | j  | j   d  S(   N(   R/   R   R=   (   R	   R   R6   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyt   __delitem__P  s    
c         C   s   |  j  |  j |  j f S(   N(   R   R   R   (   R	   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyt   __getstate__U  s    c         C   s   | \ |  _  |  _ |  _ d  S(   N(   R   R   R   (   R	   t   state(    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyt   __setstate__X  s    (   R   R   R   N(   Ra   Rb   t   __doc__t	   __slots__Rz   R   R   RZ   R   R   R   R   R   R   R   t   __len__t   __hash__R   R   R   R   R   R   R   R   R   R   R   R   (    (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyR     s4   																				t   lengths$   Number of nodes in the NamedNodeMap.t   TypeInfoc           B   s2   e  Z d Z d   Z d   Z d   Z d   Z RS(   t	   namespaceRu   c         C   s   | |  _  | |  _ d  S(   N(   R   Ru   (   R	   R   Ru   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyRz   d  s    	c         C   s,   |  j  r d |  j |  j  f Sd |  j Sd  S(   Ns   <TypeInfo %r (from %r)>s   <TypeInfo %r>(   R   Ru   (   R	   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyt   __repr__h  s    	c         C   s   |  j  S(   N(   Ru   (   R	   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyt	   _get_namen  s    c         C   s   |  j  S(   N(   R   (   R	   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyt   _get_namespaceq  s    (   R   Ru   (   Ra   Rb   R   Rz   R   R   R   (    (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyR   a  s
   			t   Elementc           B   sL  e  Z e j Z d Z e Z d  Z	 e j e j
 e j e j e j e j f Z e d d d  Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d	   Z d
   Z d   Z e Z d   Z d   Z d   Z e Z  d   Z! d   Z" d   Z# d   Z$ d   Z% d d d d  Z& d   Z' d   Z( d   Z) d   Z* d   Z+ RS(   i    c         C   sD   | |  _  |  _ | |  _ | |  _ t   |  _ i  |  _ i  |  _ d  S(   N(   Rr   R{   Rd   Rc   R`   R   R   R   (   R	   Rr   Rc   Rd   Rh   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyRz     s    			c         C   s   |  j  j d d  d S(   NR   i   i(   Rr   R   (   R	   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyRL     s    c         C   s   |  j  S(   N(   Rr   (   R	   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyt   _get_tagName  s    c         C   sG   x! |  j  j   D] } | j   q Wd  |  _  d  |  _ t j |   d  S(   N(   R   R   R=   R   R   R   (   R	   t   attr(    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyR=     s
    		c         C   s+   y |  j  | j SWn t k
 r& d SXd  S(   NR   (   R   R   RR   (   R	   R   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyt   getAttribute  s    c         C   s1   y |  j  | | f j SWn t k
 r, d SXd  S(   NR   (   R   R   RR   (   R	   Rc   Rh   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyt   getAttributeNS  s    c         C   s   |  j  |  } | d  k r_ t |  } | j } | | d <| d <|  j | d <|  j |  nC | | j k r | j } | | d <| d <| j r t |   q n  d  S(   NR   R|   RD   (	   t   getAttributeNodeR   R   Ri   RD   t   setAttributeNodeR   R   R/   (   R	   R   R   R   RW   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyt   setAttribute  s    			c         C   s   t  |  \ } } |  j | |  } | d  k r t | | | |  } | j } | | d <| | d <| | d <| d <|  j | d <|  j |  ni | j } | | j k r | | d <| d <| j r t	 |   q n  | j
 | k r | | d <| | d <n  d  S(   NRd   R{   R   R|   RD   (   t   _nssplitt   getAttributeNodeNSR   R   Ri   RD   R   R   R   R/   Rd   (   R	   Rc   t   qualifiedNameR   Rd   t	   localnameR   RW   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyt   setAttributeNS  s$    	

		
c         C   s   |  j  j |  S(   N(   R   R   (   R	   t   attrname(    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyR     s    c         C   s   |  j  j | | f  S(   N(   R   R   (   R	   Rc   Rh   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyR     s    c         C   s   | j  d  |  f k r* t j j d   n  |  j j | j d   } | d  k	 r^ |  j |  n  |  j	 j | j
 | j f d   } | d  k	 r | | k	 r |  j |  n  t |  |  | | k	 r | S| | k	 r | Sd  S(   Ns   attribute node already owned(   R   R   R$   R%   t   InuseAttributeErrR   R   Ru   t   removeAttributeNodeR   Rc   Rh   t   _set_attribute_node(   R	   R   t   old1t   old2(    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyR     s    !c         C   sE   y |  j  | } Wn  t k
 r3 t j j    n X|  j |  d  S(   N(   R   RR   R$   R%   R-   R   (   R	   Ru   R   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyt   removeAttribute  s
    c         C   sK   y |  j  | | f } Wn  t k
 r9 t j j    n X|  j |  d  S(   N(   R   RR   R$   R%   R-   R   (   R	   Rc   Rh   R   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyt   removeAttributeNS  s
    c         C   sw   | d  k r t j j    n  y |  j | j Wn  t k
 rR t j j    n Xt |   | j   |  j	 | _	 d  S(   N(
   R   R$   R%   R-   R   Ru   RR   R/   R=   RD   (   R	   R6   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyR     s    

c         C   s   | |  j  k S(   N(   R   (   R	   Ru   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyt   hasAttribute  s    c         C   s   | | f |  j  k S(   N(   R   (   R	   Rc   Rh   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyt   hasAttributeNS  s    c         C   s   t  |  | t    S(   N(   Rs   R`   (   R	   Ru   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyt   getElementsByTagName  s    c         C   s   t  |  | | t    S(   N(   Rw   R`   (   R	   Rc   Rh   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyt   getElementsByTagNameNS  s    c         C   s   d |  j  t |   f S(   Ns   <DOM Element: %s at %#x>(   Rr   R   (   R	   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyR     s    R   c   	      C   s[  | j  | d |  j  |  j   } | j   } | j   x@ | D]8 } | j  d |  t | | | j  | j  d  qA W|  j rF| j  d  t |  j  d k r |  j d j	 t
 j k r |  j d j | d d d  nH | j  |  x+ |  j D]  } | j | | | | |  q W| j  |  | j  d |  j | f  n | j  d	 |  d  S(
   NRm   s    %s="s   "Rn   i   i    R   s   </%s>%ss   />%s(   Rp   Rr   t   _get_attributesR   t   sortRq   R   R   R   R   R   R;   R   (	   R	   R   R   t	   addindentR   R   t   a_namest   a_nameR6   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyR     s&    
	 c         C   s   t  |  j |  j |   S(   N(   R   R   R   (   R	   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyR   4  s    c         C   s   |  j  r t St Sd  S(   N(   R   R   R   (   R	   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyt   hasAttributes7  s    	c         C   s    |  j  |  } |  j |  d  S(   N(   R   t   setIdAttributeNode(   R	   Ru   t   idAttr(    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyt   setIdAttribute?  s    c         C   s#   |  j  | |  } |  j |  d  S(   N(   R   R   (   R	   Rc   Rh   R   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyt   setIdAttributeNSC  s    c         C   s   | d  k s |  j | j  r1 t j j    n  t |   d  k	 rU t j j    n  | j s t	 | j
 d <|  j d 7_ |  j j d 7_ t |   n  d  S(   NR   i   (   R   RN   R   R$   R%   R-   t   _get_containing_entreft   NoModificationAllowedErrR   R   Ri   R   RD   R   R/   (   R	   R   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyR   G  s    	N(,   Ra   Rb   R   R?   R   R   R|   R   R   R   R   R   R;   R~   R   R#   R    Rz   RL   R   R=   R   R   R   R   R   R   R   t   setAttributeNodeNSR   R   R   t   removeAttributeNodeNSR   R   R   R   R   R   R   R   R   R   R   (    (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyR   v  sL   																							R}   s*   NamedNodeMap of attributes on the element.s%   Namespace-local name of this element.c         C   sD   t  |   | |  j | j <| |  j | j | j f <|  | j d <d  S(   NR   (   R/   R   Ru   R   Rc   Rh   Ri   (   t   elementR   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyR   X  s    
t	   Childlessc           B   sq   e  Z d  Z d	 Z e   Z d	 Z d	 Z d   Z	 d   Z
 d   Z d   Z d   Z d   Z d   Z d   Z RS(
   s   Mixin that makes childless-ness easy to implement and avoids
    the complexity of the Node methods that deal with children.
    c         C   s   d  S(   N(   R   (   R	   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyR   m  s    c         C   s   d  S(   N(   R   (   R	   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyR   p  s    c         C   s   t  j j |  j d   d  S(   Ns    nodes cannot have children(   R$   R%   R&   R{   (   R	   R6   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyR*   s  s    	c         C   s   t  S(   N(   R   (   R	   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyR   w  s    c         C   s   t  j j |  j d   d  S(   Ns    nodes do not have children(   R$   R%   R&   R{   (   R	   R3   R4   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyR"   z  s    	c         C   s   t  j j |  j d   d  S(   Ns    nodes do not have children(   R$   R%   R-   R{   (   R	   R8   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyR)   ~  s    	c         C   s   d  S(   N(    (   R	   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyR@     s    c         C   s   t  j j |  j d   d  S(   Ns    nodes do not have children(   R$   R%   R&   R{   (   R	   R3   R8   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyR9     s    	N(   Ra   Rb   R   R   R}   t   EmptyNodeListR   Re   Rg   R   R   R*   R   R"   R)   R@   R9   (    (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyR   c  s   								t   ProcessingInstructionc           B   sY   e  Z e j Z d    Z d   Z d   Z d   Z d   Z	 d   Z
 d d d d  Z RS(   c         C   s$   | |  _  |  _ | |  _ |  _ d  S(   N(   t   targetR{   R<   R|   (   R	   R   R<   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyRz     s    c         C   s   |  j  S(   N(   R<   (   R	   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyt	   _get_data  s    c         C   s   |  j  } | | d <| d <d  S(   NR<   R|   (   Ri   (   R	   R   RW   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyt	   _set_data  s    	c         C   s   |  j  S(   N(   R   (   R	   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyt   _get_target  s    c         C   s   |  j  } | | d <| d <d  S(   NR   R{   (   Ri   (   R	   R   RW   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyt   _set_target  s    	c         C   sw   | d k s | d k r3 | |  j  d <|  j  d <n@ | d k sK | d k rf | |  j  d <|  j  d <n | |  j  | <d  S(   NR<   R|   R   R{   (   Ri   (   R	   Ru   R   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyR     s
    R   c         C   s'   | j  d | |  j |  j | f  d  S(   Ns   %s<?%s %s?>%s(   Rp   R   R<   (   R	   R   R   R   R   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyR     s    (   Ra   Rb   R   R   R   Rz   R   R   R  R  R   R   (    (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyR     s   							t   CharacterDatac           B   st   e  Z d    Z e Z d   Z d   Z e Z e Z d   Z d   Z	 d   Z
 d   Z d   Z d   Z d	   Z RS(
   c         C   s   t  |  j  S(   N(   R   R<   (   R	   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyR     s    c         C   s   |  j  d S(   NR<   (   Ri   (   R	   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyR     s    c         C   s   |  j  } | | d <| d <d  S(   NR<   R|   (   Ri   (   R	   R<   RW   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyR     s    	c         C   sD   | d k s | d k r3 | |  j  d <|  j  d <n | |  j  | <d  S(   NR<   R|   (   Ri   (   R	   Ru   R   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyR     s    c         C   sH   |  j  } t |  d k r$ d } n d } d |  j j | d d !| f S(   Ni
   s   ...R   s   <DOM %s node "%r%s">i    (   R<   R   t	   __class__Ra   (   R	   R<   t	   dotdotdot(    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyR     s    		c         C   s~   | d k  r! t  j j d   n  | t |  j  k rK t  j j d   n  | d k  rl t  j j d   n  |  j | | | !S(   Ni    s   offset cannot be negatives#   offset cannot be beyond end of datas   count cannot be negative(   R$   R%   t   IndexSizeErrR   R<   (   R	   t   offsett   count(    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyt   substringData  s    c         C   s   |  j  | |  _  d  S(   N(   R<   (   R	   t   arg(    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyt
   appendData  s    c         C   s|   | d k  r! t  j j d   n  | t |  j  k rK t  j j d   n  | rx d |  j |  | |  j | f |  _ n  d  S(   Ni    s   offset cannot be negatives#   offset cannot be beyond end of datas   %s%s%s(   R$   R%   R  R   R<   (   R	   R  R
  (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyt
   insertData  s    c         C   s   | d k  r! t  j j d   n  | t |  j  k rK t  j j d   n  | d k  rl t  j j d   n  | r |  j |  |  j | | |  _ n  d  S(   Ni    s   offset cannot be negatives#   offset cannot be beyond end of datas   count cannot be negative(   R$   R%   R  R   R<   (   R	   R  R  (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyt
   deleteData  s    c         C   s   | d k  r! t  j j d   n  | t |  j  k rK t  j j d   n  | d k  rl t  j j d   n  | r d |  j |  | |  j | | f |  _ n  d  S(   Ni    s   offset cannot be negatives#   offset cannot be beyond end of datas   count cannot be negatives   %s%s%s(   R$   R%   R  R   R<   (   R	   R  R  R
  (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyt   replaceData  s    (   Ra   Rb   R   R   R   R   t   _get_nodeValuet   _set_nodeValueR   R   R	  R  R  R  R  (    (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyR    s   												
s   Length of the string data.R   c           B   sS   e  Z e j Z d  Z d Z d   Z d d d d  Z	 d   Z
 d   Z d   Z RS(   s   #textc         C   s   | d k  s! | t  |  j  k r6 t j j d   n  |  j   } |  j | | _ |  j | _ |  j } |  j r |  |  j j	 k r | d  k r |  j j |  q |  j j | |  n  |  j |  |  _ | S(   Ni    s   illegal offset value(   R   R<   R$   R%   R  R  RD   R1   R(   R   R   R*   R"   (   R	   R  t   newTextt   next(    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyt	   splitText  s    !	R   c         C   s!   t  | d | |  j | f  d  S(   Ns   %s%s%s(   Rq   R<   (   R	   R   R   R   R   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyR     s    c         C   s   |  j  g } |  j } xK | d  k	 rb | j t j t j f k r^ | j d | j   | j } q Pq W|  j } xH | d  k	 r | j t j t j f k r | j	 | j   | j } qo Pqo Wd j
 |  S(   Ni    R   (   R<   R2   R   R   R   R;   R~   R0   R1   R>   t   join(   R	   RA   R   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyt   _get_wholeText  s    		c         C   s   |  j  } |  j } xK | d  k	 r_ | j t j t j f k r[ | j } | j |  | } q Pq W|  j } | s | j |   n  xK | d  k	 r | j t j t j f k r | j } | j |  | } q Pq W| r |  j	 } | | d <| | d <|  Sd  Sd  S(   NR<   R|   (
   R(   R2   R   R   R   R;   R~   R)   R1   Ri   (   R	   t   contentRt   R   R  RW   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyt   replaceWholeText$  s.    								

c         C   s_   |  j  j   r t St |   } | d  k r/ t S|  j j |  } | d  k rQ t S| j   Sd  S(   N(   R<   t   stripR   t   _get_containing_elementR   RD   R   t   isElementContent(   R	   R   R   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyt!   _get_isWhitespaceInElementContentB  s    N(   Ra   Rb   R   R;   R   R{   R   R}   R  R   R  R  R  (    (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyR     s   				t   isWhitespaceInElementContentsK   True iff this text node contains only whitespace and is in element content.t	   wholeTexts.   The text of all logically-adjacent text nodes.c         C   s?   |  j  } x/ | d  k	 r: | j t j k r. | S| j  } q Wd  S(   N(   R(   R   R   R   R?   (   R6   R5   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyR  U  s    	c         C   s?   |  j  } x/ | d  k	 r: | j t j k r. | S| j  } q Wd  S(   N(   R(   R   R   R   R   (   R6   R5   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyR   ]  s    	t   Commentc           B   s2   e  Z e j Z d  Z d   Z d d d d  Z RS(   s   #commentc         C   s   | |  _  |  _ d  S(   N(   R<   R|   (   R	   R<   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyRz   j  s    R   c         C   s?   d |  j  k r t d   n  | j d | |  j  | f  d  S(   Ns   --s%   '--' is not allowed in a comment nodes   %s<!--%s-->%s(   R<   R,   Rp   (   R	   R   R   R   R   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyR   m  s    (   Ra   Rb   R   R   R   R{   Rz   R   (    (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyR  f  s   		t   CDATASectionc           B   s)   e  Z e j Z d  Z d d d d  Z RS(   s   #cdata-sectionR   c         C   s?   |  j  j d  d k r' t d   n  | j d |  j   d  S(   Ns   ]]>i    s$   ']]>' not allowed in a CDATA sections   <![CDATA[%s]]>(   R<   t   findR,   Rp   (   R	   R   R   R   R   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyR   |  s    (   Ra   Rb   R   R~   R   R{   R   (    (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyR  s  s   	t   ReadOnlySequentialNamedNodeMapc           B   s   e  Z d Z d d  Z d   Z d   Z d   Z d   Z d   Z d   Z	 d   Z
 d	   Z d
   Z d   Z d   Z d   Z RS(   t   _seqc         C   s   | |  _  d  S(   N(   R"  (   R	   t   seq(    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyRz     s    c         C   s   t  |  j  S(   N(   R   R"  (   R	   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyR     s    c         C   s   t  |  j  S(   N(   R   R"  (   R	   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyR     s    c         C   s+   x$ |  j  D] } | j | k r
 | Sq
 Wd  S(   N(   R"  R{   (   R	   Ru   R   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyR     s    c         C   s:   x3 |  j  D]( } | j | k r
 | j | k r
 | Sq
 Wd  S(   N(   R"  Rc   Rh   (   R	   Rc   Rh   R   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyR     s    c         C   sL   t  | t  r! |  j |   } n |  j |  } | d  k rH t |  n  | S(   N(   R   R!   R   R   R   RR   (   R	   t   name_or_tupleR6   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyR     s    c         C   s8   | d k  r d  Sy |  j | SWn t k
 r3 d  SXd  S(   Ni    (   R   R"  R   (   R	   R+   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyR     s    c         C   s   t  j j d   d  S(   Ns"   NamedNodeMap instance is read-only(   R$   R%   R   (   R	   Ru   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyR     s    	c         C   s   t  j j d   d  S(   Ns"   NamedNodeMap instance is read-only(   R$   R%   R   (   R	   Rc   Rh   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyR     s    	c         C   s   t  j j d   d  S(   Ns"   NamedNodeMap instance is read-only(   R$   R%   R   (   R	   R6   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyR     s    	c         C   s   t  j j d   d  S(   Ns"   NamedNodeMap instance is read-only(   R$   R%   R   (   R	   R6   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyR     s    	c         C   s
   |  j  g S(   N(   R"  (   R	   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyR     s    c         C   s   | d |  _  d  S(   Ni    (   R"  (   R	   R   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyR     s    (   R"  (    (   Ra   Rb   R   Rz   R   R   R   R   R   R   R   R   R   R   R   R   (    (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyR!    s   												s&   Number of entries in the NamedNodeMap.t
   Identifiedc           B   s)   e  Z d  Z d   Z d   Z d   Z RS(   s@   Mix-in class that supports the publicId and systemId attributes.c         C   s   | |  _  | |  _ d  S(   N(   t   publicIdt   systemId(   R	   R&  R'  (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyt   _identified_mixin_init  s    	c         C   s   |  j  S(   N(   R&  (   R	   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyt   _get_publicId  s    c         C   s   |  j  S(   N(   R'  (   R	   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyt   _get_systemId  s    (   Ra   Rb   R   R(  R)  R*  (    (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyR%    s   		t   DocumentTypec           B   s\   e  Z e j Z d Z d Z d Z d Z	 d Z
 d    Z d   Z d   Z d d d d  Z RS(   c         C   sL   t    |  _ t    |  _ | r< t |  \ } } | |  _ n  |  j |  _ d  S(   N(   R!  t   entitiest	   notationsR   Ru   R{   (   R	   R   Rd   R   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyRz     s    c         C   s   |  j  S(   N(   t   internalSubset(   R	   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyt   _get_internalSubset  s    c         C   s\  |  j  d  k rTt d   } |  j | _ |  j | _ t j j j } | r=g  | j	 _
 g  | j _
 xU |  j j
 D]G } t | j | j | j  } | j j
 j |  | j | | |  qm Wx |  j	 j
 D]q } t | j | j | j | j  } | j | _ | j | _ | j | _ | j	 j
 j |  | j | | |  q Wn  |  j | |  |  | Sd  Sd  S(   N(   RD   R   R+  Ru   R{   R$   R%   t   UserDataHandlert   NODE_CLONEDR,  R"  R-  t   NotationR&  R'  R>   R_   t   Entityt   notationNamet   actualEncodingR   RJ   (   R	   RE   t   cloneR\   R   t   notationt   et   entity(    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyRF     s.    R   c         C   s   | j  d  | j  |  j  |  j rL | j  d | |  j | |  j f  n& |  j rr | j  d | |  j f  n  |  j d  k	 r | j  d  | j  |  j  | j  d  n  | j  d |  d  S(   Ns
   <!DOCTYPE s   %s  PUBLIC '%s'%s  '%s's   %s  SYSTEM '%s's    [t   ]Rn   (   Rp   Ru   R&  R'  R.  R   (   R	   R   R   R   R   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyR     s    			N(   Ra   Rb   R   t   DOCUMENT_TYPE_NODER   R   R|   Ru   R&  R'  R.  Rz   R/  RF   R   (    (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyR+    s   				R3  c           B   sw   e  Z d Z e j Z d Z d Z d Z	 d Z
 d    Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z RS(	   c         C   s2   | |  _  | |  _ t   |  _ |  j | |  d  S(   N(   R{   R4  R`   R   R(  (   R	   Ru   R&  R'  R7  (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyRz     s    		c         C   s   |  j  S(   N(   R5  (   R	   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyt   _get_actualEncoding  s    c         C   s   |  j  S(   N(   R   (   R	   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyt   _get_encoding"  s    c         C   s   |  j  S(   N(   RJ   (   R	   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyt   _get_version%  s    c         C   s   t  j j d   d  S(   Ns(   cannot append children to an entity node(   R$   R%   R&   (   R	   R3   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyR*   (  s    	c         C   s   t  j j d   d  S(   Ns+   cannot insert children below an entity node(   R$   R%   R&   (   R	   R3   R4   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyR"   ,  s    	c         C   s   t  j j d   d  S(   Ns*   cannot remove children from an entity node(   R$   R%   R&   (   R	   R8   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyR)   0  s    	c         C   s   t  j j d   d  S(   Ns)   cannot replace children of an entity node(   R$   R%   R&   (   R	   R3   R8   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyR9   4  s    	N(   Ra   Rb   R   R}   R   t   ENTITY_NODER   R|   R5  R   RJ   Rz   R<  R=  R>  R*   R"   R)   R9   (    (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyR3    s   								R2  c           B   s    e  Z e j Z d Z d    Z RS(   c         C   s   | |  _  |  j | |  d  S(   N(   R{   R(  (   R	   Ru   R&  R'  (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyRz   <  s    	N(   Ra   Rb   R   R   R   R   R|   Rz   (    (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyR2  8  s   	t   DOMImplementationc        	   B   sS   e  Z d d d d d d d d g Z d   Z d   Z d   Z d	   Z d
   Z RS(   t   cores   1.0s   2.0R$   s   ls-loads   3.0c         C   s.   | d k r d  } n  | j   | f |  j k S(   NR   (   R   t   lowert	   _features(   R	   RI   RJ   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyRH   L  s    	c   	      C   sK  | r* | j  d  k	 r* t j j d   n  |  j   } | d  k oW | d  k oW | d  k } | r} | r} t j j d   n  | rt |  \ } } | d k r | d k r t j j d   n  | r | r t j j d   n  | j	 | |  } | r| j
 |  n  | j
 |  n  | r5| | _  | _ n  | | _ |  | _ | S(   Ns(   doctype object owned by another DOM trees   Element with no nameR$   s$   http://www.w3.org/XML/1998/namespaces   illegal use of 'xml' prefixs(   illegal use of prefix without namespaces(   R(   R   R$   R%   t   WrongDocumentErrt   _create_documentt   InvalidCharacterErrR   R   t   createElementNSR*   RD   t   doctypeRG   (	   R	   Rc   R   RH  Rf   t   add_root_elementRd   R   R   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyt   createDocumentQ  s4    				c         C   s"   t  |  } | | _ | | _ | S(   N(   R+  R&  R'  (   R	   R   R&  R'  RH  (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyt   createDocumentType~  s    		c         C   s   |  j  | d   r |  Sd  Sd  S(   N(   RH   R   (   R	   RI   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyRO     s    c         C   s   t    S(   N(   t   Document(   R	   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyRE    s    (   RA  s   1.0(   RA  s   2.0N(   RA  N(   R$   s   1.0(   R$   s   2.0(   R$   N(   s   ls-loads   3.0(   s   ls-loadN(	   Ra   Rb   R   RC  RH   RJ  RK  RO   RE  (    (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyR@  A  s   			-		t   ElementInfoc           B   se   e  Z d  Z d Z d   Z d   Z d   Z d   Z d   Z d   Z	 d   Z
 d	   Z d
   Z RS(   s   Object 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.

    Rr   c         C   s   | |  _  d  S(   N(   Rr   (   R	   Ru   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyRz     s    c         C   s   t  S(   N(   R   (   R	   t   aname(    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyR     s    c         C   s   t  S(   N(   R   (   R	   Rc   Rh   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyR     s    c         C   s   t  S(   N(   R   (   R	   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyR    s    c         C   s   t  S(   sQ   Returns true iff this element is declared to have an EMPTY
        content model.(   R   (   R	   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyt   isEmpty  s    c         C   s   t  S(   s7   Returns true iff the named attribute is a DTD-style ID.(   R   (   R	   RN  (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyR     s    c         C   s   t  S(   s<   Returns true iff the identified attribute is a DTD-style ID.(   R   (   R	   Rc   Rh   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyR     s    c         C   s   |  j  S(   N(   Rr   (   R	   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyR     s    c         C   s   | |  _  d  S(   N(   Rr   (   R	   R   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyR     s    (   Rr   (   Ra   Rb   R   R   Rz   R   R   R  RO  R   R   R   R   (    (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyRM    s   								c         C   sZ   |  j  t j k r+ |  j j   d  |  _ n+ t |   rV |  j j j   d  |  j _ n  d  S(   N(	   R   R   R   t	   _id_cachet   clearR   t   _id_search_stackRk   RD   (   R6   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyR/     s    RL  c           B   s  e  Z e j e j e j e j f Z e j Z	 d  Z
 d$ Z d$ Z d$ Z d$ Z d$ Z Z e   Z d$ Z d$ Z d$ Z d$ Z e Z d$ Z d$ Z d Z d   Z d   Z d   Z d   Z  d   Z! d   Z" d   Z# d	   Z$ d
   Z% d   Z& d   Z' d   Z( d   Z) d   Z* d   Z+ d   Z, d   Z- d   Z. d   Z/ d   Z0 d   Z1 d   Z2 d   Z3 d   Z4 d   Z5 d   Z6 d   Z7 d   Z8 d   Z9 d   Z: d    Z; d! d! d! d$ d"  Z< d#   Z= RS(%   s	   #documenti    c         C   s+   t    |  _ i  |  _ i  |  _ d  |  _ d  S(   N(   R`   R   t
   _elem_infoRP  R   RR  (   R	   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyRz     s    		c         C   s7   | j  r | j  | j f } n	 | j } |  j j |  S(   N(   Rc   Rh   Rr   RS  R   (   R	   R   RS   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyR     s    		c         C   s   |  j  S(   N(   R5  (   R	   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyR<    s    c         C   s   |  j  S(   N(   RH  (   R	   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyt   _get_doctype  s    c         C   s   |  j  S(   N(   t   documentURI(   R	   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyt   _get_documentURI  s    c         C   s   |  j  S(   N(   R   (   R	   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyR=    s    c         C   s   |  j  S(   N(   t   errorHandler(   R	   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyt   _get_errorHandler  s    c         C   s   |  j  S(   N(   t
   standalone(   R	   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyt   _get_standalone  s    c         C   s   |  j  S(   N(   t   strictErrorChecking(   R	   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyt   _get_strictErrorChecking  s    c         C   s   |  j  S(   N(   RJ   (   R	   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyR>     s    c         C   s   | j  |  j k r= t j j d t |  t |   f   n  | j d  k	 r_ | j j |  n  | j  t	 j
 k r |  j   r t j j d   n  t	 j |  |  S(   Ns   %s cannot be child of %ss    two document elements disallowed(   R   R#   R$   R%   R&   R'   R(   R   R)   R   R?   t   _get_documentElementR*   (   R	   R6   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyR*     s    	"	c         C   so   y |  j  j |  Wn  t k
 r6 t j j    n Xd  | _ | _ d  | _	 |  j
 | k rk d  |  _
 n  | S(   N(   R   R:   R,   R$   R%   R-   R   R1   R2   R(   t   documentElement(   R	   R8   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyR)     s    	c         C   s.   x' |  j  D] } | j t j k r
 | Sq
 Wd  S(   N(   R   R   R   R?   (   R	   R6   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyR]    s    c         C   s9   |  j  d  k	 r( |  j  j   d  |  _  n  t j |   d  S(   N(   RH  R   R=   R   (   R	   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyR=   $  s    c         C   s  | s
 d  S|  j j d  d  d   } |  j | _ |  j | _ |  j | _ x |  j D] } t | | |  } | j j	 |  s t
  | j j |  | j t j k r | j d  k s t
  n3 | j t j k r | j d  k s t
  | | _ n  | | _ qP W|  j t j j j |  |  | S(   N(   R   RG   RJ  R   RY  RJ   R   RC   RD   RN   t   AssertionErrorR>   R   R   R   R^  R;  RH  R(   R_   R$   R%   R0  R1  (   R	   RE   R6  R   t
   childclone(    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyRF   *  s&    
c         C   s   t    } |  | _ | S(   N(   Ry   RD   (   R	   RW   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyt   createDocumentFragment?  s    		c         C   s   t  |  } |  | _ | S(   N(   R   RD   (   R	   Rr   R8  (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyt   createElementD  s    	c         C   s:   t  | t  s t d  n  t   } | | _ |  | _ | S(   Ns   node contents must be a string(   R   R   R   R   R<   RD   (   R	   R<   t   t(    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyt   createTextNodeI  s    			c         C   s:   t  | t  s t d  n  t   } | | _ |  | _ | S(   Ns   node contents must be a string(   R   R   R   R  R<   RD   (   R	   R<   R5   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyt   createCDATASectionQ  s    			c         C   s   t  |  } |  | _ | S(   N(   R  RD   (   R	   R<   R5   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyt   createCommentY  s    	c         C   s   t  | |  } |  | _ | S(   N(   R   RD   (   R	   R   R<   t   p(    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyt   createProcessingInstruction^  s    	c         C   s"   t  |  } |  | _ d | _ | S(   NR   (   R   RD   R   (   R	   R   t   a(    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyt   createAttributec  s    		c         C   s1   t  |  \ } } t | | |  } |  | _ | S(   N(   R   R   RD   (   R	   Rc   R   Rd   Rh   R8  (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyRG  i  s    	c         C   s=   t  |  \ } } t | | | |  } |  | _ d | _ | S(   NR   (   R   R   RD   R   (   R	   Rc   R   Rd   Rh   Ri  (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyt   createAttributeNSo  s
    		c         C   s"   t  | | | |  } |  | _ | S(   N(   R3  RD   (   R	   Ru   R&  R'  R4  R8  (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyt   _create_entityy  s    	c         C   s   t  | | |  } |  | _ | S(   N(   R2  RD   (   R	   Ru   R&  R'  R   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyt   _create_notation~  s    	c         C   sE  | |  j  k r |  j  | S|  j p) |  j s0 d  S|  j } | d  k r] |  j g } | |  _ n
 | sg d  Sd  } x| r@| j   } | j g  | j D] } | j	 t
 k r | ^ q  |  j |  } | rxa| j j   D] } | j r;| j | j | j  r| |  j  | j <| j | k r(| } q8| j s8Pq8qq | j | j  r| |  j  | j <| j | k ru| } q| j sPqq | j r | |  j  | j <| j | k r| } q| j d k rPqq q WnZ | j r-xN | j j   D]: } | j r| |  j  | j <| j | k r&| } q&qqWn  | d  k	 rp Pqp qp W| S(   Ni   (   RP  RS  R   R   RR  R^  t   popt   extendR   R   R.   R   R}   R   Rc   R   Rh   R   R   R   Ru   R   (   R	   R   t   stackt   resultR6   RB   R   R   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyt   getElementById  s\    					
						c         C   s   t  |  | t    S(   N(   Rs   R`   (   R	   Ru   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyR     s    c         C   s   t  |  | | t    S(   N(   Rw   R`   (   R	   Rc   Rh   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyR     s    c         C   s   |  j  j | |  S(   N(   RG   RH   (   R	   RI   RJ   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyRK     s    c         C   s^   | j  t j k r' t j j d   n' | j  t j k rN t j j d   n  t | | |   S(   Ns   cannot import document nodess!   cannot import document type nodes(   R   R   R   R$   R%   t   NotSupportedErrR;  RC   (   R	   R6   RE   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyt
   importNode  s
    R   c         C   se   | d  k r  | j d |  n | j d | | f  x' |  j D] } | j | | | |  qA Wd  S(   Ns   <?xml version="1.0" ?>s%   <?xml version="1.0" encoding="%s"?>%s(   R   Rp   R   R   (   R	   R   R   R   R   R   R6   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyR     s
    c   	      C   s   | j  |  k	 r1 t j j d |  | j  f   n  | j t j t j f k ra t j j d   n  | t	 k rd | k r | j
 d d  \ } } | d k r| t j j k rt j j d   qq'| d k r| t j j k r| j t j k rt j j d   n  d  } | } n d  } d  } | j t j k rj| j } | d  k	 rp| j } | j |  qpn d  } | j } | | d <| | d	 <| | d
 <| | d <| j t j k r| | d <n< | | d <| d  k	 r| j |  | r| j |  qn  | S(   Ns?   cannot rename nodes from other documents;
expected %s,
found %ss8   renameNode() only applies to element and attribute nodesR   i   R   s   illegal use of 'xmlns' prefixs$   illegal use of the 'xmlns' attributeRd   Rh   Rc   R{   Rr   Ru   (   RD   R$   R%   RD  R   R   R?   R   Rs  R    R   R   R   R   R   R   R   Ri   R   R   (	   R	   R   Rc   Ru   Rd   Rh   R   t   is_idRW   (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyt
   renameNode  sT    								




N(>   Ra   Rb   R   R?   R   R   R;  R#   R   R   R{   R   R|   R}   RH  R(   R2   R1   R@  RG   R5  R   RY  RJ   R   R[  RW  RU  R   Rz   R   R<  RT  RV  R=  RX  RZ  R\  R>  R*   R)   R]  R=   RF   Ra  Rb  Rd  Re  Rf  Rh  Rj  RG  Rk  Rl  Rm  Rr  R   R   RK   Rt  R   Rv  (    (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyRL    sh   	
																									
			:					
R^  s#   Top-level element of this document.c         C   s  |  j  j |  r$ t j j j } n t j j j } |  j t j	 k r | j
 |  j |  j  } xW |  j j   D]F } | j | j | j | j  | j | j | j  } | j | _ qm W| rx3 |  j D]% } t | | |  } | j |  q Wqn|  j t j k rS| j   } | rx3 |  j D]% } t | | |  } | j |  q$Wqn|  j t j k rz| j |  j  } nm|  j t j k r| j |  j  } nF|  j t j k r| j |  j  |  j  } n|  j t j! k r| j" |  j  } n|  j t j# k r7| j$ |  j |  j  } t% | _ |  j | _ n|  j t j& k r|  j  | k	 s^t'  t j j j } | j( j) |  j* |  j+ |  j,  } | | _  | rg  | j- _. g  | j/ _. xp |  j/ j. D]b }	 t0 |	 j |	 j+ |	 j,  }
 | |
 _  | j/ j. j1 |
  t2 |	 d  r|	 j3 | |	 |
  qqWx |  j- j. D] } t4 | j | j+ | j, | j5  } | j6 | _6 | j7 | _7 | j8 | _8 | | _  | j- j. j1 |  t2 | d  r5| j3 | | |  q5q5Wqn t j j9 d t: |     t2 |  d  r|  j3 | |  |  n  | S(   so   
    Clone a node and give it the new owner document.
    Called by Node.cloneNode and Document.importNode
    R_   s   Cannot clone node %s(;   RD   RN   R$   R%   R0  R1  t   NODE_IMPORTEDR   R   R?   RG  Rc   R{   R}   R   R   R   R   Rh   R   R   RC   R*   R    Ra  R;   Rd  R<   R~   Re  R   Rh  R   R   Rf  R   Rk  R   R;  R_  RG   RK  Ru   R&  R'  R,  R"  R-  R2  R>   RY   R_   R3  R4  R5  R   RJ   Rs  R'   (   R6   RE   t   newOwnerDocumentR\   R6  R   Ri  RB   R5   R   R7  R8  R9  (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyRC     s~    					 c         C   s:   |  j  d d  } t |  d k r( | Sd  | d f Sd  S(   NR   i   i   i    (   R   R   R   (   R   t   fields(    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyR   f  s    c          C   s   d d l  m  }  |    S(   Ni(   t   StringIO(   Rz  (   Rz  (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyR   n  s    c         C   s<   |  | |   } | j    \ } } | j |  | j   | S(   N(   t   getEventt
   expandNodeRQ  (   t   funct   argst   kwargst   eventst   toktypet   rootNode(    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyt   _do_pulldom_parses  s
    
c         C   sh   | d k r0 | r0 d d l m } | j |   Sd d l m } t | j |  f i | d 6| d 6 Sd S(   s3   Parse a file into a DOM by filename or file object.i(   t   expatbuilder(   t   pulldomt   parsert   bufsizeN(   R   t   xml.domR  t   parseR  R  (   t   fileR  R  R  R  (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyR  z  s    c         C   sZ   | d k r) d d l m } | j |   Sd d l m } t | j |  f i | d 6 Sd S(   s&   Parse a file into a DOM from a string.i(   R  (   R  R  N(   R   R  R  t   parseStringR  R  (   t   stringR  R  R  (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyR    s    c         C   sa   |  rZ t  |  t  r' t j |   }  n  x0 |  D]% \ } } t j j | |  s. d  Sq. Wn  t j S(   N(   R   R   R   t   _parse_feature_stringRL  RG   RH   R   (   t   featurest   ft   v(    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyt   getDOMImplementation  s    (8   R   R  R$   R    R   R   R   t   xml.dom.minicompatt   xml.dom.xmlbuilderR   R   R%   R   R?   R   R.   t   defpropertyR7   Rk   Rq   Rs   Rw   Ry   R   t   objectR   t   AttributeListR   R   R   R   R   R   R   R  R   R  R   R  R  R!  R%  R+  R3  R2  R@  RM  R/   RL  RC   R   R   R  R  R  R  (    (    (    s%   /usr/lib/python2.7/xml/dom/minidom.pyt   <module>   s   "
	
					r	(GZ			><(	O*	 O	R			

