�`^c@s�dZddlmZmZmZddlmZmZmZddlm Z ddl
mZmZddl
mZddlTejZejZejZejjZejjZejjZejjZej�Zi ejed�d 6ejed
�d6ejed�d
6ejed�d6ejed�d6ejed�d6ejed�d6ejed�d6ejed�d6Zdefd��YZd�Zd�Z dfd��YZ!eeefZ"d efd!��YZ#d"efd#��YZ$d$e$fd%��YZ%d&e$fd'��YZ&d(Z'd)e'Z(d*e!fd+��YZ)d,fd-��YZ*d.e*e!fd/��YZ+d0e*e)fd1��YZ,d2e-fd3��YZ.d4e!fd5��YZ/e0d6�Z1e0d7�Z2e0d8�Z3e0d9�Z4d:�Z5d;S(<s�Facility to use the Expat parser to load a minidom instance
from a string or file.
This avoids all the overhead of SAX and pulldom to gain performance.
i�(t
xmlbuildertminidomtNode(tEMPTY_NAMESPACEtEMPTY_PREFIXtXMLNS_NAMESPACE(texpat(t
_append_childt_set_attribute_node(t
NodeFilter(t*tcdatatCDATAtenumerationtENUMtentitytENTITYtentitiestENTITIEStidtIDtidreftIDREFtidrefstIDREFStnmtokentNMTOKENtnmtokenstNMTOKENStElementInfocBsbeZdZd
d�Zd�Zd�Zd�Zd�Zd�Z d �Z
d
�Zd�ZRS(t
_attr_infot_modelttagNamecCs||_g|_||_dS(N(R RR(tselfR tmodel((s*/sys/lib/python2.7/xml/dom/expatbuilder.pyt__init__As cCs|j|j|jfS(N(RRR (R!((s*/sys/lib/python2.7/xml/dom/expatbuilder.pyt__getstate__FscCs|\|_|_|_dS(N(RRR (R!tstate((s*/sys/lib/python2.7/xml/dom/expatbuilder.pyt__setstate__IscCs\xR|jD]G}|d|kr
|d}|ddkrBtdSt|dSq
q
WtjS(Nii�it(R(Rt
_typeinfo_mapRt_no_type(R!tanametinfott((s*/sys/lib/python2.7/xml/dom/expatbuilder.pytgetAttributeTypeLs
cCstjS(N(RR)(R!tnamespaceURIt localName((s*/sys/lib/python2.7/xml/dom/expatbuilder.pytgetAttributeTypeNSVscCs:|jr2|jd}|tjjtjjfkStSdS(Ni(RRR"t
XML_CTYPE_ANYtXML_CTYPE_MIXEDtFalse(R!ttype((s*/sys/lib/python2.7/xml/dom/expatbuilder.pytisElementContentYs
cCs(|jr |jdtjjkStSdS(Ni(RRR"tXML_CTYPE_EMPTYR3(R!((s*/sys/lib/python2.7/xml/dom/expatbuilder.pytisEmptyas cCs6x/|jD]$}|d|kr
|ddkSq
WtS(Nii�R(RR3(R!R*R+((s*/sys/lib/python2.7/xml/dom/expatbuilder.pytisIdgscCs|j||f�S(N(R8(R!teuritenametauriR*((s*/sys/lib/python2.7/xml/dom/expatbuilder.pytisIdNSms(s
_attr_infos_modelstagNameN(
t__name__t
__module__t __slots__tNoneR#R$R&R-R0R5R7R8R<(((s*/sys/lib/python2.7/xml/dom/expatbuilder.pyR>s
cCs|j||�S(N(t_intern_setdefault(tbuilderts((s*/sys/lib/python2.7/xml/dom/expatbuilder.pyt_internqscCs�d|kst�|jd�}|j}t|�dkr�|\}}}|||�}d||f}|||�}|||�}n%|\}}t}|||�}}|||�|||fS(Nt is%s:%s(tAssertionErrortsplitRAtlenR(RBtnametpartstinternturit localnametprefixtqname((s*/sys/lib/python2.7/xml/dom/expatbuilder.pyt_parse_ns_namets tExpatBuildercBs
eZdZdd�Zd�Zd�Zd�Zd�Zd�Z d�Z
d�Zd �Zd
�Z
d�Zd�Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�ZRS(sPDocument builder that uses Expat to build a ParsedXML.DOM document
instance.cCsw|dkrtj�}n||_|jjdk rNt|jj�|_nd|_t|_d|_ |j
�dS(N(R@RtOptionst_optionstfiltertFilterVisibilityControllert_filterRt_finish_start_elementt_parsertreset(R!toptions((s*/sys/lib/python2.7/xml/dom/expatbuilder.pyR#�s cCs
tj�S(sCreate a new parser object.(RtParserCreate(R!((s*/sys/lib/python2.7/xml/dom/expatbuilder.pytcreateParser�scCsh|jsa|j�|_|jjj|_t|j_t|j_t|j_|j |j�n|jS(s7Return the parser object, creating a new one if needed.(
RXR\RKt
setdefaultRAtTruetbuffer_texttordered_attributestspecified_attributestinstall(R!((s*/sys/lib/python2.7/xml/dom/expatbuilder.pyt getParser�s cCs@tjtdd�|_|j|_|jj|_t|_dS(s6Free all data structures used during DOM construction.N( ttheDOMImplementationtcreateDocumentRR@tdocumenttcurNodet
_elem_infoR3t_cdata(R!((s*/sys/lib/python2.7/xml/dom/expatbuilder.pyRY�s
cCs�|j|_|j|_|j|_|j|_|jj rK|j
|_n|j|_
|jjrr|j|_n|jjr�|j|_|j|_|j|_n|j|_|j|_|j|_|j|_|j|_ dS(s>Install the callbacks needed to build the DOM into the parser.N(!tstart_doctype_decl_handlertStartDoctypeDeclHandlertfirst_element_handlertStartElementHandlertend_element_handlertEndElementHandlert
pi_handlertProcessingInstructionHandlerRSRtentity_decl_handlertEntityDeclHandlertnotation_decl_handlertNotationDeclHandlertcommentstcomment_handlertCommentHandlertcdata_sectionststart_cdata_section_handlertStartCdataSectionHandlertend_cdata_section_handlertEndCdataSectionHandlertcharacter_data_handler_cdatatCharacterDataHandlertcharacter_data_handlertexternal_entity_ref_handlertExternalEntityRefHandlertxml_decl_handlertXmlDeclHandlertelement_decl_handlertElementDeclHandlertattlist_decl_handlertAttlistDeclHandler(R!tparser((s*/sys/lib/python2.7/xml/dom/expatbuilder.pyRb�s$cCs�|j�}t}ykxT|jd�}|s1Pn|j|d�|rc|jjrc|j|�nt}q|jdt�Wntk
r�nX|j}|j �d|_|S(sIParse a document from a file object, returning the document
node.iiiti@N(RcR^treadtParseRftdocumentElementt
_setup_subsetR3tParseEscapeRYR@RX(R!tfileR�tfirst_buffertbuffertdoc((s*/sys/lib/python2.7/xml/dom/expatbuilder.pyt parseFile�s$
cCsa|j�}y!|j|t�|j|�Wntk
r@nX|j}|j�d|_|S(s<Parse a document from a string, returning the document node.N( RcR�R^R�R�RfRYR@RX(R!tstringR�R�((s*/sys/lib/python2.7/xml/dom/expatbuilder.pytparseString�s
cCsD|jjr@t�}|j|�|j�}||jj_ndS(s/Load the internal subset if there might be one.N(RftdoctypetInternalSubsetExtractorR�t getSubsettinternalSubset(R!R�t extractortsubset((s*/sys/lib/python2.7/xml/dom/expatbuilder.pyR��s
cCs�|jjj|||�}|j|_t|j|�||j_|jr�|jj|�tkr�d|j_|jj
d=d}d|j_d|j_
n|r�dk r�g|j_g|j_nd|j_d|j_|j|j_ndS(Ni�(RftimplementationtcreateDocumentTypet
ownerDocumentRR�RVt
acceptNodet
FILTER_REJECTR@t
childNodesRXRsRuRt_seqt notationsRxRqtend_doctype_decl_handlertEndDoctypeDeclHandler(R!tdoctypeNametsystemIdtpublicIdthas_internal_subsetR�((s*/sys/lib/python2.7/xml/dom/expatbuilder.pyRj�s$!
cCsO|jjr|j|j_n|j|j_|jp<|jsKt |_
ndS(N(RSRvRwRXRxRpRqRhRVRt_finish_end_element(R!((s*/sys/lib/python2.7/xml/dom/expatbuilder.pyR�s
cCs]|jj||�}t|j|�|jrY|jj|�tkrY|jj|�ndS(N(RftcreateProcessingInstructionRRgRVR�R�tremoveChild(R!ttargettdatatnode((s*/sys/lib/python2.7/xml/dom/expatbuilder.pyRps!cCs�|jj}|jrd|jrF|djtkrF|dj|�dS|jj|�}t |_n�|r�|djt
kr�|d}|j|}|j}||d<|d<dSt
j�}|j}||d<|d<|j|d<t|j|�dS(Ni�R�t nodeValueR�(RgR�Rit_cdata_continuetnodeTypetCDATA_SECTION_NODEt
appendDataRftcreateCDATASectionR^t TEXT_NODER�t__dict__RtTextR(R!R�R�R�tvaluetd((s*/sys/lib/python2.7/xml/dom/expatbuilder.pyR~s&
cCs�|jj}|rU|djtkrU|d}|j}|j||d<|d<dStj�}|j}|j||d<|d<|j|d<t |j|�dS(Ni�R�R�R�(
RgR�R�R�R�R�RR�RfR(R!R�R�R�R�((s*/sys/lib/python2.7/xml/dom/expatbuilder.pyR�(s
c
Cs�|r
dS|jjsdS|jj||||�}|dk rf|jj|�} |jj| �n|jjjj j|�|j
r�|j
j|�tkr�|jjjj d=ndS(Ni�(
RSRRft_create_entityR@tcreateTextNodeR�tappendR�R�RVR�R�(
R!t
entityNametis_parameter_entityR�tbaseR�R�tnotationNameR�tchild((s*/sys/lib/python2.7/xml/dom/expatbuilder.pyRr5s!cCsl|jj|||�}|jjjjj|�|jrh|jj|�tkrh|jjjjd=ndS(Ni�( Rft_create_notationR�R�R�R�RVR�t
FILTER_ACCEPT(R!R�R�R�R�R�((s*/sys/lib/python2.7/xml/dom/expatbuilder.pyRtGs!cCsZ|jj|�}t|j|�|jrV|jj|�tkrV|jj|�ndS(N(Rft
createCommentRRgRVR�R�R�(R!R�R�((s*/sys/lib/python2.7/xml/dom/expatbuilder.pyRwMs!cCst|_t|_dS(N(R^RiR3R�(R!((s*/sys/lib/python2.7/xml/dom/expatbuilder.pyRzSs cCst|_t|_dS(N(R3RiR�(R!((s*/sys/lib/python2.7/xml/dom/expatbuilder.pyR|Ws cCsdS(Ni((R!tcontextR�R�R�((s*/sys/lib/python2.7/xml/dom/expatbuilder.pyR�[scCsK|jdkr%|jr%t|_n|j|j�_|j||�dS(N(RVR@RhRR�tstart_element_handlerRcRm(R!RIt
attributes((s*/sys/lib/python2.7/xml/dom/expatbuilder.pyRl^scCs�|jj|�}t|j|�||_|r�x�tdt|�d�D]�}tj||tdt
�}||d}|jdj}||d<|d<|j}||d<|d<|j|d<t
||�qJWn||jjk r�j|�ndS(NiiiR�R�R�R�(Rft
createElementRRgtrangeRHRtAttrRR@RR�R�RR�RW(R!RIR�R�titaR�R�((s*/sys/lib/python2.7/xml/dom/expatbuilder.pyR�ds
cCs�|jr�||jjkrdS|jj|�}|tkrJt|�n|tkrct|�ndS|j|_ |jj
|�|j�ndS(N(RVRfR�tstartContainerR�tRejectertFILTER_SKIPtSkippert
parentNodeRgR�tunlink(R!R�tfilt((s*/sys/lib/python2.7/xml/dom/expatbuilder.pyRWxs
cCs&|j}|j|_|j|�dS(N(RgR�R�(R!RIRg((s*/sys/lib/python2.7/xml/dom/expatbuilder.pyRn�s cCs�|jj|j�}|r.|j||�n|jr�||jjkrMdS|jj|�tkr�|j j
|�|j�q�ndS(N(RhtgetR t_handle_white_text_nodesRVRfR�R�R�RgR�R�(R!RgR+((s*/sys/lib/python2.7/xml/dom/expatbuilder.pyR��s cCs�|jjs|j�rdSg}x@|jD]5}|jtkr-|jj�r-|j|�q-q-Wx|D]}|j |�qmWdS(N(
RStwhitespace_in_element_contentR5R�R�R�R�tstripR�R�(R!R�R+tLR�((s*/sys/lib/python2.7/xml/dom/expatbuilder.pyR��s
cCsY|jj|�}|dkr7t||�|j|<n|jdksLt�||_dS(N(RhR�R@RRRF(R!RIR"R+((s*/sys/lib/python2.7/xml/dom/expatbuilder.pyR��s
c Csf|jj|�}|dkr:t|�}||j|<n|jjd|dd|d||g�dS(Ni(RhR�R@RRR�(R!telemRIR4tdefaulttrequiredR+((s*/sys/lib/python2.7/xml/dom/expatbuilder.pyR��s cCsL||j_||j_|dkrH|r9t|j_qHt|j_ndS(Ni(RftversiontencodingR^t
standaloneR3(R!R�R�R�((s*/sys/lib/python2.7/xml/dom/expatbuilder.pyR��sN( R=R>t__doc__R@R#R\RcRYRbR�R�R�RjR�RpR~R�RrRtRwRzR|R�RlR�RWRnR�R�R�R�R�(((s*/sys/lib/python2.7/xml/dom/expatbuilder.pyRQ�s:
RUcBs�eZdZdZd�Zd�Zd�Zieje j
6eje j6ej
e j6eje j6eje j6eje j6eje j6eje j6eje j6eje j6eje j6eje j 6Z!RS(soWrapper around a DOMBuilderFilter which implements the checks
to make the whatToShow filter attribute work.RTcCs
||_dS(N(RT(R!RT((s*/sys/lib/python2.7/xml/dom/expatbuilder.pyR#�scCsu|j|j}|jj|@rm|jj|�}|tkrGt�n|tkritdt |��n|St
SdS(Ns)startContainer() returned illegal value: (t_nodetype_maskR�RTt
whatToShowR�tFILTER_INTERRUPTR�t_ALLOWED_FILTER_RETURNSt
ValueErrortreprR�(R!R�tmasktval((s*/sys/lib/python2.7/xml/dom/expatbuilder.pyR��s cCs�|j|j}|jj|@r�|jj|�}|tkrGt�n|tkr�|j}x|j D]}|j
|�qgWtS|tkr�t
dt|��n|StSdS(Ns%acceptNode() returned illegal value: (R�R�RTR�R�R�R�R�R�R�tappendChildR�R�R�R�R�(R!R�R�R�tparentR�((s*/sys/lib/python2.7/xml/dom/expatbuilder.pyR��s (sfilter("R=R>R�R?R#R�R�R tSHOW_ELEMENTRtELEMENT_NODEtSHOW_ATTRIBUTEtATTRIBUTE_NODEt SHOW_TEXTR�tSHOW_CDATA_SECTIONR�tSHOW_ENTITY_REFERENCEtENTITY_REFERENCE_NODEtSHOW_ENTITYtENTITY_NODEtSHOW_PROCESSING_INSTRUCTIONtPROCESSING_INSTRUCTION_NODEtSHOW_COMMENTtCOMMENT_NODEt
SHOW_DOCUMENTt
DOCUMENT_NODEtSHOW_DOCUMENT_TYPEtDOCUMENT_TYPE_NODEtSHOW_DOCUMENT_FRAGMENTtDOCUMENT_FRAGMENT_NODEt
SHOW_NOTATIONt
NOTATION_NODER�(((s*/sys/lib/python2.7/xml/dom/expatbuilder.pyRU�s$
tFilterCrutchcBseZdZd�ZRS(t_buildert_levelt
_old_startt_old_endcCsOd|_||_|j}|j|_|j|_|j|_|j|_dS(Ni( RRRXRmRRoRR�Rn(R!RBR�((s*/sys/lib/python2.7/xml/dom/expatbuilder.pyR#s (s_builders_levels
_old_starts_old_end(R=R>R?R#(((s*/sys/lib/python2.7/xml/dom/expatbuilder.pyR sR�cBs)eZdZd�Zd�Zd�ZRS(cCs>tj||�|j}xdD]}t||d�q WdS(NRqRxRR{R}R�(sProcessingInstructionHandlersCommentHandlersCharacterDataHandlersStartCdataSectionHandlersEndCdataSectionHandlersExternalEntityRefHandler(RR#RXtsetattrR@(R!RBR�RI((s*/sys/lib/python2.7/xml/dom/expatbuilder.pyR#s
cGs|jd|_dS(Ni(R(R!targs((s*/sys/lib/python2.7/xml/dom/expatbuilder.pyR�$scGsZ|jdkrF|jj}|jj|�|j|_|j|_n|jd|_dS(Nii(RRRXRbRRmRRo(R!RR�((s*/sys/lib/python2.7/xml/dom/expatbuilder.pyRn's((R=R>R?R#R�Rn(((s*/sys/lib/python2.7/xml/dom/expatbuilder.pyR�s R�cBs eZdZd�Zd�ZRS(cGsB|jj}|j|�|jj|k r>|jd|_ndS(Ni(RRgRR(R!RR�((s*/sys/lib/python2.7/xml/dom/expatbuilder.pyR�4s
cGs`|jdkr?|j|jj_|j|jj_d|_n|jd|_|j|�dS(Nii(RRRRXRmRRoR@(R!R((s*/sys/lib/python2.7/xml/dom/expatbuilder.pyRn:s((R=R>R?R�Rn(((s*/sys/lib/python2.7/xml/dom/expatbuilder.pyR�1s s8http://xml.python.org/entities/fragment-builder/internals�<!DOCTYPE wrapper
%%s [
<!ENTITY fragment-builder-internal
SYSTEM "%s">
%%s
]>
<wrapper %%s
>&fragment-builder-internal;</wrapper>tFragmentBuildercBsPeZdZdd�Zd�Zd�Zd�Zd�Zd�Z d�Z
RS( s�Builder which constructs document fragments given XML source
text and a context node.
The context node is expected to provide information about the
namespace declarations which are in scope at the start of the
fragment.
cCsM|jtkr$||_||_n|j|_||_tj||�dS(N(R�R�toriginalDocumentR�R�RQR#(R!R�RZ((s*/sys/lib/python2.7/xml/dom/expatbuilder.pyR#bs cCstj|�d|_dS(N(RQRYR@tfragment(R!((s*/sys/lib/python2.7/xml/dom/expatbuilder.pyRYks
cCs|j|j��S(sRParse a document fragment from a file object, returning the
fragment node.(R�R�(R!R�((s*/sys/lib/python2.7/xml/dom/expatbuilder.pyR�osc Cs�||_|j�}|jj}d}|r�|jp?|j�}|jrdd|j|jf}q�|jr�d|j}q�nd}|j�}t |||f}y|j
|d�Wn|j��nX|j}|j�|S(sMParse a document fragment from a string, returning the
fragment node.R�sPUBLIC "%s" "%s"sSYSTEM "%s"i(
t_sourceRcR
R�R�t_getDeclarationsR�R�t_getNSattrst_FRAGMENT_BUILDER_TEMPLATER�RYR( R!R�R�R�tidentR�tnsattrsRfR((s*/sys/lib/python2.7/xml/dom/expatbuilder.pyR�ts,
cCs�|jjj}d}|r�x�t|jj�D]v}|jj|�}|rY|d}nd||jf}|jr�d||j|j f}q.d||j f}q.Wx�t|j
j�D]�}|j
j|�}|r�d}nd||jf}|jrd||j|j f}n5|j r=d||j f}nd ||jjf}|j
rrd
||j
f}n|d}q�Wn|S(s�Re-create the internal subset from the DocumentType node.
This is only needed if we don't already have the
internalSubset as a string.
R�s
s%s<!NOTATION %ss!%s PUBLIC "%s"
"%s">s%s SYSTEM "%s">s
%s<!ENTITY %ss %s PUBLIC "%s"
"%s"s%s SYSTEM "%s"s%s "%s"s%s NOTATION %st>(R�R�R�R�R�tlengthtitemtnodeNameR�R�Rt
firstChildR�R�(R!R�RCR�tnotationR((s*/sys/lib/python2.7/xml/dom/expatbuilder.pyR
�s6
cCsdS(NR�((R!((s*/sys/lib/python2.7/xml/dom/expatbuilder.pyR�scCs�|tkr�|j}|j}|jj|�}|j|_|jj�|_|j|_z|j|j d�Wd||_||_d|_ XdStj|||||�SdS(Nii�(
t$_FRAGMENT_BUILDER_INTERNAL_SYSTEM_IDRfRgRXtExternalEntityParserCreateR
tcreateDocumentFragmentRR�RR@RQR�(R!R�R�R�R�told_documenttold_cur_nodeR�((s*/sys/lib/python2.7/xml/dom/expatbuilder.pyR��s
N(R=R>R�R@R#RYR�R�R
RR�(((s*/sys/lib/python2.7/xml/dom/expatbuilder.pyR Ys $ t
NamespacescBsDeZdZd�Zd�Zd�Zd�Zd�Zd�ZRS(s7Mix-in class for builders; adds support for namespaces.cCs
g|_dS(N(t_ns_ordered_prefixes(R!((s*/sys/lib/python2.7/xml/dom/expatbuilder.pyt_initNamespaces�scCstjdd�}t|_|S(s'Create a new namespace-handling parser.tnamespace_separatorRE(RR[R^tnamespace_prefixes(R!R�((s*/sys/lib/python2.7/xml/dom/expatbuilder.pyR\�s cCs/tj||�|jjr+|j|_ndS(s.Insert the namespace-handlers onto the parser.N(RQRbRStnamespace_declarationststart_namespace_decl_handlertStartNamespaceDeclHandler(R!R�((s*/sys/lib/python2.7/xml/dom/expatbuilder.pyRb�scCs|jj||f�dS(s/Push this namespace declaration on our storage.N(RR�(R!RNRL((s*/sys/lib/python2.7/xml/dom/expatbuilder.pyR#�scCs�d|kr*t||�\}}}}nt}|}d}t}tj||||�}|j|_t|j |�||_ |j
rIx�|j
D]�\}}|r�tjt|d|�t
|d�}ntjdt
dt�}|jdj} || d<| d<|j} || d<| d<|j| d<t||�q�W|j
2n|r�|j}
|j}xtdt|�d �D]}||}
||d
}d|
kr�||
�\}}}}tj||||�}||
|<||||f<n2tj|
t|
t�}||
|
<||t|
f<|jdj} || d<| d<|j} |j| d<|| d<| d<|| d<qzWndS(NREsxmlns:txmlnsiR�R�R�R�iitownerElement(RPRR@RRtElementRfR�RRgRR�RDRR�R�Rt_attrst_attrsNSR�RH(R!RIR�RLRMRNROR�R�R�R(R)R�R*R�((s*/sys/lib/python2.7/xml/dom/expatbuilder.pyR��sZ
cCs�|j}d|krlt||�\}}}}|j|kr]|j|kr]|j|ks�td��n6|j|ks�td��|jtks�td��|j|_|j |�dS(NREs$element stack messed up! (namespace)s&element stack messed up - bad nodeNames*element stack messed up - bad namespaceURI(
RgRPR.R/RNRFRRR�R�(R!RIRgRLRMRNRO((s*/sys/lib/python2.7/xml/dom/expatbuilder.pyRn!s ( R=R>R�RR\RbR#R�Rn(((s*/sys/lib/python2.7/xml/dom/expatbuilder.pyR�s :tExpatBuilderNScBseZdZd�ZRS(s*Document builder that supports namespaces.cCstj|�|j�dS(N(RQRYR(R!((s*/sys/lib/python2.7/xml/dom/expatbuilder.pyRY5s
(R=R>R�RY(((s*/sys/lib/python2.7/xml/dom/expatbuilder.pyR*2stFragmentBuilderNScBs eZdZd�Zd�ZRS(s*Fragment builder that supports namespaces.cCstj|�|j�dS(N(R RYR(R!((s*/sys/lib/python2.7/xml/dom/expatbuilder.pyRY=s
cCs�d}|j}g}x�|r�t|d�r�x�|jj�D]p\}}||kr[q=n|j|�|r{d|}nd}|r�d|||f}q=d||f}q=Wn|j}qW|S(sNReturn string of namespace attributes from this element and
ancestors.R�t_ns_prefix_urisxmlns:R%s%s
%s='%s's %s='%s'(R�thasattrR,titemsR�R�(R!tattrsR�R�RNRLtdeclname((s*/sys/lib/python2.7/xml/dom/expatbuilder.pyRAs"
(R=R>R�RYR(((s*/sys/lib/python2.7/xml/dom/expatbuilder.pyR+:s R�cBseZdZRS(sEException raised to short-circuit parsing in InternalSubsetExtractor.(R=R>R�(((s*/sys/lib/python2.7/xml/dom/expatbuilder.pyR�_sR�cBsSeZdZdZd�Zd�Zd�Zd�Zd�Z d�Z
d�ZRS( sBXML processor which can rip out the internal document type subset.cCs|jS(s'Return the internal subset as a string.(R�(R!((s*/sys/lib/python2.7/xml/dom/expatbuilder.pyR�hscCs,ytj||�Wntk
r'nXdS(N(RQR�R�(R!R�((s*/sys/lib/python2.7/xml/dom/expatbuilder.pyR�ls
cCs,ytj||�Wntk
r'nXdS(N(RQR�R�(R!R�((s*/sys/lib/python2.7/xml/dom/expatbuilder.pyR�rs
cCs|j|_|j|_dS(N(RjRkR�Rm(R!R�((s*/sys/lib/python2.7/xml/dom/expatbuilder.pyRbxscCsF|r9|j�}g|_|jj|_|j|_n t��dS(N(RcR�R�tDefaultHandlerR�R�R�(R!RIR�R�R�R�((s*/sys/lib/python2.7/xml/dom/expatbuilder.pyRj|s cCs@dj|j�jdd�jdd�}||_t��dS(NR�s
s
s
(tjoinR�treplaceR�(R!RC((s*/sys/lib/python2.7/xml/dom/expatbuilder.pyR��s* cCs
t��dS(N(R�(R!RIR/((s*/sys/lib/python2.7/xml/dom/expatbuilder.pyR��sN(R=R>R�R@R�R�R�R�RbRjR�R�(((s*/sys/lib/python2.7/xml/dom/expatbuilder.pyR�cs
cCsp|rt�}n t�}t|t�r]t|d�}z|j|�}Wd|j�Xn|j|�}|S(s{Parse a document, returning the resulting Document node.
'file' may be either a file name or an open file object.
trbN(R*RQt
isinstancetStringTypestopenR�tclose(R�t
namespacesRBtfptresult((s*/sys/lib/python2.7/xml/dom/expatbuilder.pytparse�s cCs(|rt�}n t�}|j|�S(sOParse a document from a string, returning the resulting
Document node.
(R*RQR�(R�R9RB((s*/sys/lib/python2.7/xml/dom/expatbuilder.pyR��s cCsv|rt|�}nt|�}t|t�rct|d�}z|j|�}Wd|j�Xn|j|�}|S(s�Parse a fragment of a document, given the context from which it
was originally extracted. context should be the parent of the
node(s) which are in the fragment.
'file' may be either a file name or an open file object.
R4N(R+R R5R6R7R�R8(R�R�R9RBR:R;((s*/sys/lib/python2.7/xml/dom/expatbuilder.pyt
parseFragment�scCs.|rt|�}nt|�}|j|�S(s�Parse a fragment of a document from a string, given the context
from which it was originally extracted. context should be the
parent of the node(s) which are in the fragment.
(R+R R�(R�R�R9RB((s*/sys/lib/python2.7/xml/dom/expatbuilder.pytparseFragmentString�scCs!|jrt|�St|�SdS(s,Create a builder based on an Options object.N(R9R*RQ(RZ((s*/sys/lib/python2.7/xml/dom/expatbuilder.pytmakeBuilder�s
N(6R�txml.domRRRRRRtxml.parsersRtxml.dom.minidomRRtxml.dom.NodeFilterR txml.dom.minicompatR�R�R�tDOMBuilderFilterR�R�R�R�tgetDOMImplementationRdtTypeInfoR@R(tobjectRRDRPRQR�RURR�R�RRR RR*R+t ExceptionR�R�R^R<R�R=R>R?(((s*/sys/lib/python2.7/xml/dom/expatbuilder.pyt<module>s`
3 �:ud%,
|