Xjc@sdZddlZddlmZmZmZmZddlTddlm Z m Z ej j j ej j jfZdej j fdYZ ee dd d ee d d d ee d d ddZdZdZdZde fdYZde fdYZeedd deed d deedd ddefdYZeedd deZd efd!YZeeeZd"e fd#YZeed$d d%eed d d&d'Zd(fd)YZd*ee fd+YZ d,ee fd-YZ!ee!dd d.d/e!fd0YZ"ee"d1d d2ee"d3d d4d5Z#d6Z$d7ee!fd8YZ%d9e"fd:YZ&d;efd<YZ'ee'dd d=d>fd?YZ(d@e(ee fdAYZ)dBe(e fdCYZ*dDe(ee fdEYZ+dFe fdGYZ,dHefdIYZ-dJZ.dKe e fdLYZ/ee/dMd dNdOZ0dPZ1dQZ2dRZ3eedSZ4edTZ5edUZ6dS(VscSimple implementation of the Level 1 DOM. Namespaces and other minor Level 2 features are also supported. parse("foo.xml") parseString("") 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(tEMPTY_NAMESPACEt EMPTY_PREFIXtXMLNS_NAMESPACEtdomreg(t*(tDOMImplementationLSt DocumentLStNodecBseZdZdZdZdZdZeZ dZ ddZ ddddZ dZ dZdZdZd Zd Zd Zd Zd ZdZdZdZdZdZdZdZdZdZRS(cCstS(N(tTrue(tself((s'/usr/lib64/python2.7/xml/dom/minidom.pyt __nonzero__*scCs|jdd|S(Nt(t toprettyxml(R tencoding((s'/usr/lib64/python2.7/xml/dom/minidom.pyttoxml-ss s cCst}|dk r=ddl}|j|d|}n|jtjkrk|j|d|||n|j|d|||jS(NiiR ( t _get_StringIOtNonetcodecstlookuptnodeTypeRt DOCUMENT_NODEtwritexmltgetvalue(R tindenttnewlR twriterR((s'/usr/lib64/python2.7/xml/dom/minidom.pyR 0s   cCs|jr tStSdS(N(t childNodesRtFalse(R ((s'/usr/lib64/python2.7/xml/dom/minidom.pyt hasChildNodes?s cCs|jS(N(R(R ((s'/usr/lib64/python2.7/xml/dom/minidom.pyt_get_childNodesEscCs|jr|jdSdS(Ni(R(R ((s'/usr/lib64/python2.7/xml/dom/minidom.pyt_get_firstChildHs cCs|jr|jdSdS(Ni(R(R ((s'/usr/lib64/python2.7/xml/dom/minidom.pyt_get_lastChildLs cCsw|j|jkr@x't|jD]}|j||q"W|S|j|jkr}tjjdt |t |fn|j dk r|j j |n|dkr|j |ny|jj|}Wn tk rtjjnX|jtkrt|n|jj||||_||_|ra|j|d}||_||_n d|_||_ |S(Ns%s cannot be child of %si(RtDOCUMENT_FRAGMENT_NODEttupleRt insertBeforet_child_node_typestxmltdomtHierarchyRequestErrtreprt parentNodeRt removeChildt appendChildtindext ValueErrort NotFoundErrt_nodeTypes_with_childrent_clear_id_cachetinsertt nextSiblingtpreviousSibling(R tnewChildtrefChildtcR+tnode((s'/usr/lib64/python2.7/xml/dom/minidom.pyR"Ps6 "         cCs|j|jkr=x$t|jD]}|j|q"W|S|j|jkrztjjdt |t |fn|jt krt |n|j dk r|j j|nt||d|_|S(Ns%s cannot be child of %s(RR R!RR*R#R$R%R&R'R.R/R(RR)t _append_childR1(R R6R5((s'/usr/lib64/python2.7/xml/dom/minidom.pyR*ps "   cCs|j|jkr8|j}|j||j||S|j|jkrutjjdt |t |fn||krdS|j dk r|j j|ny|j j |}Wn tk rtjjnX||j |<||_ d|_ |jtks|jtkr*t|n|j|_|j|_d|_d|_|jrl||j_n|jr||j_n|S(Ns%s cannot be child of %s(RR R1R)R"R#R$R%R&R'R(RRR+R,R-R.R/R2(R R3toldChildR4R+((s'/usr/lib64/python2.7/xml/dom/minidom.pyt replaceChilds<   "            cCsy|jj|Wn tk r6tjjnX|jdk rX|j|j_n|jdk ry|j|j_nd|_|_|j t krt |nd|_ |S(N( RtremoveR,R$R%R-R1RR2RR.R/R((R R8((s'/usr/lib64/python2.7/xml/dom/minidom.pyR)s   cCs*g}x|jD]}|jtjkr|jsr|rJ|j|d_n|jre|j|j_n|jq|r|dj|jkr|d}|j|j|_|j|_|jr||j_n|jq|j|q|j||jtj kr|j qqW||j(dS(Ni( RRRt TEXT_NODEtdataR1R2tunlinktappendt ELEMENT_NODEt normalize(R tLtchildR6((s'/usr/lib64/python2.7/xml/dom/minidom.pyR@s*        cCst|||jp|S(N(t _clone_nodet ownerDocument(R tdeep((s'/usr/lib64/python2.7/xml/dom/minidom.pyt cloneNodescCs|jjj||S(N(RDtimplementationt hasFeature(R tfeaturetversion((s'/usr/lib64/python2.7/xml/dom/minidom.pyt isSupportedscCsdS(N(R(R ((s'/usr/lib64/python2.7/xml/dom/minidom.pyt_get_localNamescCs ||kS(N((R tother((s'/usr/lib64/python2.7/xml/dom/minidom.pyt isSameNodescCs|j|dr|SdSdS(N(RKR(R RI((s'/usr/lib64/python2.7/xml/dom/minidom.pyt getInterfacescCs2y|j|dSWnttfk r-dSXdS(Ni(t _user_datatAttributeErrortKeyErrorR(R tkey((s'/usr/lib64/python2.7/xml/dom/minidom.pyt getUserDatascCsd}y |j}Wn tk r5i}||_nX||krS||d}n|dkr~d}|dk r||=qn||f||<|S(Ni(RRPRQ(R RSR<thandlertoldtd((s'/usr/lib64/python2.7/xml/dom/minidom.pyt setUserDatas       cCsdt|dr`xN|jjD]:\}\}}|dk r|j|||||qqWndS(NRP(thasattrRPtitemsRthandle(R t operationtsrctdstRSR<RU((s'/usr/lib64/python2.7/xml/dom/minidom.pyt_call_user_data_handlers" cCs\d|_|_|jrFx|jD]}|jq#Wt|_nd|_d|_dS(N(RR(RDRR=tNodeListR2R1(R RB((s'/usr/lib64/python2.7/xml/dom/minidom.pyR=s  N(t__name__t __module__Rt namespaceURIR(RDR1R2RtprefixR RR RRRRR"R*R9R)R@RFRKRLRNRORTRXR_R=(((s'/usr/lib64/python2.7/xml/dom/minidom.pyR!s6                t firstChildtdocsFirst child node, or None.t lastChildsLast child node, or None.t localNames"Namespace-local name of this node.cCsT|j}|r6|d}||jd<||jd(R R6Rtlast((s'/usr/lib64/python2.7/xml/dom/minidom.pyR7s    cCsP|rL|jddjddjddjdd}|j|nd S( sWrites datachars to writer.t&s&ts>N(treplacetwrite(RR<((s'/usr/lib64/python2.7/xml/dom/minidom.pyt _write_datascCsex^|jD]S}|jtjkrM|dks=|j|krM|j|nt|||q W|S(NR(RRRR?ttagNameR>t_get_elements_by_tagName_helper(tparenttnametrcR6((s'/usr/lib64/python2.7/xml/dom/minidom.pyRr%s c Csx|jD]t}|jtjkr |dks=|j|krh|dksX|j|krh|j|nt||||q q W|S(NR(RRRR?RhRcR>t"_get_elements_by_tagName_ns_helper(RstnsURIRhRuR6((s'/usr/lib64/python2.7/xml/dom/minidom.pyRv-stDocumentFragmentcBsbeZejZdZdZdZdZ ej ej ej ej ejejejfZdZRS(s#document-fragmentcCst|_dS(N(R`R(R ((s'/usr/lib64/python2.7/xml/dom/minidom.pyt__init__DsN(RaRbRR RtnodeNameRt nodeValuet attributesR(R?R;tCDATA_SECTION_NODEtENTITY_REFERENCE_NODEtPROCESSING_INSTRUCTION_NODEt COMMENT_NODEt NOTATION_NODER#Ry(((s'/usr/lib64/python2.7/xml/dom/minidom.pyRx6s  tAttrcBseZejZd Zd ZeZ eZ ej ej fZ ed d dZdZdZdZdZdZdZdZdZd ZRS( cCs]|j}d|d<||d<|d<||d<||dtText(R tqNameRcRhRdRW((s'/usr/lib64/python2.7/xml/dom/minidom.pyRyQs     cCs|jjdddS(Nt:ii(Rztsplit(R ((s'/usr/lib64/python2.7/xml/dom/minidom.pyRL`scCs|jS(N(Rt(R ((s'/usr/lib64/python2.7/xml/dom/minidom.pyt _get_namecscCs|jS(N(t specified(R ((s'/usr/lib64/python2.7/xml/dom/minidom.pyt_get_specifiedfscCs|j}|dkrk||d<|d<|jdj}||d<|d<|jdk rt|jqnJ|dkr||d<|d<|jdk rt|jqn |||RzR(R RAR6((s'/usr/lib64/python2.7/xml/dom/minidom.pyRZscCsFg}x9|jjD](}|j|j|jf|jfqW|S(N(RRR>RcRhR(R RAR6((s'/usr/lib64/python2.7/xml/dom/minidom.pytitemsNSs&cCs-t|tr||jkS||jkSdS(N(t isinstancet StringTypesRR(R RS((s'/usr/lib64/python2.7/xml/dom/minidom.pythas_keys cCs |jjS(N(RR(R ((s'/usr/lib64/python2.7/xml/dom/minidom.pyRscCs |jjS(N(RR(R ((s'/usr/lib64/python2.7/xml/dom/minidom.pytkeysNSscCs |jjS(N(RR(R ((s'/usr/lib64/python2.7/xml/dom/minidom.pyRscCs|jj||S(N(Rtget(R RtR((s'/usr/lib64/python2.7/xml/dom/minidom.pyRscCs<|jt|ddkrdStt|t|SdS(NRi(RtgetattrRtcmptid(R RM((s'/usr/lib64/python2.7/xml/dom/minidom.pyt__cmp__scCs)t|tr|j|S|j|SdS(N(RR!RR(R tattname_or_tuple((s'/usr/lib64/python2.7/xml/dom/minidom.pyt __getitem__s cCst|trhy|j|}Wn9tk r[t|}|jj|_|j|nX||_n.t|tst dn|}|j|dS(Ns%value must be a string or Attr object( RRRRRRRRDt setNamedItemRt TypeError(R tattnameRR6((s'/usr/lib64/python2.7/xml/dom/minidom.pyt __setitem__ s    cCs(y|j|SWntk r#dSXdS(N(RRRR(R Rt((s'/usr/lib64/python2.7/xml/dom/minidom.pyt getNamedItems cCs.y|j||fSWntk r)dSXdS(N(RRRR(R RcRh((s'/usr/lib64/python2.7/xml/dom/minidom.pytgetNamedItemNSs cCs|j|}|dk rnt|j|j|j=|j|j|jf=d|j krjd|j ds (RRt(R ((s'/usr/lib64/python2.7/xml/dom/minidom.pyt__repr__es cCs|jS(N(Rt(R ((s'/usr/lib64/python2.7/xml/dom/minidom.pyRkscCs|jS(N(R(R ((s'/usr/lib64/python2.7/xml/dom/minidom.pyt_get_namespacens(s namespacesname(RaRbRRyRRR(((s'/usr/lib64/python2.7/xml/dom/minidom.pyR^s    tElementcBsLeZejZdZeZdZ ejej ej ej ej ejfZedddZdZdZdZdZdZdZdZd Zd Zd ZeZd Zd ZdZeZ dZ!dZ"dZ#dZ$dZ%ddddZ&dZ'dZ(dZ)dZ*dZ+RS(icCsMd|_||_|_||_||_t|_i|_i|_ dS(N( RRDRqRzRdRcR`RRR(R RqRcRdRh((s'/usr/lib64/python2.7/xml/dom/minidom.pyRys     cCs|jjdddS(NRii(RqR(R ((s'/usr/lib64/python2.7/xml/dom/minidom.pyRLscCs|jS(N(Rq(R ((s'/usr/lib64/python2.7/xml/dom/minidom.pyt _get_tagNamescCsGx!|jjD]}|jqWd|_d|_tj|dS(N(RRR=RRR(R tattr((s'/usr/lib64/python2.7/xml/dom/minidom.pyR=s   cCs+y|j|jSWntk r&dSXdS(NR (RRRR(R R((s'/usr/lib64/python2.7/xml/dom/minidom.pyt getAttributes cCs1y|j||fjSWntk r,dSXdS(NR (RRRR(R RcRh((s'/usr/lib64/python2.7/xml/dom/minidom.pytgetAttributeNSs cCs|j|}|dkr_t|}|j}||d<|d<|j|d<|j|nC||jkr|j}||d<|d<|jrt|qndS(NRR{RD( tgetAttributeNodeRRRiRDtsetAttributeNodeRRR/(R RRRRW((s'/usr/lib64/python2.7/xml/dom/minidom.pyt setAttributes      cCst|\}}|j||}|dkrt||||}|j}||d<||d<||d<|d<|j|d<|j|ni|j}||jkr||d<|d<|jrt |qn|j |kr||d<||d(RqR(R ((s'/usr/lib64/python2.7/xml/dom/minidom.pyRsR c Cs[|j|d|j|j}|j}|jx@|D]8}|jd|t|||j|jdqAW|jrF|jdt|jdkr|jdj t j kr|jdj |dddnH|j|x+|jD] }|j |||||qW|j||jd|j|fn|jd |dS( NRls %s="s"RmiiR s%ss/>%s( RoRqt_get_attributesRtsortRpRRRRRR;R( R RRt addindentRRta_namesta_nameR6((s'/usr/lib64/python2.7/xml/dom/minidom.pyRs&         cCst|j|j|S(N(RRR(R ((s'/usr/lib64/python2.7/xml/dom/minidom.pyR2scCs|jr tStSdS(N(RRR(R ((s'/usr/lib64/python2.7/xml/dom/minidom.pyt hasAttributes5s cCs |j|}|j|dS(N(RtsetIdAttributeNode(R RttidAttr((s'/usr/lib64/python2.7/xml/dom/minidom.pytsetIdAttribute=scCs#|j||}|j|dS(N(RR(R RcRhR((s'/usr/lib64/python2.7/xml/dom/minidom.pytsetIdAttributeNSAscCs|dks|j|j r1tjjnt|dk rUtjjn|jst |j d<|j d7_ |j j d7_ t|ndS(NRi(RRNRR$R%R-t_get_containing_entreftNoModificationAllowedErrRRRiRRDRR/(R R((s'/usr/lib64/python2.7/xml/dom/minidom.pyREs  N(,RaRbRR?RRR{RRRRRR;R}R~R#RRyRLRR=RRRRRRRtsetAttributeNodeNSRRRtremoveAttributeNodeNSRRRRRRRRRRR(((s'/usr/lib64/python2.7/xml/dom/minidom.pyRssL                         R|s*NamedNodeMap of attributes on the element.s%Namespace-local name of this element.cCsDt|||j|j<||j|j|jf<||jd%s(RoRR<(R RRRR((s'/usr/lib64/python2.7/xml/dom/minidom.pyRs( RaRbRRRRyRRRRRR(((s'/usr/lib64/python2.7/xml/dom/minidom.pyRs       t CharacterDatacBsteZdZeZdZdZeZeZdZdZ dZ dZ dZ dZ d ZRS( cCs t|jS(N(RR<(R ((s'/usr/lib64/python2.7/xml/dom/minidom.pyRscCs |jdS(NR<(Ri(R ((s'/usr/lib64/python2.7/xml/dom/minidom.pyRscCs|j}||d<|di(R<Rt __class__Ra(R R<t dotdotdot((s'/usr/lib64/python2.7/xml/dom/minidom.pyRs   cCs~|dkr!tjjdn|t|jkrKtjjdn|dkrltjjdn|j|||!S(Nisoffset cannot be negatives#offset cannot be beyond end of datascount cannot be negative(R$R%t IndexSizeErrRR<(R toffsettcount((s'/usr/lib64/python2.7/xml/dom/minidom.pyt substringDatas  cCs|j||_dS(N(R<(R targ((s'/usr/lib64/python2.7/xml/dom/minidom.pyt appendDatascCs||dkr!tjjdn|t|jkrKtjjdn|rxd|j| ||j|f|_ndS(Nisoffset cannot be negatives#offset cannot be beyond end of datas%s%s%s(R$R%RRR<(R RR ((s'/usr/lib64/python2.7/xml/dom/minidom.pyt insertDatas cCs|dkr!tjjdn|t|jkrKtjjdn|dkrltjjdn|r|j| |j|||_ndS(Nisoffset cannot be negatives#offset cannot be beyond end of datascount cannot be negative(R$R%RRR<(R RR((s'/usr/lib64/python2.7/xml/dom/minidom.pyt deleteDatas  cCs|dkr!tjjdn|t|jkrKtjjdn|dkrltjjdn|rd|j| ||j||f|_ndS(Nisoffset cannot be negatives#offset cannot be beyond end of datascount cannot be negatives%s%s%s(R$R%RRR<(R RRR ((s'/usr/lib64/python2.7/xml/dom/minidom.pyt replaceDatas  (RaRbRRRRt_get_nodeValuet_set_nodeValueRRRR R R R (((s'/usr/lib64/python2.7/xml/dom/minidom.pyRs      sLength of the string data.RcBsSeZejZdZdZdZddddZ dZ dZ dZ RS(s#textcCs|dks!|t|jkr6tjjdn|j}|j||_|j|_|j}|jr||jj kr|dkr|jj |q|jj ||n|j| |_|S(Nisillegal offset value( RR<R$R%RRRDR1R(RRR*R"(R RtnewTexttnext((s'/usr/lib64/python2.7/xml/dom/minidom.pyt splitTexts!    R cCs!t|d||j|fdS(Ns%s%s%s(RpR<(R RRRR((s'/usr/lib64/python2.7/xml/dom/minidom.pyR scCs|jg}|j}xK|dk rb|jtjtjfkr^|jd|j|j}qPqW|j}xH|dk r|jtjtjfkr|j |j|j}qoPqoWdj |S(NiR ( R<R2RRRR;R}R0R1R>tjoin(R RAR((s'/usr/lib64/python2.7/xml/dom/minidom.pyt_get_wholeTexts     cCs|j}|j}xK|dk r_|jtjtjfkr[|j}|j||}qPqW|j}|s|j|nxK|dk r|jtjtjfkr|j}|j||}qPqW|r|j }||d<||d<|SdSdS(NR<R{( R(R2RRRR;R}R)R1Ri(R tcontentRsRRRW((s'/usr/lib64/python2.7/xml/dom/minidom.pytreplaceWholeText"s.            cCs_|jjrtSt|}|dkr/tS|jj|}|dkrQtS|jSdS(N(R<tstripRt_get_containing_elementRRDRtisElementContent(R RR((s'/usr/lib64/python2.7/xml/dom/minidom.pyt!_get_isWhitespaceInElementContent@s   N( RaRbRR;RRzRR|RRRRR(((s'/usr/lib64/python2.7/xml/dom/minidom.pyRs    tisWhitespaceInElementContentsKTrue iff this text node contains only whitespace and is in element content.t wholeTexts.The text of all logically-adjacent text nodes.cCs?|j}x/|dk r:|jtjkr.|S|j}q WdS(N(R(RRRR?(R6R5((s'/usr/lib64/python2.7/xml/dom/minidom.pyRSs   cCs?|j}x/|dk r:|jtjkr.|S|j}q WdS(N(R(RRRR~(R6R5((s'/usr/lib64/python2.7/xml/dom/minidom.pyR[s   tCommentcBs2eZejZdZdZddddZRS(s#commentcCs||_|_dS(N(R<R{(R R<((s'/usr/lib64/python2.7/xml/dom/minidom.pyRyhsR cCs?d|jkrtdn|jd||j|fdS(Ns--s%'--' is not allowed in a comment nodes %s%s(R<R,Ro(R RRRR((s'/usr/lib64/python2.7/xml/dom/minidom.pyRks(RaRbRRRRzRyR(((s'/usr/lib64/python2.7/xml/dom/minidom.pyRds  t CDATASectioncBs)eZejZdZddddZRS(s#cdata-sectionR cCs?|jjddkr'tdn|jd|jdS(Ns]]>is$']]>' not allowed in a CDATA sections(R<tfindR,Ro(R RRRR((s'/usr/lib64/python2.7/xml/dom/minidom.pyRzs(RaRbRR}RRzR(((s'/usr/lib64/python2.7/xml/dom/minidom.pyRqs tReadOnlySequentialNamedNodeMapcBseZdZddZdZdZdZdZdZdZ dZ d Z d Z d Z d Zd ZRS(t_seqcCs ||_dS(N(R!(R tseq((s'/usr/lib64/python2.7/xml/dom/minidom.pyRyscCs t|jS(N(RR!(R ((s'/usr/lib64/python2.7/xml/dom/minidom.pyRscCs t|jS(N(RR!(R ((s'/usr/lib64/python2.7/xml/dom/minidom.pyRscCs+x$|jD]}|j|kr |Sq WdS(N(R!Rz(R RtR((s'/usr/lib64/python2.7/xml/dom/minidom.pyRscCs:x3|jD](}|j|kr |j|kr |Sq WdS(N(R!RcRh(R RcRhR((s'/usr/lib64/python2.7/xml/dom/minidom.pyRscCsLt|tr!|j|}n|j|}|dkrHt|n|S(N(RR!RRRRR(R t name_or_tupleR6((s'/usr/lib64/python2.7/xml/dom/minidom.pyRs   cCs8|dkrdSy|j|SWntk r3dSXdS(Ni(RR!R(R R+((s'/usr/lib64/python2.7/xml/dom/minidom.pyRs   cCstjjddS(Ns"NamedNodeMap instance is read-only(R$R%R(R Rt((s'/usr/lib64/python2.7/xml/dom/minidom.pyRs cCstjjddS(Ns"NamedNodeMap instance is read-only(R$R%R(R RcRh((s'/usr/lib64/python2.7/xml/dom/minidom.pyRs cCstjjddS(Ns"NamedNodeMap instance is read-only(R$R%R(R R6((s'/usr/lib64/python2.7/xml/dom/minidom.pyRs cCstjjddS(Ns"NamedNodeMap instance is read-only(R$R%R(R R6((s'/usr/lib64/python2.7/xml/dom/minidom.pyRs cCs |jgS(N(R!(R ((s'/usr/lib64/python2.7/xml/dom/minidom.pyRscCs|d|_dS(Ni(R!(R R((s'/usr/lib64/python2.7/xml/dom/minidom.pyRs(s_seq((RaRbRRyRRRRRRRRRRRR(((s'/usr/lib64/python2.7/xml/dom/minidom.pyR s           s&Number of entries in the NamedNodeMap.t IdentifiedcBs)eZdZdZdZdZRS(s@Mix-in class that supports the publicId and systemId attributes.cCs||_||_dS(N(tpublicIdtsystemId(R R%R&((s'/usr/lib64/python2.7/xml/dom/minidom.pyt_identified_mixin_inits cCs|jS(N(R%(R ((s'/usr/lib64/python2.7/xml/dom/minidom.pyt _get_publicIdscCs|jS(N(R&(R ((s'/usr/lib64/python2.7/xml/dom/minidom.pyt _get_systemIds(RaRbRR'R(R)(((s'/usr/lib64/python2.7/xml/dom/minidom.pyR$s  t DocumentTypecBs\eZejZdZdZdZdZ dZ dZ dZ dZ ddddZRS(cCsLt|_t|_|r<t|\}}||_n|j|_dS(N(R tentitiest notationsRRtRz(R RRdR((s'/usr/lib64/python2.7/xml/dom/minidom.pyRys    cCs|jS(N(tinternalSubset(R ((s'/usr/lib64/python2.7/xml/dom/minidom.pyt_get_internalSubsetscCs\|jdkrTtd}|j|_|j|_tjjj}|r=g|j _ g|j _ xU|j j D]G}t |j|j |j}|j j j||j|||qmWx|j j D]q}t|j|j |j|j}|j|_|j|_|j|_|j j j||j|||qWn|j||||SdSdS(N(RDRR*RtRzR$R%tUserDataHandlert NODE_CLONEDR+R!R,tNotationR%R&R>R_tEntityt notationNametactualEncodingR RJ(R REtcloneR\Rtnotationtetentity((s'/usr/lib64/python2.7/xml/dom/minidom.pyRFs.         R cCs|jd|j|j|jrL|jd||j||jfn&|jrr|jd||jfn|jdk r|jd|j|j|jdn|jd|dS(Ns RRRR:RGR(R_R$R%R/R0(R RER5Rt childclone((s'/usr/lib64/python2.7/xml/dom/minidom.pyRF(s"      cCst}||_|S(N(RxRD(R RW((s'/usr/lib64/python2.7/xml/dom/minidom.pytcreateDocumentFragment=s  cCst|}||_|S(N(RRD(R RqR7((s'/usr/lib64/python2.7/xml/dom/minidom.pyt createElementBs  cCs:t|tstdnt}||_||_|S(Nsnode contents must be a string(RRRRR<RD(R R<tt((s'/usr/lib64/python2.7/xml/dom/minidom.pytcreateTextNodeGs     cCs:t|tstdnt}||_||_|S(Nsnode contents must be a string(RRRRR<RD(R R<R5((s'/usr/lib64/python2.7/xml/dom/minidom.pytcreateCDATASectionOs     cCst|}||_|S(N(RRD(R R<R5((s'/usr/lib64/python2.7/xml/dom/minidom.pyt createCommentWs  cCst||}||_|S(N(RRD(R RR<tp((s'/usr/lib64/python2.7/xml/dom/minidom.pytcreateProcessingInstruction\s cCs"t|}||_d|_|S(NR (RRDR(R Rta((s'/usr/lib64/python2.7/xml/dom/minidom.pytcreateAttributeas   cCs1t|\}}t|||}||_|S(N(RRRD(R RcRRdRhR7((s'/usr/lib64/python2.7/xml/dom/minidom.pyRFgs cCs=t|\}}t||||}||_d|_|S(NR (RRRDR(R RcRRdRhRg((s'/usr/lib64/python2.7/xml/dom/minidom.pytcreateAttributeNSms   cCs"t||||}||_|S(N(R2RD(R RtR%R&R3R7((s'/usr/lib64/python2.7/xml/dom/minidom.pyt_create_entityws cCst|||}||_|S(N(R1RD(R RtR%R&R((s'/usr/lib64/python2.7/xml/dom/minidom.pyt_create_notation|s cCsE||jkr|j|S|jp)|js0dS|j}|dkr]|jg}||_n |sgdSd}x|r@|j}|jg|jD]}|j t kr|^q|j |}|rxa|j j D]}|jr;|j|j|jr||j|j<|j|kr(|}q8|js8Pq8qq|j|jr||j|j<|j|kru|}q|jsPqq|jr||j|j<|j|kr|}q|jdkrPqqqWnZ|jr-xN|j j D]:}|jr||j|j<|j|kr&|}q&qqWn|dk rpPqpqpW|S(Ni(RORRRRRQR]tpoptextendRRR.RR|RRcRRhRRRRtR(R RtstacktresultR6RBRR((s'/usr/lib64/python2.7/xml/dom/minidom.pytgetElementByIds\                  cCst||tS(N(RrR`(R Rt((s'/usr/lib64/python2.7/xml/dom/minidom.pyRscCst|||tS(N(RvR`(R RcRh((s'/usr/lib64/python2.7/xml/dom/minidom.pyRscCs|jj||S(N(RGRH(R RIRJ((s'/usr/lib64/python2.7/xml/dom/minidom.pyRKscCs^|jtjkr'tjjdn'|jtjkrNtjjdnt|||S(Nscannot import document nodess!cannot import document type nodes(RRRR$R%tNotSupportedErrR:RC(R R6RE((s'/usr/lib64/python2.7/xml/dom/minidom.pyt importNodes R cCse|dkr |jd|n|jd||fx'|jD]}|j||||qAWdS(Nss%%s(RRoRR(R RRRRR R6((s'/usr/lib64/python2.7/xml/dom/minidom.pyRs  c Cs|j|k r1tjjd||jfn|jtjtjfkratjjdn|t krd|kr|j dd\}}|dkr|tjj krtjj dqq'|dkr |tjj kr |jtjkr tjj dnd}|}n d}d}|jtjkrj|j}|dk rp|j}|j|qpnd}|j}||d<||d <||d <||d <|jtjkr||d RaRbRR?RRR:R#RRRzRR{R|RGR(R2R1R?RGR4R RXRJRRZRVRTRRyRR;RSRUR<RWRYR[R=R*R)R\R=RFR_R`RbRcRdRfRhRFRiRjRkRpRRRKRrRRt(((s'/usr/lib64/python2.7/xml/dom/minidom.pyRKsh                             :      R]s#Top-level element of this document.c Cs|jj|r$tjjj}ntjjj}|jtj kr|j |j |j }xW|j jD]F}|j|j |j |j|j|j |j}|j|_qmW|rx3|jD]%}t|||}|j|qWqn|jtjkrS|j}|rx3|jD]%}t|||}|j|q$Wqn|jtjkrz|j|j}nX|jtjkr|j|j}n1|jtjkr|j|j |j}n|jtj!kr|j"|j}n|jtj#kr7|j$|j |j }t%|_|j|_n|jtj&krtjjj}|j'j(|j)|j*|j+}||_|rg|j,_-g|j._-xp|j.j-D]b} t/| j | j*| j+} || _|j.j-j0| t1| dr| j2|| | qqWx|j,j-D]} t3| j | j*| j+| j4} | j5| _5| j6| _6| j7| _7|| _|j,j-j0| t1| dr | j2|| | q q Wqntjj8dt9|t1|dr|j2|||n|S(so Clone a node and give it the new owner document. Called by Node.cloneNode and Document.importNode R_sCannot clone node %s(:RDRNR$R%R/R0t NODE_IMPORTEDRRR?RFRcRzR|RRRRRhRRRCR*R R_R;RbR<R}RcRRfRRRdRRiRR:RGRJRtR%R&R+R!R,R1R>RYR_R2R3R4R RJRqR'( R6REtnewOwnerDocumentR\R5RRgRBR5RR6R7R8((s'/usr/lib64/python2.7/xml/dom/minidom.pyRCs|                  cCs:|jdd}t|dkr(|Sd|dfSdS(NRiii(RRR(Rtfields((s'/usr/lib64/python2.7/xml/dom/minidom.pyRdscCsddlm}|S(Ni(tStringIO(Rx(Rx((s'/usr/lib64/python2.7/xml/dom/minidom.pyRlscCs<|||}|j\}}|j||j|S(N(tgetEventt expandNodeRP(tfunctargstkwargsteventsttoktypetrootNode((s'/usr/lib64/python2.7/xml/dom/minidom.pyt_do_pulldom_parseqs   cCsh|dkr0| r0ddlm}|j|Sddlm}t|j|fi|d6|d6SdS(s3Parse a file into a DOM by filename or file object.i(t expatbuilder(tpulldomtparsertbufsizeN(Rtxml.domRtparseRR(tfileRRRR((s'/usr/lib64/python2.7/xml/dom/minidom.pyRxs  cCsZ|dkr)ddlm}|j|Sddlm}t|j|fi|d6SdS(s&Parse a file into a DOM from a string.i(R(RRN(RRRt parseStringRR(tstringRRR((s'/usr/lib64/python2.7/xml/dom/minidom.pyRs   cCsa|rZt|tr'tj|}nx0|D]%\}}tjj||s.dSq.WntjS(N(RRRt_parse_feature_stringRKRGRHR(tfeaturestftv((s'/usr/lib64/python2.7/xml/dom/minidom.pytgetDOMImplementations (7RRR$RRRRtxml.dom.minicompattxml.dom.xmlbuilderRRR%RR?R~R.t defpropertyR7RpRrRvRxRtobjectRt AttributeListRRRRRRRRRRRRRR R$R*R2R1R?RLR/RKRCRRRRRR(((s'/usr/lib64/python2.7/xml/dom/minidom.pyts "     v    (GZ     > <( O* O  R