Imported Upstream version 2.3.5
[platform/upstream/python-lxml.git] / doc / html / api / lxml.ElementInclude-pysrc.html
1 <?xml version="1.0" encoding="ascii"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
3           "DTD/xhtml1-transitional.dtd">
4 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5 <head>
6   <title>lxml.ElementInclude</title>
7   <link rel="stylesheet" href="epydoc.css" type="text/css" />
8   <script type="text/javascript" src="epydoc.js"></script>
9 </head>
10
11 <body bgcolor="white" text="black" link="blue" vlink="#204080"
12       alink="#204080">
13 <!-- ==================== NAVIGATION BAR ==================== -->
14 <table class="navbar" border="0" width="100%" cellpadding="0"
15        bgcolor="#a0c0ff" cellspacing="0">
16   <tr valign="middle">
17   <!-- Home link -->
18       <th>&nbsp;&nbsp;&nbsp;<a
19         href="lxml-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>
20
21   <!-- Tree link -->
22       <th>&nbsp;&nbsp;&nbsp;<a
23         href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
24
25   <!-- Index link -->
26       <th>&nbsp;&nbsp;&nbsp;<a
27         href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>
28
29   <!-- Help link -->
30       <th>&nbsp;&nbsp;&nbsp;<a
31         href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
32
33   <!-- Project homepage -->
34       <th class="navbar" align="right" width="100%">
35         <table border="0" cellpadding="0" cellspacing="0">
36           <tr><th class="navbar" align="center"
37             ><a class="navbar" target="_top" href="/">lxml API</a></th>
38           </tr></table></th>
39   </tr>
40 </table>
41 <table width="100%" cellpadding="0" cellspacing="0">
42   <tr valign="top">
43     <td width="100%">
44       <span class="breadcrumbs">
45         <a href="lxml-module.html">Package&nbsp;lxml</a> ::
46         Module&nbsp;ElementInclude
47       </span>
48     </td>
49     <td>
50       <table cellpadding="0" cellspacing="0">
51         <!-- hide/show private -->
52         <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
53     onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
54         <tr><td align="right"><span class="options"
55             >[<a href="frames.html" target="_top">frames</a
56             >]&nbsp;|&nbsp;<a href="lxml.ElementInclude-pysrc.html"
57             target="_top">no&nbsp;frames</a>]</span></td></tr>
58       </table>
59     </td>
60   </tr>
61 </table>
62 <h1 class="epydoc">Source Code for <a href="lxml.ElementInclude-module.html">Module lxml.ElementInclude</a></h1>
63 <pre class="py-src">
64 <a name="L1"></a><tt class="py-lineno">  1</tt>  <tt class="py-line"><tt class="py-comment">#</tt> </tt>
65 <a name="L2"></a><tt class="py-lineno">  2</tt>  <tt class="py-line"><tt class="py-comment"># ElementTree</tt> </tt>
66 <a name="L3"></a><tt class="py-lineno">  3</tt>  <tt class="py-line"><tt class="py-comment"># $Id: ElementInclude.py 1862 2004-06-18 07:31:02Z Fredrik $</tt> </tt>
67 <a name="L4"></a><tt class="py-lineno">  4</tt>  <tt class="py-line"><tt class="py-comment">#</tt> </tt>
68 <a name="L5"></a><tt class="py-lineno">  5</tt>  <tt class="py-line"><tt class="py-comment"># limited xinclude support for element trees</tt> </tt>
69 <a name="L6"></a><tt class="py-lineno">  6</tt>  <tt class="py-line"><tt class="py-comment">#</tt> </tt>
70 <a name="L7"></a><tt class="py-lineno">  7</tt>  <tt class="py-line"><tt class="py-comment"># history:</tt> </tt>
71 <a name="L8"></a><tt class="py-lineno">  8</tt>  <tt class="py-line"><tt class="py-comment"># 2003-08-15 fl   created</tt> </tt>
72 <a name="L9"></a><tt class="py-lineno">  9</tt>  <tt class="py-line"><tt class="py-comment"># 2003-11-14 fl   fixed default loader</tt> </tt>
73 <a name="L10"></a><tt class="py-lineno"> 10</tt>  <tt class="py-line"><tt class="py-comment">#</tt> </tt>
74 <a name="L11"></a><tt class="py-lineno"> 11</tt>  <tt class="py-line"><tt class="py-comment"># Copyright (c) 2003-2004 by Fredrik Lundh.  All rights reserved.</tt> </tt>
75 <a name="L12"></a><tt class="py-lineno"> 12</tt>  <tt class="py-line"><tt class="py-comment">#</tt> </tt>
76 <a name="L13"></a><tt class="py-lineno"> 13</tt>  <tt class="py-line"><tt class="py-comment"># fredrik@pythonware.com</tt> </tt>
77 <a name="L14"></a><tt class="py-lineno"> 14</tt>  <tt class="py-line"><tt class="py-comment"># http://www.pythonware.com</tt> </tt>
78 <a name="L15"></a><tt class="py-lineno"> 15</tt>  <tt class="py-line"><tt class="py-comment">#</tt> </tt>
79 <a name="L16"></a><tt class="py-lineno"> 16</tt>  <tt class="py-line"><tt class="py-comment"># --------------------------------------------------------------------</tt> </tt>
80 <a name="L17"></a><tt class="py-lineno"> 17</tt>  <tt class="py-line"><tt class="py-comment"># The ElementTree toolkit is</tt> </tt>
81 <a name="L18"></a><tt class="py-lineno"> 18</tt>  <tt class="py-line"><tt class="py-comment">#</tt> </tt>
82 <a name="L19"></a><tt class="py-lineno"> 19</tt>  <tt class="py-line"><tt class="py-comment"># Copyright (c) 1999-2004 by Fredrik Lundh</tt> </tt>
83 <a name="L20"></a><tt class="py-lineno"> 20</tt>  <tt class="py-line"><tt class="py-comment">#</tt> </tt>
84 <a name="L21"></a><tt class="py-lineno"> 21</tt>  <tt class="py-line"><tt class="py-comment"># By obtaining, using, and/or copying this software and/or its</tt> </tt>
85 <a name="L22"></a><tt class="py-lineno"> 22</tt>  <tt class="py-line"><tt class="py-comment"># associated documentation, you agree that you have read, understood,</tt> </tt>
86 <a name="L23"></a><tt class="py-lineno"> 23</tt>  <tt class="py-line"><tt class="py-comment"># and will comply with the following terms and conditions:</tt> </tt>
87 <a name="L24"></a><tt class="py-lineno"> 24</tt>  <tt class="py-line"><tt class="py-comment">#</tt> </tt>
88 <a name="L25"></a><tt class="py-lineno"> 25</tt>  <tt class="py-line"><tt class="py-comment"># Permission to use, copy, modify, and distribute this software and</tt> </tt>
89 <a name="L26"></a><tt class="py-lineno"> 26</tt>  <tt class="py-line"><tt class="py-comment"># its associated documentation for any purpose and without fee is</tt> </tt>
90 <a name="L27"></a><tt class="py-lineno"> 27</tt>  <tt class="py-line"><tt class="py-comment"># hereby granted, provided that the above copyright notice appears in</tt> </tt>
91 <a name="L28"></a><tt class="py-lineno"> 28</tt>  <tt class="py-line"><tt class="py-comment"># all copies, and that both that copyright notice and this permission</tt> </tt>
92 <a name="L29"></a><tt class="py-lineno"> 29</tt>  <tt class="py-line"><tt class="py-comment"># notice appear in supporting documentation, and that the name of</tt> </tt>
93 <a name="L30"></a><tt class="py-lineno"> 30</tt>  <tt class="py-line"><tt class="py-comment"># Secret Labs AB or the author not be used in advertising or publicity</tt> </tt>
94 <a name="L31"></a><tt class="py-lineno"> 31</tt>  <tt class="py-line"><tt class="py-comment"># pertaining to distribution of the software without specific, written</tt> </tt>
95 <a name="L32"></a><tt class="py-lineno"> 32</tt>  <tt class="py-line"><tt class="py-comment"># prior permission.</tt> </tt>
96 <a name="L33"></a><tt class="py-lineno"> 33</tt>  <tt class="py-line"><tt class="py-comment">#</tt> </tt>
97 <a name="L34"></a><tt class="py-lineno"> 34</tt>  <tt class="py-line"><tt class="py-comment"># SECRET LABS AB AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD</tt> </tt>
98 <a name="L35"></a><tt class="py-lineno"> 35</tt>  <tt class="py-line"><tt class="py-comment"># TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT-</tt> </tt>
99 <a name="L36"></a><tt class="py-lineno"> 36</tt>  <tt class="py-line"><tt class="py-comment"># ABILITY AND FITNESS.  IN NO EVENT SHALL SECRET LABS AB OR THE AUTHOR</tt> </tt>
100 <a name="L37"></a><tt class="py-lineno"> 37</tt>  <tt class="py-line"><tt class="py-comment"># BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY</tt> </tt>
101 <a name="L38"></a><tt class="py-lineno"> 38</tt>  <tt class="py-line"><tt class="py-comment"># DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,</tt> </tt>
102 <a name="L39"></a><tt class="py-lineno"> 39</tt>  <tt class="py-line"><tt class="py-comment"># WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS</tt> </tt>
103 <a name="L40"></a><tt class="py-lineno"> 40</tt>  <tt class="py-line"><tt class="py-comment"># ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE</tt> </tt>
104 <a name="L41"></a><tt class="py-lineno"> 41</tt>  <tt class="py-line"><tt class="py-comment"># OF THIS SOFTWARE.</tt> </tt>
105 <a name="L42"></a><tt class="py-lineno"> 42</tt>  <tt class="py-line"><tt class="py-comment"># --------------------------------------------------------------------</tt> </tt>
106 <a name="L43"></a><tt class="py-lineno"> 43</tt>  <tt class="py-line"> </tt>
107 <a name="L44"></a><tt class="py-lineno"> 44</tt>  <tt class="py-line"><tt class="py-docstring">"""</tt> </tt>
108 <a name="L45"></a><tt class="py-lineno"> 45</tt>  <tt class="py-line"><tt class="py-docstring">Limited XInclude support for the ElementTree package.</tt> </tt>
109 <a name="L46"></a><tt class="py-lineno"> 46</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
110 <a name="L47"></a><tt class="py-lineno"> 47</tt>  <tt class="py-line"><tt class="py-docstring">While lxml.etree has full support for XInclude (see</tt> </tt>
111 <a name="L48"></a><tt class="py-lineno"> 48</tt>  <tt class="py-line"><tt class="py-docstring">`etree.ElementTree.xinclude()`), this module provides a simpler, pure</tt> </tt>
112 <a name="L49"></a><tt class="py-lineno"> 49</tt>  <tt class="py-line"><tt class="py-docstring">Python, ElementTree compatible implementation that supports a simple</tt> </tt>
113 <a name="L50"></a><tt class="py-lineno"> 50</tt>  <tt class="py-line"><tt class="py-docstring">form of custom URL resolvers.</tt> </tt>
114 <a name="L51"></a><tt class="py-lineno"> 51</tt>  <tt class="py-line"><tt class="py-docstring">"""</tt> </tt>
115 <a name="L52"></a><tt class="py-lineno"> 52</tt>  <tt class="py-line"> </tt>
116 <a name="L53"></a><tt class="py-lineno"> 53</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt id="link-0" class="py-name" targets="Package lxml=lxml-module.html"><a title="lxml" class="py-name" href="#" onclick="return doclink('link-0', 'lxml', 'link-0');">lxml</a></tt> <tt class="py-keyword">import</tt> <tt id="link-1" class="py-name" targets="Module lxml.etree=lxml.etree-module.html,Variable lxml.sax.ElementTreeContentHandler.etree=lxml.sax.ElementTreeContentHandler-class.html#etree,Variable lxml.tests.test_elementtree.CElementTreeTestCase.etree=lxml.tests.test_elementtree.CElementTreeTestCase-class.html#etree,Variable lxml.tests.test_elementtree.ETreeTestCaseBase.etree=lxml.tests.test_elementtree.ETreeTestCaseBase-class.html#etree,Variable lxml.tests.test_io.IOTestCaseBase.etree=lxml.tests.test_io.IOTestCaseBase-class.html#etree"><a title="lxml.etree
117 lxml.sax.ElementTreeContentHandler.etree
118 lxml.tests.test_elementtree.CElementTreeTestCase.etree
119 lxml.tests.test_elementtree.ETreeTestCaseBase.etree
120 lxml.tests.test_io.IOTestCaseBase.etree" class="py-name" href="#" onclick="return doclink('link-1', 'etree', 'link-1');">etree</a></tt> </tt>
121 <a name="L54"></a><tt class="py-lineno"> 54</tt>  <tt class="py-line"><tt class="py-keyword">import</tt> <tt id="link-2" class="py-name" targets="Method lxml.etree.PyErrorLog.copy()=lxml.etree.PyErrorLog-class.html#copy,Method lxml.etree._BaseErrorLog.copy()=lxml.etree._BaseErrorLog-class.html#copy,Method lxml.etree._BaseParser.copy()=lxml.etree._BaseParser-class.html#copy,Method lxml.etree._ErrorLog.copy()=lxml.etree._ErrorLog-class.html#copy,Method lxml.etree._IDDict.copy()=lxml.etree._IDDict-class.html#copy,Method lxml.etree._ListErrorLog.copy()=lxml.etree._ListErrorLog-class.html#copy,Method lxml.etree._ResolverRegistry.copy()=lxml.etree._ResolverRegistry-class.html#copy,Method lxml.etree.iterparse.copy()=lxml.etree.iterparse-class.html#copy"><a title="lxml.etree.PyErrorLog.copy
122 lxml.etree._BaseErrorLog.copy
123 lxml.etree._BaseParser.copy
124 lxml.etree._ErrorLog.copy
125 lxml.etree._IDDict.copy
126 lxml.etree._ListErrorLog.copy
127 lxml.etree._ResolverRegistry.copy
128 lxml.etree.iterparse.copy" class="py-name" href="#" onclick="return doclink('link-2', 'copy', 'link-2');">copy</a></tt> </tt>
129 <a name="L55"></a><tt class="py-lineno"> 55</tt>  <tt class="py-line"><tt class="py-keyword">try</tt><tt class="py-op">:</tt> </tt>
130 <a name="L56"></a><tt class="py-lineno"> 56</tt>  <tt class="py-line">    <tt class="py-keyword">from</tt> <tt class="py-name">urlparse</tt> <tt class="py-keyword">import</tt> <tt class="py-name">urljoin</tt> </tt>
131 <a name="L57"></a><tt class="py-lineno"> 57</tt>  <tt class="py-line">    <tt class="py-keyword">from</tt> <tt class="py-name">urllib2</tt> <tt class="py-keyword">import</tt> <tt class="py-name">urlopen</tt> </tt>
132 <a name="L58"></a><tt class="py-lineno"> 58</tt>  <tt class="py-line"><tt class="py-keyword">except</tt> <tt class="py-name">ImportError</tt><tt class="py-op">:</tt> </tt>
133 <a name="L59"></a><tt class="py-lineno"> 59</tt>  <tt class="py-line">    <tt class="py-comment"># Python 3</tt> </tt>
134 <a name="L60"></a><tt class="py-lineno"> 60</tt>  <tt class="py-line">    <tt class="py-keyword">from</tt> <tt class="py-name">urllib</tt><tt class="py-op">.</tt><tt id="link-3" class="py-name" targets="Function lxml.cssselect.parse()=lxml.cssselect-module.html#parse,Method lxml.etree._ElementTree.parse()=lxml.etree._ElementTree-class.html#parse,Function lxml.etree.parse()=lxml.etree-module.html#parse,Function lxml.html.ElementSoup.parse()=lxml.html.ElementSoup-module.html#parse,Function lxml.html.html5parser.parse()=lxml.html.html5parser-module.html#parse,Function lxml.html.parse()=lxml.html-module.html#parse,Function lxml.html.soupparser.parse()=lxml.html.soupparser-module.html#parse,Function lxml.objectify.parse()=lxml.objectify-module.html#parse,Method lxml.tests.common_imports.HelperTestCase.parse()=lxml.tests.common_imports.HelperTestCase-class.html#parse"><a title="lxml.cssselect.parse
135 lxml.etree._ElementTree.parse
136 lxml.etree.parse
137 lxml.html.ElementSoup.parse
138 lxml.html.html5parser.parse
139 lxml.html.parse
140 lxml.html.soupparser.parse
141 lxml.objectify.parse
142 lxml.tests.common_imports.HelperTestCase.parse" class="py-name" href="#" onclick="return doclink('link-3', 'parse', 'link-3');">parse</a></tt> <tt class="py-keyword">import</tt> <tt class="py-name">urljoin</tt> </tt>
143 <a name="L61"></a><tt class="py-lineno"> 61</tt>  <tt class="py-line">    <tt class="py-keyword">from</tt> <tt class="py-name">urllib</tt><tt class="py-op">.</tt><tt class="py-name">request</tt> <tt class="py-keyword">import</tt> <tt class="py-name">urlopen</tt> </tt>
144 <a name="L62"></a><tt class="py-lineno"> 62</tt>  <tt class="py-line"> </tt>
145 <a name="L63"></a><tt class="py-lineno"> 63</tt>  <tt class="py-line"><tt class="py-keyword">try</tt><tt class="py-op">:</tt> </tt>
146 <a name="L64"></a><tt class="py-lineno"> 64</tt>  <tt class="py-line">    <tt id="link-4" class="py-name" targets="Method lxml.etree._Element.set()=lxml.etree._Element-class.html#set,Method lxml.etree._XSLTProcessingInstruction.set()=lxml.etree._XSLTProcessingInstruction-class.html#set,Method lxml.etree.__ContentOnlyElement.set()=lxml.etree.__ContentOnlyElement-class.html#set"><a title="lxml.etree._Element.set
147 lxml.etree._XSLTProcessingInstruction.set
148 lxml.etree.__ContentOnlyElement.set" class="py-name" href="#" onclick="return doclink('link-4', 'set', 'link-4');">set</a></tt> </tt>
149 <a name="L65"></a><tt class="py-lineno"> 65</tt>  <tt class="py-line"><tt class="py-keyword">except</tt> <tt class="py-name">NameError</tt><tt class="py-op">:</tt> </tt>
150 <a name="L66"></a><tt class="py-lineno"> 66</tt>  <tt class="py-line">    <tt class="py-comment"># Python 2.3</tt> </tt>
151 <a name="L67"></a><tt class="py-lineno"> 67</tt>  <tt class="py-line">    <tt class="py-keyword">from</tt> <tt class="py-name">sets</tt> <tt class="py-keyword">import</tt> <tt class="py-name">Set</tt> <tt class="py-keyword">as</tt> <tt id="link-5" class="py-name"><a title="lxml.etree._Element.set
152 lxml.etree._XSLTProcessingInstruction.set
153 lxml.etree.__ContentOnlyElement.set" class="py-name" href="#" onclick="return doclink('link-5', 'set', 'link-4');">set</a></tt> </tt>
154 <a name="L68"></a><tt class="py-lineno"> 68</tt>  <tt class="py-line"> </tt>
155 <a name="L69"></a><tt class="py-lineno"> 69</tt>  <tt class="py-line"><tt id="link-6" class="py-name" targets="Variable lxml.ElementInclude.XINCLUDE=lxml.ElementInclude-module.html#XINCLUDE,Variable lxml.etree.ErrorDomains.XINCLUDE=lxml.etree.ErrorDomains-class.html#XINCLUDE"><a title="lxml.ElementInclude.XINCLUDE
156 lxml.etree.ErrorDomains.XINCLUDE" class="py-name" href="#" onclick="return doclink('link-6', 'XINCLUDE', 'link-6');">XINCLUDE</a></tt> <tt class="py-op">=</tt> <tt class="py-string">"{http://www.w3.org/2001/XInclude}"</tt> </tt>
157 <a name="L70"></a><tt class="py-lineno"> 70</tt>  <tt class="py-line"> </tt>
158 <a name="L71"></a><tt class="py-lineno"> 71</tt>  <tt class="py-line"><tt id="link-7" class="py-name" targets="Variable lxml.ElementInclude.XINCLUDE_INCLUDE=lxml.ElementInclude-module.html#XINCLUDE_INCLUDE"><a title="lxml.ElementInclude.XINCLUDE_INCLUDE" class="py-name" href="#" onclick="return doclink('link-7', 'XINCLUDE_INCLUDE', 'link-7');">XINCLUDE_INCLUDE</a></tt> <tt class="py-op">=</tt> <tt id="link-8" class="py-name"><a title="lxml.ElementInclude.XINCLUDE
159 lxml.etree.ErrorDomains.XINCLUDE" class="py-name" href="#" onclick="return doclink('link-8', 'XINCLUDE', 'link-6');">XINCLUDE</a></tt> <tt class="py-op">+</tt> <tt class="py-string">"include"</tt> </tt>
160 <a name="L72"></a><tt class="py-lineno"> 72</tt>  <tt class="py-line"><tt id="link-9" class="py-name" targets="Variable lxml.ElementInclude.XINCLUDE_FALLBACK=lxml.ElementInclude-module.html#XINCLUDE_FALLBACK"><a title="lxml.ElementInclude.XINCLUDE_FALLBACK" class="py-name" href="#" onclick="return doclink('link-9', 'XINCLUDE_FALLBACK', 'link-9');">XINCLUDE_FALLBACK</a></tt> <tt class="py-op">=</tt> <tt id="link-10" class="py-name"><a title="lxml.ElementInclude.XINCLUDE
161 lxml.etree.ErrorDomains.XINCLUDE" class="py-name" href="#" onclick="return doclink('link-10', 'XINCLUDE', 'link-6');">XINCLUDE</a></tt> <tt class="py-op">+</tt> <tt class="py-string">"fallback"</tt> </tt>
162 <a name="L73"></a><tt class="py-lineno"> 73</tt>  <tt class="py-line"> </tt>
163 <a name="L74"></a><tt class="py-lineno"> 74</tt>  <tt class="py-line"><tt class="py-comment">##</tt> </tt>
164 <a name="L75"></a><tt class="py-lineno"> 75</tt>  <tt class="py-line"><tt class="py-comment"># Fatal include error.</tt> </tt>
165 <a name="L76"></a><tt class="py-lineno"> 76</tt>  <tt class="py-line"> </tt>
166 <a name="FatalIncludeError"></a><div id="FatalIncludeError-def"><a name="L77"></a><tt class="py-lineno"> 77</tt> <a class="py-toggle" href="#" id="FatalIncludeError-toggle" onclick="return toggle('FatalIncludeError');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="lxml.ElementInclude.FatalIncludeError-class.html">FatalIncludeError</a><tt class="py-op">(</tt><tt class="py-base-class">etree</tt><tt class="py-op">.</tt><tt class="py-base-class">LxmlSyntaxError</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
167 </div><div id="FatalIncludeError-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="FatalIncludeError-expanded"><a name="L78"></a><tt class="py-lineno"> 78</tt>  <tt class="py-line">    <tt class="py-keyword">pass</tt> </tt>
168 </div><a name="L79"></a><tt class="py-lineno"> 79</tt>  <tt class="py-line"> </tt>
169 <a name="L80"></a><tt class="py-lineno"> 80</tt>  <tt class="py-line"><tt class="py-comment">##</tt> </tt>
170 <a name="L81"></a><tt class="py-lineno"> 81</tt>  <tt class="py-line"><tt class="py-comment"># ET compatible default loader.</tt> </tt>
171 <a name="L82"></a><tt class="py-lineno"> 82</tt>  <tt class="py-line"><tt class="py-comment"># This loader reads an included resource from disk.</tt> </tt>
172 <a name="L83"></a><tt class="py-lineno"> 83</tt>  <tt class="py-line"><tt class="py-comment">#</tt> </tt>
173 <a name="L84"></a><tt class="py-lineno"> 84</tt>  <tt class="py-line"><tt class="py-comment"># @param href Resource reference.</tt> </tt>
174 <a name="L85"></a><tt class="py-lineno"> 85</tt>  <tt class="py-line"><tt class="py-comment"># @param parse Parse mode.  Either "xml" or "text".</tt> </tt>
175 <a name="L86"></a><tt class="py-lineno"> 86</tt>  <tt class="py-line"><tt class="py-comment"># @param encoding Optional text encoding.</tt> </tt>
176 <a name="L87"></a><tt class="py-lineno"> 87</tt>  <tt class="py-line"><tt class="py-comment"># @return The expanded resource.  If the parse mode is "xml", this</tt> </tt>
177 <a name="L88"></a><tt class="py-lineno"> 88</tt>  <tt class="py-line"><tt class="py-comment">#    is an ElementTree instance.  If the parse mode is "text", this</tt> </tt>
178 <a name="L89"></a><tt class="py-lineno"> 89</tt>  <tt class="py-line"><tt class="py-comment">#    is a Unicode string.  If the loader fails, it can return None</tt> </tt>
179 <a name="L90"></a><tt class="py-lineno"> 90</tt>  <tt class="py-line"><tt class="py-comment">#    or raise an IOError exception.</tt> </tt>
180 <a name="L91"></a><tt class="py-lineno"> 91</tt>  <tt class="py-line"><tt class="py-comment"># @throws IOError If the loader fails to load the resource.</tt> </tt>
181 <a name="L92"></a><tt class="py-lineno"> 92</tt>  <tt class="py-line"> </tt>
182 <a name="default_loader"></a><div id="default_loader-def"><a name="L93"></a><tt class="py-lineno"> 93</tt> <a class="py-toggle" href="#" id="default_loader-toggle" onclick="return toggle('default_loader');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="lxml.ElementInclude-module.html#default_loader">default_loader</a><tt class="py-op">(</tt><tt class="py-param">href</tt><tt class="py-op">,</tt> <tt class="py-param">parse</tt><tt class="py-op">,</tt> <tt class="py-param">encoding</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
183 </div><div id="default_loader-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="default_loader-expanded"><a name="L94"></a><tt class="py-lineno"> 94</tt>  <tt class="py-line">    <tt class="py-name">file</tt> <tt class="py-op">=</tt> <tt class="py-name">open</tt><tt class="py-op">(</tt><tt class="py-name">href</tt><tt class="py-op">,</tt> <tt class="py-string">'rb'</tt><tt class="py-op">)</tt> </tt>
184 <a name="L95"></a><tt class="py-lineno"> 95</tt>  <tt class="py-line">    <tt class="py-keyword">if</tt> <tt id="link-11" class="py-name"><a title="lxml.cssselect.parse
185 lxml.etree._ElementTree.parse
186 lxml.etree.parse
187 lxml.html.ElementSoup.parse
188 lxml.html.html5parser.parse
189 lxml.html.parse
190 lxml.html.soupparser.parse
191 lxml.objectify.parse
192 lxml.tests.common_imports.HelperTestCase.parse" class="py-name" href="#" onclick="return doclink('link-11', 'parse', 'link-3');">parse</a></tt> <tt class="py-op">==</tt> <tt class="py-string">"xml"</tt><tt class="py-op">:</tt> </tt>
193 <a name="L96"></a><tt class="py-lineno"> 96</tt>  <tt class="py-line">        <tt id="link-12" class="py-name" targets="Method lxml.etree.TreeBuilder.data()=lxml.etree.TreeBuilder-class.html#data"><a title="lxml.etree.TreeBuilder.data" class="py-name" href="#" onclick="return doclink('link-12', 'data', 'link-12');">data</a></tt> <tt class="py-op">=</tt> <tt id="link-13" class="py-name"><a title="lxml.etree
194 lxml.sax.ElementTreeContentHandler.etree
195 lxml.tests.test_elementtree.CElementTreeTestCase.etree
196 lxml.tests.test_elementtree.ETreeTestCaseBase.etree
197 lxml.tests.test_io.IOTestCaseBase.etree" class="py-name" href="#" onclick="return doclink('link-13', 'etree', 'link-1');">etree</a></tt><tt class="py-op">.</tt><tt id="link-14" class="py-name"><a title="lxml.cssselect.parse
198 lxml.etree._ElementTree.parse
199 lxml.etree.parse
200 lxml.html.ElementSoup.parse
201 lxml.html.html5parser.parse
202 lxml.html.parse
203 lxml.html.soupparser.parse
204 lxml.objectify.parse
205 lxml.tests.common_imports.HelperTestCase.parse" class="py-name" href="#" onclick="return doclink('link-14', 'parse', 'link-3');">parse</a></tt><tt class="py-op">(</tt><tt class="py-name">file</tt><tt class="py-op">)</tt><tt class="py-op">.</tt><tt id="link-15" class="py-name" targets="Method lxml.etree._ElementTree.getroot()=lxml.etree._ElementTree-class.html#getroot"><a title="lxml.etree._ElementTree.getroot" class="py-name" href="#" onclick="return doclink('link-15', 'getroot', 'link-15');">getroot</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
206 <a name="L97"></a><tt class="py-lineno"> 97</tt>  <tt class="py-line">    <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
207 <a name="L98"></a><tt class="py-lineno"> 98</tt>  <tt class="py-line">        <tt id="link-16" class="py-name"><a title="lxml.etree.TreeBuilder.data" class="py-name" href="#" onclick="return doclink('link-16', 'data', 'link-12');">data</a></tt> <tt class="py-op">=</tt> <tt class="py-name">file</tt><tt class="py-op">.</tt><tt id="link-17" class="py-name" targets="Method lxml.tests.common_imports.LargeFileLike.read()=lxml.tests.common_imports.LargeFileLike-class.html#read,Method lxml.tests.common_imports.SillyFileLike.read()=lxml.tests.common_imports.SillyFileLike-class.html#read"><a title="lxml.tests.common_imports.LargeFileLike.read
208 lxml.tests.common_imports.SillyFileLike.read" class="py-name" href="#" onclick="return doclink('link-17', 'read', 'link-17');">read</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
209 <a name="L99"></a><tt class="py-lineno"> 99</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-keyword">not</tt> <tt id="link-18" class="py-name" targets="Variable lxml.etree.DocInfo.encoding=lxml.etree.DocInfo-class.html#encoding"><a title="lxml.etree.DocInfo.encoding" class="py-name" href="#" onclick="return doclink('link-18', 'encoding', 'link-18');">encoding</a></tt><tt class="py-op">:</tt> </tt>
210 <a name="L100"></a><tt class="py-lineno">100</tt>  <tt class="py-line">            <tt id="link-19" class="py-name"><a title="lxml.etree.DocInfo.encoding" class="py-name" href="#" onclick="return doclink('link-19', 'encoding', 'link-18');">encoding</a></tt> <tt class="py-op">=</tt> <tt class="py-string">'utf-8'</tt> </tt>
211 <a name="L101"></a><tt class="py-lineno">101</tt>  <tt class="py-line">        <tt id="link-20" class="py-name"><a title="lxml.etree.TreeBuilder.data" class="py-name" href="#" onclick="return doclink('link-20', 'data', 'link-12');">data</a></tt> <tt class="py-op">=</tt> <tt id="link-21" class="py-name"><a title="lxml.etree.TreeBuilder.data" class="py-name" href="#" onclick="return doclink('link-21', 'data', 'link-12');">data</a></tt><tt class="py-op">.</tt><tt class="py-name">decode</tt><tt class="py-op">(</tt><tt id="link-22" class="py-name"><a title="lxml.etree.DocInfo.encoding" class="py-name" href="#" onclick="return doclink('link-22', 'encoding', 'link-18');">encoding</a></tt><tt class="py-op">)</tt> </tt>
212 <a name="L102"></a><tt class="py-lineno">102</tt>  <tt class="py-line">    <tt class="py-name">file</tt><tt class="py-op">.</tt><tt id="link-23" class="py-name" targets="Method lxml.etree.TreeBuilder.close()=lxml.etree.TreeBuilder-class.html#close,Method lxml.etree._FeedParser.close()=lxml.etree._FeedParser-class.html#close"><a title="lxml.etree.TreeBuilder.close
213 lxml.etree._FeedParser.close" class="py-name" href="#" onclick="return doclink('link-23', 'close', 'link-23');">close</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
214 <a name="L103"></a><tt class="py-lineno">103</tt>  <tt class="py-line">    <tt class="py-keyword">return</tt> <tt id="link-24" class="py-name"><a title="lxml.etree.TreeBuilder.data" class="py-name" href="#" onclick="return doclink('link-24', 'data', 'link-12');">data</a></tt> </tt>
215 </div><a name="L104"></a><tt class="py-lineno">104</tt>  <tt class="py-line"> </tt>
216 <a name="L105"></a><tt class="py-lineno">105</tt>  <tt class="py-line"><tt class="py-comment">##</tt> </tt>
217 <a name="L106"></a><tt class="py-lineno">106</tt>  <tt class="py-line"><tt class="py-comment"># Default loader used by lxml.etree - handles custom resolvers properly</tt> </tt>
218 <a name="L107"></a><tt class="py-lineno">107</tt>  <tt class="py-line"><tt class="py-comment"># </tt> </tt>
219 <a name="L108"></a><tt class="py-lineno">108</tt>  <tt class="py-line"> </tt>
220 <a name="_lxml_default_loader"></a><div id="_lxml_default_loader-def"><a name="L109"></a><tt class="py-lineno">109</tt> <a class="py-toggle" href="#" id="_lxml_default_loader-toggle" onclick="return toggle('_lxml_default_loader');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="lxml.ElementInclude-module.html#_lxml_default_loader">_lxml_default_loader</a><tt class="py-op">(</tt><tt class="py-param">href</tt><tt class="py-op">,</tt> <tt class="py-param">parse</tt><tt class="py-op">,</tt> <tt class="py-param">encoding</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">,</tt> <tt class="py-param">parser</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
221 </div><div id="_lxml_default_loader-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="_lxml_default_loader-expanded"><a name="L110"></a><tt class="py-lineno">110</tt>  <tt class="py-line">    <tt class="py-keyword">if</tt> <tt id="link-25" class="py-name"><a title="lxml.cssselect.parse
222 lxml.etree._ElementTree.parse
223 lxml.etree.parse
224 lxml.html.ElementSoup.parse
225 lxml.html.html5parser.parse
226 lxml.html.parse
227 lxml.html.soupparser.parse
228 lxml.objectify.parse
229 lxml.tests.common_imports.HelperTestCase.parse" class="py-name" href="#" onclick="return doclink('link-25', 'parse', 'link-3');">parse</a></tt> <tt class="py-op">==</tt> <tt class="py-string">"xml"</tt><tt class="py-op">:</tt> </tt>
230 <a name="L111"></a><tt class="py-lineno">111</tt>  <tt class="py-line">        <tt id="link-26" class="py-name"><a title="lxml.etree.TreeBuilder.data" class="py-name" href="#" onclick="return doclink('link-26', 'data', 'link-12');">data</a></tt> <tt class="py-op">=</tt> <tt id="link-27" class="py-name"><a title="lxml.etree
231 lxml.sax.ElementTreeContentHandler.etree
232 lxml.tests.test_elementtree.CElementTreeTestCase.etree
233 lxml.tests.test_elementtree.ETreeTestCaseBase.etree
234 lxml.tests.test_io.IOTestCaseBase.etree" class="py-name" href="#" onclick="return doclink('link-27', 'etree', 'link-1');">etree</a></tt><tt class="py-op">.</tt><tt id="link-28" class="py-name"><a title="lxml.cssselect.parse
235 lxml.etree._ElementTree.parse
236 lxml.etree.parse
237 lxml.html.ElementSoup.parse
238 lxml.html.html5parser.parse
239 lxml.html.parse
240 lxml.html.soupparser.parse
241 lxml.objectify.parse
242 lxml.tests.common_imports.HelperTestCase.parse" class="py-name" href="#" onclick="return doclink('link-28', 'parse', 'link-3');">parse</a></tt><tt class="py-op">(</tt><tt class="py-name">href</tt><tt class="py-op">,</tt> <tt id="link-29" class="py-name" targets="Variable lxml.etree._ElementTree.parser=lxml.etree._ElementTree-class.html#parser,Variable lxml.tests.test_pyclasslookup.PyClassLookupTestCase.parser=lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html#parser"><a title="lxml.etree._ElementTree.parser
243 lxml.tests.test_pyclasslookup.PyClassLookupTestCase.parser" class="py-name" href="#" onclick="return doclink('link-29', 'parser', 'link-29');">parser</a></tt><tt class="py-op">)</tt><tt class="py-op">.</tt><tt id="link-30" class="py-name"><a title="lxml.etree._ElementTree.getroot" class="py-name" href="#" onclick="return doclink('link-30', 'getroot', 'link-15');">getroot</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
244 <a name="L112"></a><tt class="py-lineno">112</tt>  <tt class="py-line">    <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
245 <a name="L113"></a><tt class="py-lineno">113</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-string">"://"</tt> <tt class="py-keyword">in</tt> <tt class="py-name">href</tt><tt class="py-op">:</tt> </tt>
246 <a name="L114"></a><tt class="py-lineno">114</tt>  <tt class="py-line">            <tt class="py-name">f</tt> <tt class="py-op">=</tt> <tt class="py-name">urlopen</tt><tt class="py-op">(</tt><tt class="py-name">href</tt><tt class="py-op">)</tt> </tt>
247 <a name="L115"></a><tt class="py-lineno">115</tt>  <tt class="py-line">        <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
248 <a name="L116"></a><tt class="py-lineno">116</tt>  <tt class="py-line">            <tt class="py-name">f</tt> <tt class="py-op">=</tt> <tt class="py-name">open</tt><tt class="py-op">(</tt><tt class="py-name">href</tt><tt class="py-op">,</tt> <tt class="py-string">'rb'</tt><tt class="py-op">)</tt> </tt>
249 <a name="L117"></a><tt class="py-lineno">117</tt>  <tt class="py-line">        <tt id="link-31" class="py-name"><a title="lxml.etree.TreeBuilder.data" class="py-name" href="#" onclick="return doclink('link-31', 'data', 'link-12');">data</a></tt> <tt class="py-op">=</tt> <tt class="py-name">f</tt><tt class="py-op">.</tt><tt id="link-32" class="py-name"><a title="lxml.tests.common_imports.LargeFileLike.read
250 lxml.tests.common_imports.SillyFileLike.read" class="py-name" href="#" onclick="return doclink('link-32', 'read', 'link-17');">read</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
251 <a name="L118"></a><tt class="py-lineno">118</tt>  <tt class="py-line">        <tt class="py-name">f</tt><tt class="py-op">.</tt><tt id="link-33" class="py-name"><a title="lxml.etree.TreeBuilder.close
252 lxml.etree._FeedParser.close" class="py-name" href="#" onclick="return doclink('link-33', 'close', 'link-23');">close</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
253 <a name="L119"></a><tt class="py-lineno">119</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-keyword">not</tt> <tt id="link-34" class="py-name"><a title="lxml.etree.DocInfo.encoding" class="py-name" href="#" onclick="return doclink('link-34', 'encoding', 'link-18');">encoding</a></tt><tt class="py-op">:</tt> </tt>
254 <a name="L120"></a><tt class="py-lineno">120</tt>  <tt class="py-line">            <tt id="link-35" class="py-name"><a title="lxml.etree.DocInfo.encoding" class="py-name" href="#" onclick="return doclink('link-35', 'encoding', 'link-18');">encoding</a></tt> <tt class="py-op">=</tt> <tt class="py-string">'utf-8'</tt> </tt>
255 <a name="L121"></a><tt class="py-lineno">121</tt>  <tt class="py-line">        <tt id="link-36" class="py-name"><a title="lxml.etree.TreeBuilder.data" class="py-name" href="#" onclick="return doclink('link-36', 'data', 'link-12');">data</a></tt> <tt class="py-op">=</tt> <tt id="link-37" class="py-name"><a title="lxml.etree.TreeBuilder.data" class="py-name" href="#" onclick="return doclink('link-37', 'data', 'link-12');">data</a></tt><tt class="py-op">.</tt><tt class="py-name">decode</tt><tt class="py-op">(</tt><tt id="link-38" class="py-name"><a title="lxml.etree.DocInfo.encoding" class="py-name" href="#" onclick="return doclink('link-38', 'encoding', 'link-18');">encoding</a></tt><tt class="py-op">)</tt> </tt>
256 <a name="L122"></a><tt class="py-lineno">122</tt>  <tt class="py-line">    <tt class="py-keyword">return</tt> <tt id="link-39" class="py-name"><a title="lxml.etree.TreeBuilder.data" class="py-name" href="#" onclick="return doclink('link-39', 'data', 'link-12');">data</a></tt> </tt>
257 </div><a name="L123"></a><tt class="py-lineno">123</tt>  <tt class="py-line"> </tt>
258 <a name="L124"></a><tt class="py-lineno">124</tt>  <tt class="py-line"><tt class="py-comment">##</tt> </tt>
259 <a name="L125"></a><tt class="py-lineno">125</tt>  <tt class="py-line"><tt class="py-comment"># Wrapper for ET compatibility - drops the parser</tt> </tt>
260 <a name="L126"></a><tt class="py-lineno">126</tt>  <tt class="py-line"> </tt>
261 <a name="_wrap_et_loader"></a><div id="_wrap_et_loader-def"><a name="L127"></a><tt class="py-lineno">127</tt> <a class="py-toggle" href="#" id="_wrap_et_loader-toggle" onclick="return toggle('_wrap_et_loader');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="lxml.ElementInclude-module.html#_wrap_et_loader">_wrap_et_loader</a><tt class="py-op">(</tt><tt class="py-param">loader</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
262 </div><div id="_wrap_et_loader-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="_wrap_et_loader-expanded"><a name="L128"></a><tt class="py-lineno">128</tt>  <tt class="py-line">    <tt class="py-keyword">def</tt> <tt class="py-def-name">load</tt><tt class="py-op">(</tt><tt class="py-param">href</tt><tt class="py-op">,</tt> <tt class="py-param">parse</tt><tt class="py-op">,</tt> <tt class="py-param">encoding</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">,</tt> <tt class="py-param">parser</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
263 <a name="L129"></a><tt class="py-lineno">129</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">loader</tt><tt class="py-op">(</tt><tt class="py-name">href</tt><tt class="py-op">,</tt> <tt id="link-40" class="py-name"><a title="lxml.cssselect.parse
264 lxml.etree._ElementTree.parse
265 lxml.etree.parse
266 lxml.html.ElementSoup.parse
267 lxml.html.html5parser.parse
268 lxml.html.parse
269 lxml.html.soupparser.parse
270 lxml.objectify.parse
271 lxml.tests.common_imports.HelperTestCase.parse" class="py-name" href="#" onclick="return doclink('link-40', 'parse', 'link-3');">parse</a></tt><tt class="py-op">,</tt> <tt id="link-41" class="py-name"><a title="lxml.etree.DocInfo.encoding" class="py-name" href="#" onclick="return doclink('link-41', 'encoding', 'link-18');">encoding</a></tt><tt class="py-op">)</tt> </tt>
272 </div><a name="L130"></a><tt class="py-lineno">130</tt>  <tt class="py-line">    <tt class="py-keyword">return</tt> <tt class="py-name">load</tt> </tt>
273 </div><a name="L131"></a><tt class="py-lineno">131</tt>  <tt class="py-line"> </tt>
274 <a name="L132"></a><tt class="py-lineno">132</tt>  <tt class="py-line"> </tt>
275 <a name="L133"></a><tt class="py-lineno">133</tt>  <tt class="py-line"><tt class="py-comment">##</tt> </tt>
276 <a name="L134"></a><tt class="py-lineno">134</tt>  <tt class="py-line"><tt class="py-comment"># Expand XInclude directives.</tt> </tt>
277 <a name="L135"></a><tt class="py-lineno">135</tt>  <tt class="py-line"><tt class="py-comment">#</tt> </tt>
278 <a name="L136"></a><tt class="py-lineno">136</tt>  <tt class="py-line"><tt class="py-comment"># @param elem Root element.</tt> </tt>
279 <a name="L137"></a><tt class="py-lineno">137</tt>  <tt class="py-line"><tt class="py-comment"># @param loader Optional resource loader.  If omitted, it defaults</tt> </tt>
280 <a name="L138"></a><tt class="py-lineno">138</tt>  <tt class="py-line"><tt class="py-comment">#     to {@link default_loader}.  If given, it should be a callable</tt> </tt>
281 <a name="L139"></a><tt class="py-lineno">139</tt>  <tt class="py-line"><tt class="py-comment">#     that implements the same interface as &lt;b&gt;default_loader&lt;/b&gt;.</tt> </tt>
282 <a name="L140"></a><tt class="py-lineno">140</tt>  <tt class="py-line"><tt class="py-comment"># @throws FatalIncludeError If the function fails to include a given</tt> </tt>
283 <a name="L141"></a><tt class="py-lineno">141</tt>  <tt class="py-line"><tt class="py-comment">#     resource, or if the tree contains malformed XInclude elements.</tt> </tt>
284 <a name="L142"></a><tt class="py-lineno">142</tt>  <tt class="py-line"><tt class="py-comment"># @throws IOError If the function fails to load a given resource.</tt> </tt>
285 <a name="L143"></a><tt class="py-lineno">143</tt>  <tt class="py-line"><tt class="py-comment"># @returns the node or its replacement if it was an XInclude node</tt> </tt>
286 <a name="L144"></a><tt class="py-lineno">144</tt>  <tt class="py-line"> </tt>
287 <a name="include"></a><div id="include-def"><a name="L145"></a><tt class="py-lineno">145</tt> <a class="py-toggle" href="#" id="include-toggle" onclick="return toggle('include');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="lxml.ElementInclude-module.html#include">include</a><tt class="py-op">(</tt><tt class="py-param">elem</tt><tt class="py-op">,</tt> <tt class="py-param">loader</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">,</tt> <tt class="py-param">base_url</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
288 </div><div id="include-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="include-expanded"><a name="L146"></a><tt class="py-lineno">146</tt>  <tt class="py-line">    <tt class="py-keyword">if</tt> <tt id="link-42" class="py-name" targets="Variable lxml.html.HtmlMixin.base_url=lxml.html.HtmlMixin-class.html#base_url"><a title="lxml.html.HtmlMixin.base_url" class="py-name" href="#" onclick="return doclink('link-42', 'base_url', 'link-42');">base_url</a></tt> <tt class="py-keyword">is</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> </tt>
289 <a name="L147"></a><tt class="py-lineno">147</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt id="link-43" class="py-name" targets="Method lxml.objectify.ObjectPath.hasattr()=lxml.objectify.ObjectPath-class.html#hasattr"><a title="lxml.objectify.ObjectPath.hasattr" class="py-name" href="#" onclick="return doclink('link-43', 'hasattr', 'link-43');">hasattr</a></tt><tt class="py-op">(</tt><tt class="py-name">elem</tt><tt class="py-op">,</tt> <tt class="py-string">'getroot'</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
290 <a name="L148"></a><tt class="py-lineno">148</tt>  <tt class="py-line">            <tt class="py-name">tree</tt> <tt class="py-op">=</tt> <tt class="py-name">elem</tt> </tt>
291 <a name="L149"></a><tt class="py-lineno">149</tt>  <tt class="py-line">            <tt class="py-name">elem</tt> <tt class="py-op">=</tt> <tt class="py-name">elem</tt><tt class="py-op">.</tt><tt id="link-44" class="py-name"><a title="lxml.etree._ElementTree.getroot" class="py-name" href="#" onclick="return doclink('link-44', 'getroot', 'link-15');">getroot</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
292 <a name="L150"></a><tt class="py-lineno">150</tt>  <tt class="py-line">        <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
293 <a name="L151"></a><tt class="py-lineno">151</tt>  <tt class="py-line">            <tt class="py-name">tree</tt> <tt class="py-op">=</tt> <tt class="py-name">elem</tt><tt class="py-op">.</tt><tt id="link-45" class="py-name" targets="Method lxml.etree._Element.getroottree()=lxml.etree._Element-class.html#getroottree"><a title="lxml.etree._Element.getroottree" class="py-name" href="#" onclick="return doclink('link-45', 'getroottree', 'link-45');">getroottree</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
294 <a name="L152"></a><tt class="py-lineno">152</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt id="link-46" class="py-name"><a title="lxml.objectify.ObjectPath.hasattr" class="py-name" href="#" onclick="return doclink('link-46', 'hasattr', 'link-43');">hasattr</a></tt><tt class="py-op">(</tt><tt class="py-name">tree</tt><tt class="py-op">,</tt> <tt class="py-string">'docinfo'</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
295 <a name="L153"></a><tt class="py-lineno">153</tt>  <tt class="py-line">            <tt id="link-47" class="py-name"><a title="lxml.html.HtmlMixin.base_url" class="py-name" href="#" onclick="return doclink('link-47', 'base_url', 'link-42');">base_url</a></tt> <tt class="py-op">=</tt> <tt class="py-name">tree</tt><tt class="py-op">.</tt><tt id="link-48" class="py-name" targets="Variable lxml.etree._ElementTree.docinfo=lxml.etree._ElementTree-class.html#docinfo"><a title="lxml.etree._ElementTree.docinfo" class="py-name" href="#" onclick="return doclink('link-48', 'docinfo', 'link-48');">docinfo</a></tt><tt class="py-op">.</tt><tt id="link-49" class="py-name" targets="Variable lxml.etree.DocInfo.URL=lxml.etree.DocInfo-class.html#URL"><a title="lxml.etree.DocInfo.URL" class="py-name" href="#" onclick="return doclink('link-49', 'URL', 'link-49');">URL</a></tt> </tt>
296 <a name="L154"></a><tt class="py-lineno">154</tt>  <tt class="py-line">    <tt class="py-keyword">elif</tt> <tt id="link-50" class="py-name"><a title="lxml.objectify.ObjectPath.hasattr" class="py-name" href="#" onclick="return doclink('link-50', 'hasattr', 'link-43');">hasattr</a></tt><tt class="py-op">(</tt><tt class="py-name">elem</tt><tt class="py-op">,</tt> <tt class="py-string">'getroot'</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
297 <a name="L155"></a><tt class="py-lineno">155</tt>  <tt class="py-line">        <tt class="py-name">elem</tt> <tt class="py-op">=</tt> <tt class="py-name">elem</tt><tt class="py-op">.</tt><tt id="link-51" class="py-name"><a title="lxml.etree._ElementTree.getroot" class="py-name" href="#" onclick="return doclink('link-51', 'getroot', 'link-15');">getroot</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
298 <a name="L156"></a><tt class="py-lineno">156</tt>  <tt class="py-line">    <tt id="link-52" class="py-name" targets="Function lxml.ElementInclude._include()=lxml.ElementInclude-module.html#_include,Variable lxml.isoschematron.Schematron._include=lxml.isoschematron.Schematron-class.html#_include"><a title="lxml.ElementInclude._include
299 lxml.isoschematron.Schematron._include" class="py-name" href="#" onclick="return doclink('link-52', '_include', 'link-52');">_include</a></tt><tt class="py-op">(</tt><tt class="py-name">elem</tt><tt class="py-op">,</tt> <tt class="py-name">loader</tt><tt class="py-op">,</tt> <tt id="link-53" class="py-name"><a title="lxml.html.HtmlMixin.base_url" class="py-name" href="#" onclick="return doclink('link-53', 'base_url', 'link-42');">base_url</a></tt><tt class="py-op">=</tt><tt id="link-54" class="py-name"><a title="lxml.html.HtmlMixin.base_url" class="py-name" href="#" onclick="return doclink('link-54', 'base_url', 'link-42');">base_url</a></tt><tt class="py-op">)</tt> </tt>
300 </div><a name="L157"></a><tt class="py-lineno">157</tt>  <tt class="py-line"> </tt>
301 <a name="_include"></a><div id="_include-def"><a name="L158"></a><tt class="py-lineno">158</tt> <a class="py-toggle" href="#" id="_include-toggle" onclick="return toggle('_include');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="lxml.ElementInclude-module.html#_include">_include</a><tt class="py-op">(</tt><tt class="py-param">elem</tt><tt class="py-op">,</tt> <tt class="py-param">loader</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">,</tt> <tt class="py-param">_parent_hrefs</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">,</tt> <tt class="py-param">base_url</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
302 </div><div id="_include-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="_include-expanded"><a name="L159"></a><tt class="py-lineno">159</tt>  <tt class="py-line">    <tt class="py-keyword">if</tt> <tt class="py-name">loader</tt> <tt class="py-keyword">is</tt> <tt class="py-keyword">not</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> </tt>
303 <a name="L160"></a><tt class="py-lineno">160</tt>  <tt class="py-line">        <tt class="py-name">load_include</tt> <tt class="py-op">=</tt> <tt id="link-55" class="py-name" targets="Function lxml.ElementInclude._wrap_et_loader()=lxml.ElementInclude-module.html#_wrap_et_loader"><a title="lxml.ElementInclude._wrap_et_loader" class="py-name" href="#" onclick="return doclink('link-55', '_wrap_et_loader', 'link-55');">_wrap_et_loader</a></tt><tt class="py-op">(</tt><tt class="py-name">loader</tt><tt class="py-op">)</tt> </tt>
304 <a name="L161"></a><tt class="py-lineno">161</tt>  <tt class="py-line">    <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
305 <a name="L162"></a><tt class="py-lineno">162</tt>  <tt class="py-line">        <tt class="py-name">load_include</tt> <tt class="py-op">=</tt> <tt id="link-56" class="py-name" targets="Function lxml.ElementInclude._lxml_default_loader()=lxml.ElementInclude-module.html#_lxml_default_loader"><a title="lxml.ElementInclude._lxml_default_loader" class="py-name" href="#" onclick="return doclink('link-56', '_lxml_default_loader', 'link-56');">_lxml_default_loader</a></tt> </tt>
306 <a name="L163"></a><tt class="py-lineno">163</tt>  <tt class="py-line"> </tt>
307 <a name="L164"></a><tt class="py-lineno">164</tt>  <tt class="py-line">    <tt class="py-keyword">if</tt> <tt class="py-name">_parent_hrefs</tt> <tt class="py-keyword">is</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> </tt>
308 <a name="L165"></a><tt class="py-lineno">165</tt>  <tt class="py-line">        <tt class="py-name">_parent_hrefs</tt> <tt class="py-op">=</tt> <tt id="link-57" class="py-name"><a title="lxml.etree._Element.set
309 lxml.etree._XSLTProcessingInstruction.set
310 lxml.etree.__ContentOnlyElement.set" class="py-name" href="#" onclick="return doclink('link-57', 'set', 'link-4');">set</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
311 <a name="L166"></a><tt class="py-lineno">166</tt>  <tt class="py-line"> </tt>
312 <a name="L167"></a><tt class="py-lineno">167</tt>  <tt class="py-line">    <tt id="link-58" class="py-name"><a title="lxml.etree._ElementTree.parser
313 lxml.tests.test_pyclasslookup.PyClassLookupTestCase.parser" class="py-name" href="#" onclick="return doclink('link-58', 'parser', 'link-29');">parser</a></tt> <tt class="py-op">=</tt> <tt class="py-name">elem</tt><tt class="py-op">.</tt><tt id="link-59" class="py-name"><a title="lxml.etree._Element.getroottree" class="py-name" href="#" onclick="return doclink('link-59', 'getroottree', 'link-45');">getroottree</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">.</tt><tt id="link-60" class="py-name"><a title="lxml.etree._ElementTree.parser
314 lxml.tests.test_pyclasslookup.PyClassLookupTestCase.parser" class="py-name" href="#" onclick="return doclink('link-60', 'parser', 'link-29');">parser</a></tt> </tt>
315 <a name="L168"></a><tt class="py-lineno">168</tt>  <tt class="py-line"> </tt>
316 <a name="L169"></a><tt class="py-lineno">169</tt>  <tt class="py-line">    <tt class="py-name">include_elements</tt> <tt class="py-op">=</tt> <tt class="py-name">list</tt><tt class="py-op">(</tt> </tt>
317 <a name="L170"></a><tt class="py-lineno">170</tt>  <tt class="py-line">        <tt class="py-name">elem</tt><tt class="py-op">.</tt><tt id="link-61" class="py-name" targets="Method lxml.etree._Element.iter()=lxml.etree._Element-class.html#iter,Method lxml.etree._ElementTree.iter()=lxml.etree._ElementTree-class.html#iter"><a title="lxml.etree._Element.iter
318 lxml.etree._ElementTree.iter" class="py-name" href="#" onclick="return doclink('link-61', 'iter', 'link-61');">iter</a></tt><tt class="py-op">(</tt><tt class="py-string">'{http://www.w3.org/2001/XInclude}*'</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
319 <a name="L171"></a><tt class="py-lineno">171</tt>  <tt class="py-line"> </tt>
320 <a name="L172"></a><tt class="py-lineno">172</tt>  <tt class="py-line">    <tt class="py-keyword">for</tt> <tt class="py-name">e</tt> <tt class="py-keyword">in</tt> <tt class="py-name">include_elements</tt><tt class="py-op">:</tt> </tt>
321 <a name="L173"></a><tt class="py-lineno">173</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">e</tt><tt class="py-op">.</tt><tt id="link-62" class="py-name" targets="Variable lxml.etree._Comment.tag=lxml.etree._Comment-class.html#tag,Variable lxml.etree._Element.tag=lxml.etree._Element-class.html#tag,Variable lxml.etree._Entity.tag=lxml.etree._Entity-class.html#tag,Variable lxml.etree._ProcessingInstruction.tag=lxml.etree._ProcessingInstruction-class.html#tag,Variable lxml.etree._ReadOnlyProxy.tag=lxml.etree._ReadOnlyProxy-class.html#tag,Function lxml.tests.test_xpathevaluator.tag()=lxml.tests.test_xpathevaluator-module.html#tag,Variable xml.etree.ElementTree.Element.tag=xml.etree.ElementTree.Element-class.html#tag"><a title="lxml.etree._Comment.tag
322 lxml.etree._Element.tag
323 lxml.etree._Entity.tag
324 lxml.etree._ProcessingInstruction.tag
325 lxml.etree._ReadOnlyProxy.tag
326 lxml.tests.test_xpathevaluator.tag
327 xml.etree.ElementTree.Element.tag" class="py-name" href="#" onclick="return doclink('link-62', 'tag', 'link-62');">tag</a></tt> <tt class="py-op">==</tt> <tt id="link-63" class="py-name"><a title="lxml.ElementInclude.XINCLUDE_INCLUDE" class="py-name" href="#" onclick="return doclink('link-63', 'XINCLUDE_INCLUDE', 'link-7');">XINCLUDE_INCLUDE</a></tt><tt class="py-op">:</tt> </tt>
328 <a name="L174"></a><tt class="py-lineno">174</tt>  <tt class="py-line">            <tt class="py-comment"># process xinclude directive</tt> </tt>
329 <a name="L175"></a><tt class="py-lineno">175</tt>  <tt class="py-line">            <tt class="py-name">href</tt> <tt class="py-op">=</tt> <tt class="py-name">urljoin</tt><tt class="py-op">(</tt><tt id="link-64" class="py-name"><a title="lxml.html.HtmlMixin.base_url" class="py-name" href="#" onclick="return doclink('link-64', 'base_url', 'link-42');">base_url</a></tt><tt class="py-op">,</tt> <tt class="py-name">e</tt><tt class="py-op">.</tt><tt id="link-65" class="py-name" targets="Method lxml.etree._Attrib.get()=lxml.etree._Attrib-class.html#get,Method lxml.etree._Element.get()=lxml.etree._Element-class.html#get,Method lxml.etree._IDDict.get()=lxml.etree._IDDict-class.html#get,Method lxml.etree._ProcessingInstruction.get()=lxml.etree._ProcessingInstruction-class.html#get,Method lxml.etree._ReadOnlyElementProxy.get()=lxml.etree._ReadOnlyElementProxy-class.html#get,Method lxml.etree.__ContentOnlyElement.get()=lxml.etree.__ContentOnlyElement-class.html#get"><a title="lxml.etree._Attrib.get
330 lxml.etree._Element.get
331 lxml.etree._IDDict.get
332 lxml.etree._ProcessingInstruction.get
333 lxml.etree._ReadOnlyElementProxy.get
334 lxml.etree.__ContentOnlyElement.get" class="py-name" href="#" onclick="return doclink('link-65', 'get', 'link-65');">get</a></tt><tt class="py-op">(</tt><tt class="py-string">"href"</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
335 <a name="L176"></a><tt class="py-lineno">176</tt>  <tt class="py-line">            <tt id="link-66" class="py-name"><a title="lxml.cssselect.parse
336 lxml.etree._ElementTree.parse
337 lxml.etree.parse
338 lxml.html.ElementSoup.parse
339 lxml.html.html5parser.parse
340 lxml.html.parse
341 lxml.html.soupparser.parse
342 lxml.objectify.parse
343 lxml.tests.common_imports.HelperTestCase.parse" class="py-name" href="#" onclick="return doclink('link-66', 'parse', 'link-3');">parse</a></tt> <tt class="py-op">=</tt> <tt class="py-name">e</tt><tt class="py-op">.</tt><tt id="link-67" class="py-name"><a title="lxml.etree._Attrib.get
344 lxml.etree._Element.get
345 lxml.etree._IDDict.get
346 lxml.etree._ProcessingInstruction.get
347 lxml.etree._ReadOnlyElementProxy.get
348 lxml.etree.__ContentOnlyElement.get" class="py-name" href="#" onclick="return doclink('link-67', 'get', 'link-65');">get</a></tt><tt class="py-op">(</tt><tt class="py-string">"parse"</tt><tt class="py-op">,</tt> <tt class="py-string">"xml"</tt><tt class="py-op">)</tt> </tt>
349 <a name="L177"></a><tt class="py-lineno">177</tt>  <tt class="py-line">            <tt class="py-name">parent</tt> <tt class="py-op">=</tt> <tt class="py-name">e</tt><tt class="py-op">.</tt><tt id="link-68" class="py-name" targets="Method lxml.etree._Element.getparent()=lxml.etree._Element-class.html#getparent,Method lxml.etree._ElementStringResult.getparent()=lxml.etree._ElementStringResult-class.html#getparent,Method lxml.etree._ElementUnicodeResult.getparent()=lxml.etree._ElementUnicodeResult-class.html#getparent,Method lxml.etree._ReadOnlyProxy.getparent()=lxml.etree._ReadOnlyProxy-class.html#getparent"><a title="lxml.etree._Element.getparent
350 lxml.etree._ElementStringResult.getparent
351 lxml.etree._ElementUnicodeResult.getparent
352 lxml.etree._ReadOnlyProxy.getparent" class="py-name" href="#" onclick="return doclink('link-68', 'getparent', 'link-68');">getparent</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
353 <a name="L178"></a><tt class="py-lineno">178</tt>  <tt class="py-line">            <tt class="py-keyword">if</tt> <tt id="link-69" class="py-name"><a title="lxml.cssselect.parse
354 lxml.etree._ElementTree.parse
355 lxml.etree.parse
356 lxml.html.ElementSoup.parse
357 lxml.html.html5parser.parse
358 lxml.html.parse
359 lxml.html.soupparser.parse
360 lxml.objectify.parse
361 lxml.tests.common_imports.HelperTestCase.parse" class="py-name" href="#" onclick="return doclink('link-69', 'parse', 'link-3');">parse</a></tt> <tt class="py-op">==</tt> <tt class="py-string">"xml"</tt><tt class="py-op">:</tt> </tt>
362 <a name="L179"></a><tt class="py-lineno">179</tt>  <tt class="py-line">                <tt class="py-keyword">if</tt> <tt class="py-name">href</tt> <tt class="py-keyword">in</tt> <tt class="py-name">_parent_hrefs</tt><tt class="py-op">:</tt> </tt>
363 <a name="L180"></a><tt class="py-lineno">180</tt>  <tt class="py-line">                    <tt class="py-keyword">raise</tt> <tt id="link-70" class="py-name" targets="Class lxml.ElementInclude.FatalIncludeError=lxml.ElementInclude.FatalIncludeError-class.html"><a title="lxml.ElementInclude.FatalIncludeError" class="py-name" href="#" onclick="return doclink('link-70', 'FatalIncludeError', 'link-70');">FatalIncludeError</a></tt><tt class="py-op">(</tt> </tt>
364 <a name="L181"></a><tt class="py-lineno">181</tt>  <tt class="py-line">                        <tt class="py-string">"recursive include of %r detected"</tt> <tt class="py-op">%</tt> <tt class="py-name">href</tt> </tt>
365 <a name="L182"></a><tt class="py-lineno">182</tt>  <tt class="py-line">                        <tt class="py-op">)</tt> </tt>
366 <a name="L183"></a><tt class="py-lineno">183</tt>  <tt class="py-line">                <tt class="py-name">_parent_hrefs</tt><tt class="py-op">.</tt><tt id="link-71" class="py-name" targets="Method lxml.etree._ResolverRegistry.add()=lxml.etree._ResolverRegistry-class.html#add,Method lxml.html.CheckboxValues.add()=lxml.html.CheckboxValues-class.html#add,Method lxml.html.MultipleSelectOptions.add()=lxml.html.MultipleSelectOptions-class.html#add"><a title="lxml.etree._ResolverRegistry.add
367 lxml.html.CheckboxValues.add
368 lxml.html.MultipleSelectOptions.add" class="py-name" href="#" onclick="return doclink('link-71', 'add', 'link-71');">add</a></tt><tt class="py-op">(</tt><tt class="py-name">href</tt><tt class="py-op">)</tt> </tt>
369 <a name="L184"></a><tt class="py-lineno">184</tt>  <tt class="py-line">                <tt class="py-name">node</tt> <tt class="py-op">=</tt> <tt class="py-name">load_include</tt><tt class="py-op">(</tt><tt class="py-name">href</tt><tt class="py-op">,</tt> <tt id="link-72" class="py-name"><a title="lxml.cssselect.parse
370 lxml.etree._ElementTree.parse
371 lxml.etree.parse
372 lxml.html.ElementSoup.parse
373 lxml.html.html5parser.parse
374 lxml.html.parse
375 lxml.html.soupparser.parse
376 lxml.objectify.parse
377 lxml.tests.common_imports.HelperTestCase.parse" class="py-name" href="#" onclick="return doclink('link-72', 'parse', 'link-3');">parse</a></tt><tt class="py-op">,</tt> <tt id="link-73" class="py-name"><a title="lxml.etree._ElementTree.parser
378 lxml.tests.test_pyclasslookup.PyClassLookupTestCase.parser" class="py-name" href="#" onclick="return doclink('link-73', 'parser', 'link-29');">parser</a></tt><tt class="py-op">=</tt><tt id="link-74" class="py-name"><a title="lxml.etree._ElementTree.parser
379 lxml.tests.test_pyclasslookup.PyClassLookupTestCase.parser" class="py-name" href="#" onclick="return doclink('link-74', 'parser', 'link-29');">parser</a></tt><tt class="py-op">)</tt> </tt>
380 <a name="L185"></a><tt class="py-lineno">185</tt>  <tt class="py-line">                <tt class="py-keyword">if</tt> <tt class="py-name">node</tt> <tt class="py-keyword">is</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> </tt>
381 <a name="L186"></a><tt class="py-lineno">186</tt>  <tt class="py-line">                    <tt class="py-keyword">raise</tt> <tt id="link-75" class="py-name"><a title="lxml.ElementInclude.FatalIncludeError" class="py-name" href="#" onclick="return doclink('link-75', 'FatalIncludeError', 'link-70');">FatalIncludeError</a></tt><tt class="py-op">(</tt> </tt>
382 <a name="L187"></a><tt class="py-lineno">187</tt>  <tt class="py-line">                        <tt class="py-string">"cannot load %r as %r"</tt> <tt class="py-op">%</tt> <tt class="py-op">(</tt><tt class="py-name">href</tt><tt class="py-op">,</tt> <tt id="link-76" class="py-name"><a title="lxml.cssselect.parse
383 lxml.etree._ElementTree.parse
384 lxml.etree.parse
385 lxml.html.ElementSoup.parse
386 lxml.html.html5parser.parse
387 lxml.html.parse
388 lxml.html.soupparser.parse
389 lxml.objectify.parse
390 lxml.tests.common_imports.HelperTestCase.parse" class="py-name" href="#" onclick="return doclink('link-76', 'parse', 'link-3');">parse</a></tt><tt class="py-op">)</tt> </tt>
391 <a name="L188"></a><tt class="py-lineno">188</tt>  <tt class="py-line">                        <tt class="py-op">)</tt> </tt>
392 <a name="L189"></a><tt class="py-lineno">189</tt>  <tt class="py-line">                <tt class="py-name">node</tt> <tt class="py-op">=</tt> <tt id="link-77" class="py-name"><a title="lxml.ElementInclude._include
393 lxml.isoschematron.Schematron._include" class="py-name" href="#" onclick="return doclink('link-77', '_include', 'link-52');">_include</a></tt><tt class="py-op">(</tt><tt class="py-name">node</tt><tt class="py-op">,</tt> <tt class="py-name">loader</tt><tt class="py-op">,</tt> <tt class="py-name">_parent_hrefs</tt><tt class="py-op">)</tt> </tt>
394 <a name="L190"></a><tt class="py-lineno">190</tt>  <tt class="py-line">                <tt class="py-keyword">if</tt> <tt class="py-name">e</tt><tt class="py-op">.</tt><tt id="link-78" class="py-name" targets="Variable lxml.etree._Element.tail=lxml.etree._Element-class.html#tail,Variable lxml.etree._ReadOnlyProxy.tail=lxml.etree._ReadOnlyProxy-class.html#tail,Variable xml.etree.ElementTree.Element.tail=xml.etree.ElementTree.Element-class.html#tail"><a title="lxml.etree._Element.tail
395 lxml.etree._ReadOnlyProxy.tail
396 xml.etree.ElementTree.Element.tail" class="py-name" href="#" onclick="return doclink('link-78', 'tail', 'link-78');">tail</a></tt><tt class="py-op">:</tt> </tt>
397 <a name="L191"></a><tt class="py-lineno">191</tt>  <tt class="py-line">                    <tt class="py-name">node</tt><tt class="py-op">.</tt><tt id="link-79" class="py-name"><a title="lxml.etree._Element.tail
398 lxml.etree._ReadOnlyProxy.tail
399 xml.etree.ElementTree.Element.tail" class="py-name" href="#" onclick="return doclink('link-79', 'tail', 'link-78');">tail</a></tt> <tt class="py-op">=</tt> <tt class="py-op">(</tt><tt class="py-name">node</tt><tt class="py-op">.</tt><tt id="link-80" class="py-name"><a title="lxml.etree._Element.tail
400 lxml.etree._ReadOnlyProxy.tail
401 xml.etree.ElementTree.Element.tail" class="py-name" href="#" onclick="return doclink('link-80', 'tail', 'link-78');">tail</a></tt> <tt class="py-keyword">or</tt> <tt class="py-string">""</tt><tt class="py-op">)</tt> <tt class="py-op">+</tt> <tt class="py-name">e</tt><tt class="py-op">.</tt><tt id="link-81" class="py-name"><a title="lxml.etree._Element.tail
402 lxml.etree._ReadOnlyProxy.tail
403 xml.etree.ElementTree.Element.tail" class="py-name" href="#" onclick="return doclink('link-81', 'tail', 'link-78');">tail</a></tt> </tt>
404 <a name="L192"></a><tt class="py-lineno">192</tt>  <tt class="py-line">                <tt class="py-keyword">if</tt> <tt class="py-name">parent</tt> <tt class="py-keyword">is</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> </tt>
405 <a name="L193"></a><tt class="py-lineno">193</tt>  <tt class="py-line">                    <tt class="py-keyword">return</tt> <tt class="py-name">node</tt> <tt class="py-comment"># replaced the root node!</tt> </tt>
406 <a name="L194"></a><tt class="py-lineno">194</tt>  <tt class="py-line">                <tt class="py-name">parent</tt><tt class="py-op">.</tt><tt id="link-82" class="py-name" targets="Method lxml.etree._Element.replace()=lxml.etree._Element-class.html#replace,Method lxml.etree._ExsltRegExp.replace()=lxml.etree._ExsltRegExp-class.html#replace"><a title="lxml.etree._Element.replace
407 lxml.etree._ExsltRegExp.replace" class="py-name" href="#" onclick="return doclink('link-82', 'replace', 'link-82');">replace</a></tt><tt class="py-op">(</tt><tt class="py-name">e</tt><tt class="py-op">,</tt> <tt class="py-name">node</tt><tt class="py-op">)</tt> </tt>
408 <a name="L195"></a><tt class="py-lineno">195</tt>  <tt class="py-line">            <tt class="py-keyword">elif</tt> <tt id="link-83" class="py-name"><a title="lxml.cssselect.parse
409 lxml.etree._ElementTree.parse
410 lxml.etree.parse
411 lxml.html.ElementSoup.parse
412 lxml.html.html5parser.parse
413 lxml.html.parse
414 lxml.html.soupparser.parse
415 lxml.objectify.parse
416 lxml.tests.common_imports.HelperTestCase.parse" class="py-name" href="#" onclick="return doclink('link-83', 'parse', 'link-3');">parse</a></tt> <tt class="py-op">==</tt> <tt class="py-string">"text"</tt><tt class="py-op">:</tt> </tt>
417 <a name="L196"></a><tt class="py-lineno">196</tt>  <tt class="py-line">                <tt id="link-84" class="py-name" targets="Variable lxml.etree.QName.text=lxml.etree.QName-class.html#text,Variable lxml.etree._AppendOnlyElementProxy.text=lxml.etree._AppendOnlyElementProxy-class.html#text,Variable lxml.etree._Element.text=lxml.etree._Element-class.html#text,Variable lxml.etree._Entity.text=lxml.etree._Entity-class.html#text,Variable lxml.etree._ModifyContentOnlyProxy.text=lxml.etree._ModifyContentOnlyProxy-class.html#text,Variable lxml.etree._ReadOnlyEntityProxy.text=lxml.etree._ReadOnlyEntityProxy-class.html#text,Variable lxml.etree._ReadOnlyProxy.text=lxml.etree._ReadOnlyProxy-class.html#text,Variable lxml.etree.__ContentOnlyElement.text=lxml.etree.__ContentOnlyElement-class.html#text,Variable lxml.objectify.ObjectifiedElement.text=lxml.objectify.ObjectifiedElement-class.html#text,Variable xml.etree.ElementTree.Element.text=xml.etree.ElementTree.Element-class.html#text"><a title="lxml.etree.QName.text
418 lxml.etree._AppendOnlyElementProxy.text
419 lxml.etree._Element.text
420 lxml.etree._Entity.text
421 lxml.etree._ModifyContentOnlyProxy.text
422 lxml.etree._ReadOnlyEntityProxy.text
423 lxml.etree._ReadOnlyProxy.text
424 lxml.etree.__ContentOnlyElement.text
425 lxml.objectify.ObjectifiedElement.text
426 xml.etree.ElementTree.Element.text" class="py-name" href="#" onclick="return doclink('link-84', 'text', 'link-84');">text</a></tt> <tt class="py-op">=</tt> <tt class="py-name">load_include</tt><tt class="py-op">(</tt><tt class="py-name">href</tt><tt class="py-op">,</tt> <tt id="link-85" class="py-name"><a title="lxml.cssselect.parse
427 lxml.etree._ElementTree.parse
428 lxml.etree.parse
429 lxml.html.ElementSoup.parse
430 lxml.html.html5parser.parse
431 lxml.html.parse
432 lxml.html.soupparser.parse
433 lxml.objectify.parse
434 lxml.tests.common_imports.HelperTestCase.parse" class="py-name" href="#" onclick="return doclink('link-85', 'parse', 'link-3');">parse</a></tt><tt class="py-op">,</tt> <tt id="link-86" class="py-name"><a title="lxml.etree.DocInfo.encoding" class="py-name" href="#" onclick="return doclink('link-86', 'encoding', 'link-18');">encoding</a></tt><tt class="py-op">=</tt><tt class="py-name">e</tt><tt class="py-op">.</tt><tt id="link-87" class="py-name"><a title="lxml.etree._Attrib.get
435 lxml.etree._Element.get
436 lxml.etree._IDDict.get
437 lxml.etree._ProcessingInstruction.get
438 lxml.etree._ReadOnlyElementProxy.get
439 lxml.etree.__ContentOnlyElement.get" class="py-name" href="#" onclick="return doclink('link-87', 'get', 'link-65');">get</a></tt><tt class="py-op">(</tt><tt class="py-string">"encoding"</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
440 <a name="L197"></a><tt class="py-lineno">197</tt>  <tt class="py-line">                <tt class="py-keyword">if</tt> <tt id="link-88" class="py-name"><a title="lxml.etree.QName.text
441 lxml.etree._AppendOnlyElementProxy.text
442 lxml.etree._Element.text
443 lxml.etree._Entity.text
444 lxml.etree._ModifyContentOnlyProxy.text
445 lxml.etree._ReadOnlyEntityProxy.text
446 lxml.etree._ReadOnlyProxy.text
447 lxml.etree.__ContentOnlyElement.text
448 lxml.objectify.ObjectifiedElement.text
449 xml.etree.ElementTree.Element.text" class="py-name" href="#" onclick="return doclink('link-88', 'text', 'link-84');">text</a></tt> <tt class="py-keyword">is</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> </tt>
450 <a name="L198"></a><tt class="py-lineno">198</tt>  <tt class="py-line">                    <tt class="py-keyword">raise</tt> <tt id="link-89" class="py-name"><a title="lxml.ElementInclude.FatalIncludeError" class="py-name" href="#" onclick="return doclink('link-89', 'FatalIncludeError', 'link-70');">FatalIncludeError</a></tt><tt class="py-op">(</tt> </tt>
451 <a name="L199"></a><tt class="py-lineno">199</tt>  <tt class="py-line">                        <tt class="py-string">"cannot load %r as %r"</tt> <tt class="py-op">%</tt> <tt class="py-op">(</tt><tt class="py-name">href</tt><tt class="py-op">,</tt> <tt id="link-90" class="py-name"><a title="lxml.cssselect.parse
452 lxml.etree._ElementTree.parse
453 lxml.etree.parse
454 lxml.html.ElementSoup.parse
455 lxml.html.html5parser.parse
456 lxml.html.parse
457 lxml.html.soupparser.parse
458 lxml.objectify.parse
459 lxml.tests.common_imports.HelperTestCase.parse" class="py-name" href="#" onclick="return doclink('link-90', 'parse', 'link-3');">parse</a></tt><tt class="py-op">)</tt> </tt>
460 <a name="L200"></a><tt class="py-lineno">200</tt>  <tt class="py-line">                        <tt class="py-op">)</tt> </tt>
461 <a name="L201"></a><tt class="py-lineno">201</tt>  <tt class="py-line">                <tt class="py-name">predecessor</tt> <tt class="py-op">=</tt> <tt class="py-name">e</tt><tt class="py-op">.</tt><tt id="link-91" class="py-name" targets="Method lxml.etree._Element.getprevious()=lxml.etree._Element-class.html#getprevious,Method lxml.etree._ReadOnlyProxy.getprevious()=lxml.etree._ReadOnlyProxy-class.html#getprevious"><a title="lxml.etree._Element.getprevious
462 lxml.etree._ReadOnlyProxy.getprevious" class="py-name" href="#" onclick="return doclink('link-91', 'getprevious', 'link-91');">getprevious</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
463 <a name="L202"></a><tt class="py-lineno">202</tt>  <tt class="py-line">                <tt class="py-keyword">if</tt> <tt class="py-name">predecessor</tt> <tt class="py-keyword">is</tt> <tt class="py-keyword">not</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> </tt>
464 <a name="L203"></a><tt class="py-lineno">203</tt>  <tt class="py-line">                    <tt class="py-name">predecessor</tt><tt class="py-op">.</tt><tt id="link-92" class="py-name"><a title="lxml.etree._Element.tail
465 lxml.etree._ReadOnlyProxy.tail
466 xml.etree.ElementTree.Element.tail" class="py-name" href="#" onclick="return doclink('link-92', 'tail', 'link-78');">tail</a></tt> <tt class="py-op">=</tt> <tt class="py-op">(</tt><tt class="py-name">predecessor</tt><tt class="py-op">.</tt><tt id="link-93" class="py-name"><a title="lxml.etree._Element.tail
467 lxml.etree._ReadOnlyProxy.tail
468 xml.etree.ElementTree.Element.tail" class="py-name" href="#" onclick="return doclink('link-93', 'tail', 'link-78');">tail</a></tt> <tt class="py-keyword">or</tt> <tt class="py-string">""</tt><tt class="py-op">)</tt> <tt class="py-op">+</tt> <tt id="link-94" class="py-name"><a title="lxml.etree.QName.text
469 lxml.etree._AppendOnlyElementProxy.text
470 lxml.etree._Element.text
471 lxml.etree._Entity.text
472 lxml.etree._ModifyContentOnlyProxy.text
473 lxml.etree._ReadOnlyEntityProxy.text
474 lxml.etree._ReadOnlyProxy.text
475 lxml.etree.__ContentOnlyElement.text
476 lxml.objectify.ObjectifiedElement.text
477 xml.etree.ElementTree.Element.text" class="py-name" href="#" onclick="return doclink('link-94', 'text', 'link-84');">text</a></tt> </tt>
478 <a name="L204"></a><tt class="py-lineno">204</tt>  <tt class="py-line">                <tt class="py-keyword">elif</tt> <tt class="py-name">parent</tt> <tt class="py-keyword">is</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> </tt>
479 <a name="L205"></a><tt class="py-lineno">205</tt>  <tt class="py-line">                    <tt class="py-keyword">return</tt> <tt id="link-95" class="py-name"><a title="lxml.etree.QName.text
480 lxml.etree._AppendOnlyElementProxy.text
481 lxml.etree._Element.text
482 lxml.etree._Entity.text
483 lxml.etree._ModifyContentOnlyProxy.text
484 lxml.etree._ReadOnlyEntityProxy.text
485 lxml.etree._ReadOnlyProxy.text
486 lxml.etree.__ContentOnlyElement.text
487 lxml.objectify.ObjectifiedElement.text
488 xml.etree.ElementTree.Element.text" class="py-name" href="#" onclick="return doclink('link-95', 'text', 'link-84');">text</a></tt> <tt class="py-comment"># replaced the root node!</tt> </tt>
489 <a name="L206"></a><tt class="py-lineno">206</tt>  <tt class="py-line">                <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
490 <a name="L207"></a><tt class="py-lineno">207</tt>  <tt class="py-line">                    <tt class="py-name">parent</tt><tt class="py-op">.</tt><tt id="link-96" class="py-name"><a title="lxml.etree.QName.text
491 lxml.etree._AppendOnlyElementProxy.text
492 lxml.etree._Element.text
493 lxml.etree._Entity.text
494 lxml.etree._ModifyContentOnlyProxy.text
495 lxml.etree._ReadOnlyEntityProxy.text
496 lxml.etree._ReadOnlyProxy.text
497 lxml.etree.__ContentOnlyElement.text
498 lxml.objectify.ObjectifiedElement.text
499 xml.etree.ElementTree.Element.text" class="py-name" href="#" onclick="return doclink('link-96', 'text', 'link-84');">text</a></tt> <tt class="py-op">=</tt> <tt class="py-op">(</tt><tt class="py-name">parent</tt><tt class="py-op">.</tt><tt id="link-97" class="py-name"><a title="lxml.etree.QName.text
500 lxml.etree._AppendOnlyElementProxy.text
501 lxml.etree._Element.text
502 lxml.etree._Entity.text
503 lxml.etree._ModifyContentOnlyProxy.text
504 lxml.etree._ReadOnlyEntityProxy.text
505 lxml.etree._ReadOnlyProxy.text
506 lxml.etree.__ContentOnlyElement.text
507 lxml.objectify.ObjectifiedElement.text
508 xml.etree.ElementTree.Element.text" class="py-name" href="#" onclick="return doclink('link-97', 'text', 'link-84');">text</a></tt> <tt class="py-keyword">or</tt> <tt class="py-string">""</tt><tt class="py-op">)</tt> <tt class="py-op">+</tt> <tt id="link-98" class="py-name"><a title="lxml.etree.QName.text
509 lxml.etree._AppendOnlyElementProxy.text
510 lxml.etree._Element.text
511 lxml.etree._Entity.text
512 lxml.etree._ModifyContentOnlyProxy.text
513 lxml.etree._ReadOnlyEntityProxy.text
514 lxml.etree._ReadOnlyProxy.text
515 lxml.etree.__ContentOnlyElement.text
516 lxml.objectify.ObjectifiedElement.text
517 xml.etree.ElementTree.Element.text" class="py-name" href="#" onclick="return doclink('link-98', 'text', 'link-84');">text</a></tt> <tt class="py-op">+</tt> <tt class="py-op">(</tt><tt class="py-name">e</tt><tt class="py-op">.</tt><tt id="link-99" class="py-name"><a title="lxml.etree._Element.tail
518 lxml.etree._ReadOnlyProxy.tail
519 xml.etree.ElementTree.Element.tail" class="py-name" href="#" onclick="return doclink('link-99', 'tail', 'link-78');">tail</a></tt> <tt class="py-keyword">or</tt> <tt class="py-string">""</tt><tt class="py-op">)</tt> </tt>
520 <a name="L208"></a><tt class="py-lineno">208</tt>  <tt class="py-line">                <tt class="py-name">parent</tt><tt class="py-op">.</tt><tt id="link-100" class="py-name" targets="Method lxml.etree._Element.remove()=lxml.etree._Element-class.html#remove,Method lxml.etree._ResolverRegistry.remove()=lxml.etree._ResolverRegistry-class.html#remove,Method lxml.html.CheckboxValues.remove()=lxml.html.CheckboxValues-class.html#remove,Method lxml.html.MultipleSelectOptions.remove()=lxml.html.MultipleSelectOptions-class.html#remove"><a title="lxml.etree._Element.remove
521 lxml.etree._ResolverRegistry.remove
522 lxml.html.CheckboxValues.remove
523 lxml.html.MultipleSelectOptions.remove" class="py-name" href="#" onclick="return doclink('link-100', 'remove', 'link-100');">remove</a></tt><tt class="py-op">(</tt><tt class="py-name">e</tt><tt class="py-op">)</tt> </tt>
524 <a name="L209"></a><tt class="py-lineno">209</tt>  <tt class="py-line">            <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
525 <a name="L210"></a><tt class="py-lineno">210</tt>  <tt class="py-line">                <tt class="py-keyword">raise</tt> <tt id="link-101" class="py-name"><a title="lxml.ElementInclude.FatalIncludeError" class="py-name" href="#" onclick="return doclink('link-101', 'FatalIncludeError', 'link-70');">FatalIncludeError</a></tt><tt class="py-op">(</tt> </tt>
526 <a name="L211"></a><tt class="py-lineno">211</tt>  <tt class="py-line">                    <tt class="py-string">"unknown parse type in xi:include tag (%r)"</tt> <tt class="py-op">%</tt> <tt id="link-102" class="py-name"><a title="lxml.cssselect.parse
527 lxml.etree._ElementTree.parse
528 lxml.etree.parse
529 lxml.html.ElementSoup.parse
530 lxml.html.html5parser.parse
531 lxml.html.parse
532 lxml.html.soupparser.parse
533 lxml.objectify.parse
534 lxml.tests.common_imports.HelperTestCase.parse" class="py-name" href="#" onclick="return doclink('link-102', 'parse', 'link-3');">parse</a></tt> </tt>
535 <a name="L212"></a><tt class="py-lineno">212</tt>  <tt class="py-line">                <tt class="py-op">)</tt> </tt>
536 <a name="L213"></a><tt class="py-lineno">213</tt>  <tt class="py-line">        <tt class="py-keyword">elif</tt> <tt class="py-name">e</tt><tt class="py-op">.</tt><tt id="link-103" class="py-name"><a title="lxml.etree._Comment.tag
537 lxml.etree._Element.tag
538 lxml.etree._Entity.tag
539 lxml.etree._ProcessingInstruction.tag
540 lxml.etree._ReadOnlyProxy.tag
541 lxml.tests.test_xpathevaluator.tag
542 xml.etree.ElementTree.Element.tag" class="py-name" href="#" onclick="return doclink('link-103', 'tag', 'link-62');">tag</a></tt> <tt class="py-op">==</tt> <tt id="link-104" class="py-name"><a title="lxml.ElementInclude.XINCLUDE_FALLBACK" class="py-name" href="#" onclick="return doclink('link-104', 'XINCLUDE_FALLBACK', 'link-9');">XINCLUDE_FALLBACK</a></tt><tt class="py-op">:</tt> </tt>
543 <a name="L214"></a><tt class="py-lineno">214</tt>  <tt class="py-line">            <tt class="py-name">parent</tt> <tt class="py-op">=</tt> <tt class="py-name">e</tt><tt class="py-op">.</tt><tt id="link-105" class="py-name"><a title="lxml.etree._Element.getparent
544 lxml.etree._ElementStringResult.getparent
545 lxml.etree._ElementUnicodeResult.getparent
546 lxml.etree._ReadOnlyProxy.getparent" class="py-name" href="#" onclick="return doclink('link-105', 'getparent', 'link-68');">getparent</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
547 <a name="L215"></a><tt class="py-lineno">215</tt>  <tt class="py-line">            <tt class="py-keyword">if</tt> <tt class="py-name">parent</tt> <tt class="py-keyword">is</tt> <tt class="py-keyword">not</tt> <tt class="py-name">None</tt> <tt class="py-keyword">and</tt> <tt class="py-name">parent</tt><tt class="py-op">.</tt><tt id="link-106" class="py-name"><a title="lxml.etree._Comment.tag
548 lxml.etree._Element.tag
549 lxml.etree._Entity.tag
550 lxml.etree._ProcessingInstruction.tag
551 lxml.etree._ReadOnlyProxy.tag
552 lxml.tests.test_xpathevaluator.tag
553 xml.etree.ElementTree.Element.tag" class="py-name" href="#" onclick="return doclink('link-106', 'tag', 'link-62');">tag</a></tt> <tt class="py-op">!=</tt> <tt id="link-107" class="py-name"><a title="lxml.ElementInclude.XINCLUDE_INCLUDE" class="py-name" href="#" onclick="return doclink('link-107', 'XINCLUDE_INCLUDE', 'link-7');">XINCLUDE_INCLUDE</a></tt><tt class="py-op">:</tt> </tt>
554 <a name="L216"></a><tt class="py-lineno">216</tt>  <tt class="py-line">                <tt class="py-keyword">raise</tt> <tt id="link-108" class="py-name"><a title="lxml.ElementInclude.FatalIncludeError" class="py-name" href="#" onclick="return doclink('link-108', 'FatalIncludeError', 'link-70');">FatalIncludeError</a></tt><tt class="py-op">(</tt> </tt>
555 <a name="L217"></a><tt class="py-lineno">217</tt>  <tt class="py-line">                    <tt class="py-string">"xi:fallback tag must be child of xi:include (%r)"</tt> <tt class="py-op">%</tt> <tt class="py-name">e</tt><tt class="py-op">.</tt><tt id="link-109" class="py-name"><a title="lxml.etree._Comment.tag
556 lxml.etree._Element.tag
557 lxml.etree._Entity.tag
558 lxml.etree._ProcessingInstruction.tag
559 lxml.etree._ReadOnlyProxy.tag
560 lxml.tests.test_xpathevaluator.tag
561 xml.etree.ElementTree.Element.tag" class="py-name" href="#" onclick="return doclink('link-109', 'tag', 'link-62');">tag</a></tt> </tt>
562 <a name="L218"></a><tt class="py-lineno">218</tt>  <tt class="py-line">                    <tt class="py-op">)</tt> </tt>
563 <a name="L219"></a><tt class="py-lineno">219</tt>  <tt class="py-line">        <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
564 <a name="L220"></a><tt class="py-lineno">220</tt>  <tt class="py-line">            <tt class="py-keyword">raise</tt> <tt id="link-110" class="py-name"><a title="lxml.ElementInclude.FatalIncludeError" class="py-name" href="#" onclick="return doclink('link-110', 'FatalIncludeError', 'link-70');">FatalIncludeError</a></tt><tt class="py-op">(</tt> </tt>
565 <a name="L221"></a><tt class="py-lineno">221</tt>  <tt class="py-line">                <tt class="py-string">"Invalid element found in XInclude namespace (%r)"</tt> <tt class="py-op">%</tt> <tt class="py-name">e</tt><tt class="py-op">.</tt><tt id="link-111" class="py-name"><a title="lxml.etree._Comment.tag
566 lxml.etree._Element.tag
567 lxml.etree._Entity.tag
568 lxml.etree._ProcessingInstruction.tag
569 lxml.etree._ReadOnlyProxy.tag
570 lxml.tests.test_xpathevaluator.tag
571 xml.etree.ElementTree.Element.tag" class="py-name" href="#" onclick="return doclink('link-111', 'tag', 'link-62');">tag</a></tt> </tt>
572 <a name="L222"></a><tt class="py-lineno">222</tt>  <tt class="py-line">                <tt class="py-op">)</tt> </tt>
573 <a name="L223"></a><tt class="py-lineno">223</tt>  <tt class="py-line">    <tt class="py-keyword">return</tt> <tt class="py-name">elem</tt> </tt>
574 </div><a name="L224"></a><tt class="py-lineno">224</tt>  <tt class="py-line"> </tt><script type="text/javascript">
575 <!--
576 expandto(location.href);
577 // -->
578 </script>
579 </pre>
580 <br />
581 <!-- ==================== NAVIGATION BAR ==================== -->
582 <table class="navbar" border="0" width="100%" cellpadding="0"
583        bgcolor="#a0c0ff" cellspacing="0">
584   <tr valign="middle">
585   <!-- Home link -->
586       <th>&nbsp;&nbsp;&nbsp;<a
587         href="lxml-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>
588
589   <!-- Tree link -->
590       <th>&nbsp;&nbsp;&nbsp;<a
591         href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
592
593   <!-- Index link -->
594       <th>&nbsp;&nbsp;&nbsp;<a
595         href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>
596
597   <!-- Help link -->
598       <th>&nbsp;&nbsp;&nbsp;<a
599         href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
600
601   <!-- Project homepage -->
602       <th class="navbar" align="right" width="100%">
603         <table border="0" cellpadding="0" cellspacing="0">
604           <tr><th class="navbar" align="center"
605             ><a class="navbar" target="_top" href="/">lxml API</a></th>
606           </tr></table></th>
607   </tr>
608 </table>
609 <table border="0" cellpadding="0" cellspacing="0" width="100%%">
610   <tr>
611     <td align="left" class="footer">
612     Generated by Epydoc 3.0.1 on Tue Jul 31 10:14:23 2012
613     </td>
614     <td align="right" class="footer">
615       <a target="mainFrame" href="http://epydoc.sourceforge.net"
616         >http://epydoc.sourceforge.net</a>
617     </td>
618   </tr>
619 </table>
620
621 <script type="text/javascript">
622   <!--
623   // Private objects are initially displayed (because if
624   // javascript is turned off then we want them to be
625   // visible); but by default, we want to hide them.  So hide
626   // them unless we have a cookie that says to show them.
627   checkCookie();
628   // -->
629 </script>
630 </body>
631 </html>