• File: ElementInclude.pyc
  • Full Path: /home3/farmfre2/public_html/ALFA_DATA/alfasymlink/root/opt/alt/python27/lib64/python2.7/site-packages/lxml/ElementInclude.pyc
  • Date Modified: 07/17/2016 11:11 AM
  • File size: 4.43 KB
  • MIME-type: text/x-bytecode.python
  • Charset: 8 bit

]Nc@s"dZddlmZddlZy$ddlmZddlmZWn1ek
ryddl	mZddl
mZnXyeWn!ek
rddl
mZnXdZedZed	Zd
ejfdYZddZddd
ZdZdddZddddZdS(s
Limited XInclude support for the ElementTree package.

While lxml.etree has full support for XInclude (see
`etree.ElementTree.xinclude()`), this module provides a simpler, pure
Python, ElementTree compatible implementation that supports a simple
form of custom URL resolvers.
i(tetreeN(turljoin(turlopen(tSets!{http://www.w3.org/2001/XInclude}tincludetfallbacktFatalIncludeErrorcBseZRS((t__name__t
__module__(((sF/opt/alt/python27/lib64/python2.7/site-packages/lxml/ElementInclude.pyRMscCskt|d}|dkr3tj|j}n*|j}|sNd}n|j|}|j|S(Ntrbtxmlsutf-8(topenRtparsetgetroottreadtdecodetclose(threfRtencodingtfiletdata((sF/opt/alt/python27/lib64/python2.7/site-packages/lxml/ElementInclude.pytdefault_loader]s	
cCs|dkr'tj||j}n^d|krBt|}nt|d}|j}|j|svd}n|j|}|S(NR
s://R	sutf-8(RRR
RRRRR(RRRtparserRtf((sF/opt/alt/python27/lib64/python2.7/site-packages/lxml/ElementInclude.pyt_lxml_default_loaderms
	csddfd}|S(Ncs|||S(N((RRRR(tloader(sF/opt/alt/python27/lib64/python2.7/site-packages/lxml/ElementInclude.pytloads(tNone(RR((RsF/opt/alt/python27/lib64/python2.7/site-packages/lxml/ElementInclude.pyt_wrap_et_loaderscCs|dkr]t|dr0|}|j}n|j}t|dr{|jj}q{nt|dr{|j}nt||d|dS(NR
tdocinfotbase_url(RthasattrR
tgetroottreeRtURLt_include(telemRRttree((sF/opt/alt/python27/lib64/python2.7/site-packages/lxml/ElementInclude.pyRscCs|dk	rt|}nt}|dkr9t}n|jj}t|jd}xW|D]O}|jt	krQt
||jd}|jdd}	|j}
|	dkr{||krt
d|n|j||||	d|}|dkr!t
d||	fnt|||}|jrX|jpHd|j|_n|
dkrh|S|
j||q|	d	kr>|||	d
|jd
}|dkrt
d||	fn|j}
|
dk	r|
jpd||
_n3|
dkr|S|
jpd||jp'd|
_|
j|qt
d|	qd|jtkr|j}
|
dk	r|
jt	krt
d|jqqdt
d
|jqdW|S(Ns"{http://www.w3.org/2001/XInclude}*RRR
s recursive include of %r detectedRscannot load %r as %rtttextRs)unknown parse type in xi:include tag (%r)s0xi:fallback tag must be child of xi:include (%r)s0Invalid element found in XInclude namespace (%r)(RRRtsetR RtlisttiterttagtXINCLUDE_INCLUDERtgett	getparentRtaddR"ttailtreplacetgetpreviousR&tremovetXINCLUDE_FALLBACK(R#Rt
_parent_hrefsRtload_includeRtinclude_elementsteRRtparenttnodeR&tpredecessor((sF/opt/alt/python27/lib64/python2.7/site-packages/lxml/ElementInclude.pyR"sd

	#(t__doc__tlxmlRtcopyturlparseRturllib2RtImportErrorturllib.parseturllib.requestR't	NameErrortsetsRtXINCLUDER+R3tLxmlSyntaxErrorRRRRRRR"(((sF/opt/alt/python27/lib64/python2.7/site-packages/lxml/ElementInclude.pyt<module>3s*