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">
6 <title>lxml.tests.test_xpathevaluator</title>
7 <link rel="stylesheet" href="epydoc.css" type="text/css" />
8 <script type="text/javascript" src="epydoc.js"></script>
11 <body bgcolor="white" text="black" link="blue" vlink="#204080"
13 <!-- ==================== NAVIGATION BAR ==================== -->
14 <table class="navbar" border="0" width="100%" cellpadding="0"
15 bgcolor="#a0c0ff" cellspacing="0">
18 <th> <a
19 href="lxml-module.html">Home</a> </th>
22 <th> <a
23 href="module-tree.html">Trees</a> </th>
26 <th> <a
27 href="identifier-index.html">Indices</a> </th>
30 <th> <a
31 href="help.html">Help</a> </th>
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>
41 <table width="100%" cellpadding="0" cellspacing="0">
44 <span class="breadcrumbs">
45 <a href="lxml-module.html">Package lxml</a> ::
46 <a href="lxml.tests-module.html">Package tests</a> ::
47 Module test_xpathevaluator
51 <table cellpadding="0" cellspacing="0">
52 <!-- hide/show private -->
53 <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
54 onclick="toggle_private();">hide private</a>]</span></td></tr>
55 <tr><td align="right"><span class="options"
56 >[<a href="frames.html" target="_top">frames</a
57 >] | <a href="lxml.tests.test_xpathevaluator-pysrc.html"
58 target="_top">no frames</a>]</span></td></tr>
63 <h1 class="epydoc">Source Code for <a href="lxml.tests.test_xpathevaluator-module.html">Module lxml.tests.test_xpathevaluator</a></h1>
65 <a name="L1"></a><tt class="py-lineno"> 1</tt> <tt class="py-line"><tt class="py-comment"># -*- coding: utf-8 -*-</tt> </tt>
66 <a name="L2"></a><tt class="py-lineno"> 2</tt> <tt class="py-line"> </tt>
67 <a name="L3"></a><tt class="py-lineno"> 3</tt> <tt class="py-line"><tt class="py-docstring">"""</tt> </tt>
68 <a name="L4"></a><tt class="py-lineno"> 4</tt> <tt class="py-line"><tt class="py-docstring">Test cases related to XPath evaluation and the XPath class</tt> </tt>
69 <a name="L5"></a><tt class="py-lineno"> 5</tt> <tt class="py-line"><tt class="py-docstring">"""</tt> </tt>
70 <a name="L6"></a><tt class="py-lineno"> 6</tt> <tt class="py-line"> </tt>
71 <a name="L7"></a><tt class="py-lineno"> 7</tt> <tt class="py-line"><tt class="py-keyword">import</tt> <tt class="py-name">unittest</tt><tt class="py-op">,</tt> <tt class="py-name">sys</tt><tt class="py-op">,</tt> <tt class="py-name">os</tt><tt class="py-op">.</tt><tt id="link-0" class="py-name" targets="Variable lxml.etree.XPath.path=lxml.etree.XPath-class.html#path"><a title="lxml.etree.XPath.path" class="py-name" href="#" onclick="return doclink('link-0', 'path', 'link-0');">path</a></tt> </tt>
72 <a name="L8"></a><tt class="py-lineno"> 8</tt> <tt class="py-line"> </tt>
73 <a name="L9"></a><tt class="py-lineno"> 9</tt> <tt class="py-line"><tt id="link-1" class="py-name" targets="Variable lxml.tests.test_classlookup.this_dir=lxml.tests.test_classlookup-module.html#this_dir,Variable lxml.tests.test_dtd.this_dir=lxml.tests.test_dtd-module.html#this_dir,Variable lxml.tests.test_elementtree.this_dir=lxml.tests.test_elementtree-module.html#this_dir,Variable lxml.tests.test_errors.this_dir=lxml.tests.test_errors-module.html#this_dir,Variable lxml.tests.test_etree.this_dir=lxml.tests.test_etree-module.html#this_dir,Variable lxml.tests.test_htmlparser.this_dir=lxml.tests.test_htmlparser-module.html#this_dir,Variable lxml.tests.test_io.this_dir=lxml.tests.test_io-module.html#this_dir,Variable lxml.tests.test_isoschematron.this_dir=lxml.tests.test_isoschematron-module.html#this_dir,Variable lxml.tests.test_nsclasses.this_dir=lxml.tests.test_nsclasses-module.html#this_dir,Variable lxml.tests.test_objectify.this_dir=lxml.tests.test_objectify-module.html#this_dir,Variable lxml.tests.test_pyclasslookup.this_dir=lxml.tests.test_pyclasslookup-module.html#this_dir,Variable lxml.tests.test_relaxng.this_dir=lxml.tests.test_relaxng-module.html#this_dir,Variable lxml.tests.test_sax.this_dir=lxml.tests.test_sax-module.html#this_dir,Variable lxml.tests.test_schematron.this_dir=lxml.tests.test_schematron-module.html#this_dir,Variable lxml.tests.test_threading.this_dir=lxml.tests.test_threading-module.html#this_dir,Variable lxml.tests.test_unicode.this_dir=lxml.tests.test_unicode-module.html#this_dir,Variable lxml.tests.test_xmlschema.this_dir=lxml.tests.test_xmlschema-module.html#this_dir,Variable lxml.tests.test_xpathevaluator.this_dir=lxml.tests.test_xpathevaluator-module.html#this_dir,Variable lxml.tests.test_xslt.this_dir=lxml.tests.test_xslt-module.html#this_dir"><a title="lxml.tests.test_classlookup.this_dir
74 lxml.tests.test_dtd.this_dir
75 lxml.tests.test_elementtree.this_dir
76 lxml.tests.test_errors.this_dir
77 lxml.tests.test_etree.this_dir
78 lxml.tests.test_htmlparser.this_dir
79 lxml.tests.test_io.this_dir
80 lxml.tests.test_isoschematron.this_dir
81 lxml.tests.test_nsclasses.this_dir
82 lxml.tests.test_objectify.this_dir
83 lxml.tests.test_pyclasslookup.this_dir
84 lxml.tests.test_relaxng.this_dir
85 lxml.tests.test_sax.this_dir
86 lxml.tests.test_schematron.this_dir
87 lxml.tests.test_threading.this_dir
88 lxml.tests.test_unicode.this_dir
89 lxml.tests.test_xmlschema.this_dir
90 lxml.tests.test_xpathevaluator.this_dir
91 lxml.tests.test_xslt.this_dir" class="py-name" href="#" onclick="return doclink('link-1', 'this_dir', 'link-1');">this_dir</a></tt> <tt class="py-op">=</tt> <tt class="py-name">os</tt><tt class="py-op">.</tt><tt id="link-2" class="py-name"><a title="lxml.etree.XPath.path" class="py-name" href="#" onclick="return doclink('link-2', 'path', 'link-0');">path</a></tt><tt class="py-op">.</tt><tt class="py-name">dirname</tt><tt class="py-op">(</tt><tt class="py-name">__file__</tt><tt class="py-op">)</tt> </tt>
92 <a name="L10"></a><tt class="py-lineno"> 10</tt> <tt class="py-line"><tt class="py-keyword">if</tt> <tt id="link-3" class="py-name"><a title="lxml.tests.test_classlookup.this_dir
93 lxml.tests.test_dtd.this_dir
94 lxml.tests.test_elementtree.this_dir
95 lxml.tests.test_errors.this_dir
96 lxml.tests.test_etree.this_dir
97 lxml.tests.test_htmlparser.this_dir
98 lxml.tests.test_io.this_dir
99 lxml.tests.test_isoschematron.this_dir
100 lxml.tests.test_nsclasses.this_dir
101 lxml.tests.test_objectify.this_dir
102 lxml.tests.test_pyclasslookup.this_dir
103 lxml.tests.test_relaxng.this_dir
104 lxml.tests.test_sax.this_dir
105 lxml.tests.test_schematron.this_dir
106 lxml.tests.test_threading.this_dir
107 lxml.tests.test_unicode.this_dir
108 lxml.tests.test_xmlschema.this_dir
109 lxml.tests.test_xpathevaluator.this_dir
110 lxml.tests.test_xslt.this_dir" class="py-name" href="#" onclick="return doclink('link-3', 'this_dir', 'link-1');">this_dir</a></tt> <tt class="py-keyword">not</tt> <tt class="py-keyword">in</tt> <tt class="py-name">sys</tt><tt class="py-op">.</tt><tt id="link-4" class="py-name"><a title="lxml.etree.XPath.path" class="py-name" href="#" onclick="return doclink('link-4', 'path', 'link-0');">path</a></tt><tt class="py-op">:</tt> </tt>
111 <a name="L11"></a><tt class="py-lineno"> 11</tt> <tt class="py-line"> <tt class="py-name">sys</tt><tt class="py-op">.</tt><tt id="link-5" class="py-name"><a title="lxml.etree.XPath.path" class="py-name" href="#" onclick="return doclink('link-5', 'path', 'link-0');">path</a></tt><tt class="py-op">.</tt><tt id="link-6" class="py-name" targets="Method lxml.etree._Element.insert()=lxml.etree._Element-class.html#insert,Method lxml.etree.__ContentOnlyElement.insert()=lxml.etree.__ContentOnlyElement-class.html#insert"><a title="lxml.etree._Element.insert
112 lxml.etree.__ContentOnlyElement.insert" class="py-name" href="#" onclick="return doclink('link-6', 'insert', 'link-6');">insert</a></tt><tt class="py-op">(</tt><tt class="py-number">0</tt><tt class="py-op">,</tt> <tt id="link-7" class="py-name"><a title="lxml.tests.test_classlookup.this_dir
113 lxml.tests.test_dtd.this_dir
114 lxml.tests.test_elementtree.this_dir
115 lxml.tests.test_errors.this_dir
116 lxml.tests.test_etree.this_dir
117 lxml.tests.test_htmlparser.this_dir
118 lxml.tests.test_io.this_dir
119 lxml.tests.test_isoschematron.this_dir
120 lxml.tests.test_nsclasses.this_dir
121 lxml.tests.test_objectify.this_dir
122 lxml.tests.test_pyclasslookup.this_dir
123 lxml.tests.test_relaxng.this_dir
124 lxml.tests.test_sax.this_dir
125 lxml.tests.test_schematron.this_dir
126 lxml.tests.test_threading.this_dir
127 lxml.tests.test_unicode.this_dir
128 lxml.tests.test_xmlschema.this_dir
129 lxml.tests.test_xpathevaluator.this_dir
130 lxml.tests.test_xslt.this_dir" class="py-name" href="#" onclick="return doclink('link-7', 'this_dir', 'link-1');">this_dir</a></tt><tt class="py-op">)</tt> <tt class="py-comment"># needed for Py3</tt> </tt>
131 <a name="L12"></a><tt class="py-lineno"> 12</tt> <tt class="py-line"> </tt>
132 <a name="L13"></a><tt class="py-lineno"> 13</tt> <tt class="py-line"><tt class="py-keyword">from</tt> <tt id="link-8" class="py-name" targets="Module lxml.tests.common_imports=lxml.tests.common_imports-module.html"><a title="lxml.tests.common_imports" class="py-name" href="#" onclick="return doclink('link-8', 'common_imports', 'link-8');">common_imports</a></tt> <tt class="py-keyword">import</tt> <tt id="link-9" 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
133 lxml.sax.ElementTreeContentHandler.etree
134 lxml.tests.test_elementtree.CElementTreeTestCase.etree
135 lxml.tests.test_elementtree.ETreeTestCaseBase.etree
136 lxml.tests.test_io.IOTestCaseBase.etree" class="py-name" href="#" onclick="return doclink('link-9', 'etree', 'link-9');">etree</a></tt><tt class="py-op">,</tt> <tt id="link-10" class="py-name" targets="Class lxml.tests.common_imports.HelperTestCase=lxml.tests.common_imports.HelperTestCase-class.html"><a title="lxml.tests.common_imports.HelperTestCase" class="py-name" href="#" onclick="return doclink('link-10', 'HelperTestCase', 'link-10');">HelperTestCase</a></tt><tt class="py-op">,</tt> <tt id="link-11" class="py-name" targets="Function lxml.tests.common_imports._bytes()=lxml.tests.common_imports-module.html#_bytes"><a title="lxml.tests.common_imports._bytes" class="py-name" href="#" onclick="return doclink('link-11', '_bytes', 'link-11');">_bytes</a></tt><tt class="py-op">,</tt> <tt class="py-name">BytesIO</tt> </tt>
137 <a name="L14"></a><tt class="py-lineno"> 14</tt> <tt class="py-line"><tt class="py-keyword">from</tt> <tt id="link-12" class="py-name"><a title="lxml.tests.common_imports" class="py-name" href="#" onclick="return doclink('link-12', 'common_imports', 'link-8');">common_imports</a></tt> <tt class="py-keyword">import</tt> <tt class="py-name">doctest</tt><tt class="py-op">,</tt> <tt id="link-13" class="py-name" targets="Function lxml.tests.common_imports.make_doctest()=lxml.tests.common_imports-module.html#make_doctest"><a title="lxml.tests.common_imports.make_doctest" class="py-name" href="#" onclick="return doclink('link-13', 'make_doctest', 'link-13');">make_doctest</a></tt> </tt>
138 <a name="L15"></a><tt class="py-lineno"> 15</tt> <tt class="py-line"> </tt>
139 <a name="ETreeXPathTestCase"></a><div id="ETreeXPathTestCase-def"><a name="L16"></a><tt class="py-lineno"> 16</tt> <a class="py-toggle" href="#" id="ETreeXPathTestCase-toggle" onclick="return toggle('ETreeXPathTestCase');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="lxml.tests.test_xpathevaluator.ETreeXPathTestCase-class.html">ETreeXPathTestCase</a><tt class="py-op">(</tt><tt class="py-base-class">HelperTestCase</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
140 </div><div id="ETreeXPathTestCase-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="ETreeXPathTestCase-expanded"><a name="L17"></a><tt class="py-lineno"> 17</tt> <tt class="py-line"> <tt class="py-docstring">"""XPath tests etree"""</tt> </tt>
141 <a name="L18"></a><tt class="py-lineno"> 18</tt> <tt class="py-line"> </tt>
142 <a name="ETreeXPathTestCase.test_xpath_boolean"></a><div id="ETreeXPathTestCase.test_xpath_boolean-def"><a name="L19"></a><tt class="py-lineno"> 19</tt> <a class="py-toggle" href="#" id="ETreeXPathTestCase.test_xpath_boolean-toggle" onclick="return toggle('ETreeXPathTestCase.test_xpath_boolean');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="lxml.tests.test_xpathevaluator.ETreeXPathTestCase-class.html#test_xpath_boolean">test_xpath_boolean</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
143 </div><div id="ETreeXPathTestCase.test_xpath_boolean-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="ETreeXPathTestCase.test_xpath_boolean-expanded"><a name="L20"></a><tt class="py-lineno"> 20</tt> <tt class="py-line"> <tt class="py-name">tree</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-14" 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
144 lxml.etree._ElementTree.parse
146 lxml.html.ElementSoup.parse
147 lxml.html.html5parser.parse
149 lxml.html.soupparser.parse
151 lxml.tests.common_imports.HelperTestCase.parse" class="py-name" href="#" onclick="return doclink('link-14', 'parse', 'link-14');">parse</a></tt><tt class="py-op">(</tt><tt class="py-string">'<a><b></b><b></b></a>'</tt><tt class="py-op">)</tt> </tt>
152 <a name="L21"></a><tt class="py-lineno"> 21</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-15" class="py-name" targets="Method lxml.etree._Validator.assert_()=lxml.etree._Validator-class.html#assert_"><a title="lxml.etree._Validator.assert_" class="py-name" href="#" onclick="return doclink('link-15', 'assert_', 'link-15');">assert_</a></tt><tt class="py-op">(</tt><tt class="py-name">tree</tt><tt class="py-op">.</tt><tt id="link-16" class="py-name" targets="Method lxml.cssselect.Attrib.xpath()=lxml.cssselect.Attrib-class.html#xpath,Method lxml.cssselect.Class.xpath()=lxml.cssselect.Class-class.html#xpath,Method lxml.cssselect.CombinedSelector.xpath()=lxml.cssselect.CombinedSelector-class.html#xpath,Method lxml.cssselect.Element.xpath()=lxml.cssselect.Element-class.html#xpath,Method lxml.cssselect.Function.xpath()=lxml.cssselect.Function-class.html#xpath,Method lxml.cssselect.Hash.xpath()=lxml.cssselect.Hash-class.html#xpath,Method lxml.cssselect.Or.xpath()=lxml.cssselect.Or-class.html#xpath,Method lxml.cssselect.Pseudo.xpath()=lxml.cssselect.Pseudo-class.html#xpath,Method lxml.etree._Element.xpath()=lxml.etree._Element-class.html#xpath,Method lxml.etree._ElementTree.xpath()=lxml.etree._ElementTree-class.html#xpath,Function lxml.tests.test_xpathevaluator.xpath()=lxml.tests.test_xpathevaluator-module.html#xpath"><a title="lxml.cssselect.Attrib.xpath
153 lxml.cssselect.Class.xpath
154 lxml.cssselect.CombinedSelector.xpath
155 lxml.cssselect.Element.xpath
156 lxml.cssselect.Function.xpath
157 lxml.cssselect.Hash.xpath
158 lxml.cssselect.Or.xpath
159 lxml.cssselect.Pseudo.xpath
160 lxml.etree._Element.xpath
161 lxml.etree._ElementTree.xpath
162 lxml.tests.test_xpathevaluator.xpath" class="py-name" href="#" onclick="return doclink('link-16', 'xpath', 'link-16');">xpath</a></tt><tt class="py-op">(</tt><tt class="py-string">'boolean(/a/b)'</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
163 <a name="L22"></a><tt class="py-lineno"> 22</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-17" class="py-name"><a title="lxml.etree._Validator.assert_" class="py-name" href="#" onclick="return doclink('link-17', 'assert_', 'link-15');">assert_</a></tt><tt class="py-op">(</tt><tt class="py-keyword">not</tt> <tt class="py-name">tree</tt><tt class="py-op">.</tt><tt id="link-18" class="py-name"><a title="lxml.cssselect.Attrib.xpath
164 lxml.cssselect.Class.xpath
165 lxml.cssselect.CombinedSelector.xpath
166 lxml.cssselect.Element.xpath
167 lxml.cssselect.Function.xpath
168 lxml.cssselect.Hash.xpath
169 lxml.cssselect.Or.xpath
170 lxml.cssselect.Pseudo.xpath
171 lxml.etree._Element.xpath
172 lxml.etree._ElementTree.xpath
173 lxml.tests.test_xpathevaluator.xpath" class="py-name" href="#" onclick="return doclink('link-18', 'xpath', 'link-16');">xpath</a></tt><tt class="py-op">(</tt><tt class="py-string">'boolean(/a/c)'</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
174 </div><a name="L23"></a><tt class="py-lineno"> 23</tt> <tt class="py-line"> </tt>
175 <a name="ETreeXPathTestCase.test_xpath_number"></a><div id="ETreeXPathTestCase.test_xpath_number-def"><a name="L24"></a><tt class="py-lineno"> 24</tt> <a class="py-toggle" href="#" id="ETreeXPathTestCase.test_xpath_number-toggle" onclick="return toggle('ETreeXPathTestCase.test_xpath_number');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="lxml.tests.test_xpathevaluator.ETreeXPathTestCase-class.html#test_xpath_number">test_xpath_number</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
176 </div><div id="ETreeXPathTestCase.test_xpath_number-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="ETreeXPathTestCase.test_xpath_number-expanded"><a name="L25"></a><tt class="py-lineno"> 25</tt> <tt class="py-line"> <tt class="py-name">tree</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-19" class="py-name"><a title="lxml.cssselect.parse
177 lxml.etree._ElementTree.parse
179 lxml.html.ElementSoup.parse
180 lxml.html.html5parser.parse
182 lxml.html.soupparser.parse
184 lxml.tests.common_imports.HelperTestCase.parse" class="py-name" href="#" onclick="return doclink('link-19', 'parse', 'link-14');">parse</a></tt><tt class="py-op">(</tt><tt class="py-string">'<a>1</a>'</tt><tt class="py-op">)</tt> </tt>
185 <a name="L26"></a><tt class="py-lineno"> 26</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEquals</tt><tt class="py-op">(</tt><tt class="py-number">1.</tt><tt class="py-op">,</tt> </tt>
186 <a name="L27"></a><tt class="py-lineno"> 27</tt> <tt class="py-line"> <tt class="py-name">tree</tt><tt class="py-op">.</tt><tt id="link-20" class="py-name"><a title="lxml.cssselect.Attrib.xpath
187 lxml.cssselect.Class.xpath
188 lxml.cssselect.CombinedSelector.xpath
189 lxml.cssselect.Element.xpath
190 lxml.cssselect.Function.xpath
191 lxml.cssselect.Hash.xpath
192 lxml.cssselect.Or.xpath
193 lxml.cssselect.Pseudo.xpath
194 lxml.etree._Element.xpath
195 lxml.etree._ElementTree.xpath
196 lxml.tests.test_xpathevaluator.xpath" class="py-name" href="#" onclick="return doclink('link-20', 'xpath', 'link-16');">xpath</a></tt><tt class="py-op">(</tt><tt class="py-string">'number(/a)'</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
197 <a name="L28"></a><tt class="py-lineno"> 28</tt> <tt class="py-line"> <tt class="py-name">tree</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-21" class="py-name"><a title="lxml.cssselect.parse
198 lxml.etree._ElementTree.parse
200 lxml.html.ElementSoup.parse
201 lxml.html.html5parser.parse
203 lxml.html.soupparser.parse
205 lxml.tests.common_imports.HelperTestCase.parse" class="py-name" href="#" onclick="return doclink('link-21', 'parse', 'link-14');">parse</a></tt><tt class="py-op">(</tt><tt class="py-string">'<a>A</a>'</tt><tt class="py-op">)</tt> </tt>
206 <a name="L29"></a><tt class="py-lineno"> 29</tt> <tt class="py-line"> <tt class="py-name">actual</tt> <tt class="py-op">=</tt> <tt class="py-name">str</tt><tt class="py-op">(</tt><tt class="py-name">tree</tt><tt class="py-op">.</tt><tt id="link-22" class="py-name"><a title="lxml.cssselect.Attrib.xpath
207 lxml.cssselect.Class.xpath
208 lxml.cssselect.CombinedSelector.xpath
209 lxml.cssselect.Element.xpath
210 lxml.cssselect.Function.xpath
211 lxml.cssselect.Hash.xpath
212 lxml.cssselect.Or.xpath
213 lxml.cssselect.Pseudo.xpath
214 lxml.etree._Element.xpath
215 lxml.etree._ElementTree.xpath
216 lxml.tests.test_xpathevaluator.xpath" class="py-name" href="#" onclick="return doclink('link-22', 'xpath', 'link-16');">xpath</a></tt><tt class="py-op">(</tt><tt class="py-string">'number(/a)'</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
217 <a name="L30"></a><tt class="py-lineno"> 30</tt> <tt class="py-line"> <tt class="py-name">expected</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-string">'nan'</tt><tt class="py-op">,</tt> <tt class="py-string">'1.#qnan'</tt><tt class="py-op">,</tt> <tt class="py-string">'nanq'</tt><tt class="py-op">]</tt> </tt>
218 <a name="L31"></a><tt class="py-lineno"> 31</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-keyword">not</tt> <tt class="py-name">actual</tt><tt class="py-op">.</tt><tt class="py-name">lower</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> <tt class="py-keyword">in</tt> <tt class="py-name">expected</tt><tt class="py-op">:</tt> </tt>
219 <a name="L32"></a><tt class="py-lineno"> 32</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">fail</tt><tt class="py-op">(</tt><tt class="py-string">'Expected a NAN value, got %s'</tt> <tt class="py-op">%</tt> <tt class="py-name">actual</tt><tt class="py-op">)</tt> </tt>
220 </div><a name="L33"></a><tt class="py-lineno"> 33</tt> <tt class="py-line"> </tt>
221 <a name="ETreeXPathTestCase.test_xpath_string"></a><div id="ETreeXPathTestCase.test_xpath_string-def"><a name="L34"></a><tt class="py-lineno"> 34</tt> <a class="py-toggle" href="#" id="ETreeXPathTestCase.test_xpath_string-toggle" onclick="return toggle('ETreeXPathTestCase.test_xpath_string');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="lxml.tests.test_xpathevaluator.ETreeXPathTestCase-class.html#test_xpath_string">test_xpath_string</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
222 </div><div id="ETreeXPathTestCase.test_xpath_string-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="ETreeXPathTestCase.test_xpath_string-expanded"><a name="L35"></a><tt class="py-lineno"> 35</tt> <tt class="py-line"> <tt class="py-name">tree</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-23" class="py-name"><a title="lxml.cssselect.parse
223 lxml.etree._ElementTree.parse
225 lxml.html.ElementSoup.parse
226 lxml.html.html5parser.parse
228 lxml.html.soupparser.parse
230 lxml.tests.common_imports.HelperTestCase.parse" class="py-name" href="#" onclick="return doclink('link-23', 'parse', 'link-14');">parse</a></tt><tt class="py-op">(</tt><tt class="py-string">'<a>Foo</a>'</tt><tt class="py-op">)</tt> </tt>
231 <a name="L36"></a><tt class="py-lineno"> 36</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEquals</tt><tt class="py-op">(</tt><tt class="py-string">'Foo'</tt><tt class="py-op">,</tt> </tt>
232 <a name="L37"></a><tt class="py-lineno"> 37</tt> <tt class="py-line"> <tt class="py-name">tree</tt><tt class="py-op">.</tt><tt id="link-24" class="py-name"><a title="lxml.cssselect.Attrib.xpath
233 lxml.cssselect.Class.xpath
234 lxml.cssselect.CombinedSelector.xpath
235 lxml.cssselect.Element.xpath
236 lxml.cssselect.Function.xpath
237 lxml.cssselect.Hash.xpath
238 lxml.cssselect.Or.xpath
239 lxml.cssselect.Pseudo.xpath
240 lxml.etree._Element.xpath
241 lxml.etree._ElementTree.xpath
242 lxml.tests.test_xpathevaluator.xpath" class="py-name" href="#" onclick="return doclink('link-24', 'xpath', 'link-16');">xpath</a></tt><tt class="py-op">(</tt><tt class="py-string">'string(/a/text())'</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
243 </div><a name="L38"></a><tt class="py-lineno"> 38</tt> <tt class="py-line"> </tt>
244 <a name="ETreeXPathTestCase.test_xpath_document_root"></a><div id="ETreeXPathTestCase.test_xpath_document_root-def"><a name="L39"></a><tt class="py-lineno"> 39</tt> <a class="py-toggle" href="#" id="ETreeXPathTestCase.test_xpath_document_root-toggle" onclick="return toggle('ETreeXPathTestCase.test_xpath_document_root');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="lxml.tests.test_xpathevaluator.ETreeXPathTestCase-class.html#test_xpath_document_root">test_xpath_document_root</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
245 </div><div id="ETreeXPathTestCase.test_xpath_document_root-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="ETreeXPathTestCase.test_xpath_document_root-expanded"><a name="L40"></a><tt class="py-lineno"> 40</tt> <tt class="py-line"> <tt class="py-name">tree</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-25" class="py-name"><a title="lxml.cssselect.parse
246 lxml.etree._ElementTree.parse
248 lxml.html.ElementSoup.parse
249 lxml.html.html5parser.parse
251 lxml.html.soupparser.parse
253 lxml.tests.common_imports.HelperTestCase.parse" class="py-name" href="#" onclick="return doclink('link-25', 'parse', 'link-14');">parse</a></tt><tt class="py-op">(</tt><tt class="py-string">'<a><b/></a>'</tt><tt class="py-op">)</tt> </tt>
254 <a name="L41"></a><tt class="py-lineno"> 41</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEquals</tt><tt class="py-op">(</tt><tt class="py-op">[</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> </tt>
255 <a name="L42"></a><tt class="py-lineno"> 42</tt> <tt class="py-line"> <tt class="py-name">tree</tt><tt class="py-op">.</tt><tt id="link-26" class="py-name"><a title="lxml.cssselect.Attrib.xpath
256 lxml.cssselect.Class.xpath
257 lxml.cssselect.CombinedSelector.xpath
258 lxml.cssselect.Element.xpath
259 lxml.cssselect.Function.xpath
260 lxml.cssselect.Hash.xpath
261 lxml.cssselect.Or.xpath
262 lxml.cssselect.Pseudo.xpath
263 lxml.etree._Element.xpath
264 lxml.etree._ElementTree.xpath
265 lxml.tests.test_xpathevaluator.xpath" class="py-name" href="#" onclick="return doclink('link-26', 'xpath', 'link-16');">xpath</a></tt><tt class="py-op">(</tt><tt class="py-string">'/'</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
266 </div><a name="L43"></a><tt class="py-lineno"> 43</tt> <tt class="py-line"> </tt>
267 <a name="ETreeXPathTestCase.test_xpath_namespace"></a><div id="ETreeXPathTestCase.test_xpath_namespace-def"><a name="L44"></a><tt class="py-lineno"> 44</tt> <a class="py-toggle" href="#" id="ETreeXPathTestCase.test_xpath_namespace-toggle" onclick="return toggle('ETreeXPathTestCase.test_xpath_namespace');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="lxml.tests.test_xpathevaluator.ETreeXPathTestCase-class.html#test_xpath_namespace">test_xpath_namespace</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
268 </div><div id="ETreeXPathTestCase.test_xpath_namespace-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="ETreeXPathTestCase.test_xpath_namespace-expanded"><a name="L45"></a><tt class="py-lineno"> 45</tt> <tt class="py-line"> <tt class="py-name">tree</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-27" class="py-name"><a title="lxml.cssselect.parse
269 lxml.etree._ElementTree.parse
271 lxml.html.ElementSoup.parse
272 lxml.html.html5parser.parse
274 lxml.html.soupparser.parse
276 lxml.tests.common_imports.HelperTestCase.parse" class="py-name" href="#" onclick="return doclink('link-27', 'parse', 'link-14');">parse</a></tt><tt class="py-op">(</tt><tt class="py-string">'<a xmlns="test" xmlns:p="myURI"/>'</tt><tt class="py-op">)</tt> </tt>
277 <a name="L46"></a><tt class="py-lineno"> 46</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-28" class="py-name"><a title="lxml.etree._Validator.assert_" class="py-name" href="#" onclick="return doclink('link-28', 'assert_', 'link-15');">assert_</a></tt><tt class="py-op">(</tt><tt class="py-op">(</tt><tt class="py-name">None</tt><tt class="py-op">,</tt> <tt class="py-string">"test"</tt><tt class="py-op">)</tt> <tt class="py-keyword">in</tt> <tt class="py-name">tree</tt><tt class="py-op">.</tt><tt id="link-29" class="py-name"><a title="lxml.cssselect.Attrib.xpath
278 lxml.cssselect.Class.xpath
279 lxml.cssselect.CombinedSelector.xpath
280 lxml.cssselect.Element.xpath
281 lxml.cssselect.Function.xpath
282 lxml.cssselect.Hash.xpath
283 lxml.cssselect.Or.xpath
284 lxml.cssselect.Pseudo.xpath
285 lxml.etree._Element.xpath
286 lxml.etree._ElementTree.xpath
287 lxml.tests.test_xpathevaluator.xpath" class="py-name" href="#" onclick="return doclink('link-29', 'xpath', 'link-16');">xpath</a></tt><tt class="py-op">(</tt><tt class="py-string">'namespace::*'</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
288 <a name="L47"></a><tt class="py-lineno"> 47</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-30" class="py-name"><a title="lxml.etree._Validator.assert_" class="py-name" href="#" onclick="return doclink('link-30', 'assert_', 'link-15');">assert_</a></tt><tt class="py-op">(</tt><tt class="py-op">(</tt><tt class="py-string">'p'</tt><tt class="py-op">,</tt> <tt class="py-string">'myURI'</tt><tt class="py-op">)</tt> <tt class="py-keyword">in</tt> <tt class="py-name">tree</tt><tt class="py-op">.</tt><tt id="link-31" class="py-name"><a title="lxml.cssselect.Attrib.xpath
289 lxml.cssselect.Class.xpath
290 lxml.cssselect.CombinedSelector.xpath
291 lxml.cssselect.Element.xpath
292 lxml.cssselect.Function.xpath
293 lxml.cssselect.Hash.xpath
294 lxml.cssselect.Or.xpath
295 lxml.cssselect.Pseudo.xpath
296 lxml.etree._Element.xpath
297 lxml.etree._ElementTree.xpath
298 lxml.tests.test_xpathevaluator.xpath" class="py-name" href="#" onclick="return doclink('link-31', 'xpath', 'link-16');">xpath</a></tt><tt class="py-op">(</tt><tt class="py-string">'namespace::*'</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
299 </div><a name="L48"></a><tt class="py-lineno"> 48</tt> <tt class="py-line"> </tt>
300 <a name="ETreeXPathTestCase.test_xpath_namespace_empty"></a><div id="ETreeXPathTestCase.test_xpath_namespace_empty-def"><a name="L49"></a><tt class="py-lineno"> 49</tt> <a class="py-toggle" href="#" id="ETreeXPathTestCase.test_xpath_namespace_empty-toggle" onclick="return toggle('ETreeXPathTestCase.test_xpath_namespace_empty');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="lxml.tests.test_xpathevaluator.ETreeXPathTestCase-class.html#test_xpath_namespace_empty">test_xpath_namespace_empty</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
301 </div><div id="ETreeXPathTestCase.test_xpath_namespace_empty-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="ETreeXPathTestCase.test_xpath_namespace_empty-expanded"><a name="L50"></a><tt class="py-lineno"> 50</tt> <tt class="py-line"> <tt class="py-name">tree</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-32" class="py-name"><a title="lxml.cssselect.parse
302 lxml.etree._ElementTree.parse
304 lxml.html.ElementSoup.parse
305 lxml.html.html5parser.parse
307 lxml.html.soupparser.parse
309 lxml.tests.common_imports.HelperTestCase.parse" class="py-name" href="#" onclick="return doclink('link-32', 'parse', 'link-14');">parse</a></tt><tt class="py-op">(</tt><tt class="py-string">'<a/>'</tt><tt class="py-op">)</tt> </tt>
310 <a name="L51"></a><tt class="py-lineno"> 51</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEquals</tt><tt class="py-op">(</tt><tt class="py-op">[</tt><tt class="py-op">(</tt><tt class="py-string">'xml'</tt><tt class="py-op">,</tt> <tt class="py-string">'http://www.w3.org/XML/1998/namespace'</tt><tt class="py-op">)</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> </tt>
311 <a name="L52"></a><tt class="py-lineno"> 52</tt> <tt class="py-line"> <tt class="py-name">tree</tt><tt class="py-op">.</tt><tt id="link-33" class="py-name"><a title="lxml.cssselect.Attrib.xpath
312 lxml.cssselect.Class.xpath
313 lxml.cssselect.CombinedSelector.xpath
314 lxml.cssselect.Element.xpath
315 lxml.cssselect.Function.xpath
316 lxml.cssselect.Hash.xpath
317 lxml.cssselect.Or.xpath
318 lxml.cssselect.Pseudo.xpath
319 lxml.etree._Element.xpath
320 lxml.etree._ElementTree.xpath
321 lxml.tests.test_xpathevaluator.xpath" class="py-name" href="#" onclick="return doclink('link-33', 'xpath', 'link-16');">xpath</a></tt><tt class="py-op">(</tt><tt class="py-string">'namespace::*'</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
322 </div><a name="L53"></a><tt class="py-lineno"> 53</tt> <tt class="py-line"> </tt>
323 <a name="ETreeXPathTestCase.test_xpath_list_elements"></a><div id="ETreeXPathTestCase.test_xpath_list_elements-def"><a name="L54"></a><tt class="py-lineno"> 54</tt> <a class="py-toggle" href="#" id="ETreeXPathTestCase.test_xpath_list_elements-toggle" onclick="return toggle('ETreeXPathTestCase.test_xpath_list_elements');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="lxml.tests.test_xpathevaluator.ETreeXPathTestCase-class.html#test_xpath_list_elements">test_xpath_list_elements</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
324 </div><div id="ETreeXPathTestCase.test_xpath_list_elements-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="ETreeXPathTestCase.test_xpath_list_elements-expanded"><a name="L55"></a><tt class="py-lineno"> 55</tt> <tt class="py-line"> <tt class="py-name">tree</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-34" class="py-name"><a title="lxml.cssselect.parse
325 lxml.etree._ElementTree.parse
327 lxml.html.ElementSoup.parse
328 lxml.html.html5parser.parse
330 lxml.html.soupparser.parse
332 lxml.tests.common_imports.HelperTestCase.parse" class="py-name" href="#" onclick="return doclink('link-34', 'parse', 'link-14');">parse</a></tt><tt class="py-op">(</tt><tt class="py-string">'<a><b>Foo</b><b>Bar</b></a>'</tt><tt class="py-op">)</tt> </tt>
333 <a name="L56"></a><tt class="py-lineno"> 56</tt> <tt class="py-line"> <tt id="link-35" class="py-name" targets="Variable lxml.etree.iterparse.root=lxml.etree.iterparse-class.html#root"><a title="lxml.etree.iterparse.root" class="py-name" href="#" onclick="return doclink('link-35', 'root', 'link-35');">root</a></tt> <tt class="py-op">=</tt> <tt class="py-name">tree</tt><tt class="py-op">.</tt><tt id="link-36" 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-36', 'getroot', 'link-36');">getroot</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
334 <a name="L57"></a><tt class="py-lineno"> 57</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEquals</tt><tt class="py-op">(</tt><tt class="py-op">[</tt><tt id="link-37" class="py-name"><a title="lxml.etree.iterparse.root" class="py-name" href="#" onclick="return doclink('link-37', 'root', 'link-35');">root</a></tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> <tt id="link-38" class="py-name"><a title="lxml.etree.iterparse.root" class="py-name" href="#" onclick="return doclink('link-38', 'root', 'link-35');">root</a></tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> </tt>
335 <a name="L58"></a><tt class="py-lineno"> 58</tt> <tt class="py-line"> <tt class="py-name">tree</tt><tt class="py-op">.</tt><tt id="link-39" class="py-name"><a title="lxml.cssselect.Attrib.xpath
336 lxml.cssselect.Class.xpath
337 lxml.cssselect.CombinedSelector.xpath
338 lxml.cssselect.Element.xpath
339 lxml.cssselect.Function.xpath
340 lxml.cssselect.Hash.xpath
341 lxml.cssselect.Or.xpath
342 lxml.cssselect.Pseudo.xpath
343 lxml.etree._Element.xpath
344 lxml.etree._ElementTree.xpath
345 lxml.tests.test_xpathevaluator.xpath" class="py-name" href="#" onclick="return doclink('link-39', 'xpath', 'link-16');">xpath</a></tt><tt class="py-op">(</tt><tt class="py-string">'/a/b'</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
346 </div><a name="L59"></a><tt class="py-lineno"> 59</tt> <tt class="py-line"> </tt>
347 <a name="ETreeXPathTestCase.test_xpath_list_nothing"></a><div id="ETreeXPathTestCase.test_xpath_list_nothing-def"><a name="L60"></a><tt class="py-lineno"> 60</tt> <a class="py-toggle" href="#" id="ETreeXPathTestCase.test_xpath_list_nothing-toggle" onclick="return toggle('ETreeXPathTestCase.test_xpath_list_nothing');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="lxml.tests.test_xpathevaluator.ETreeXPathTestCase-class.html#test_xpath_list_nothing">test_xpath_list_nothing</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
348 </div><div id="ETreeXPathTestCase.test_xpath_list_nothing-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="ETreeXPathTestCase.test_xpath_list_nothing-expanded"><a name="L61"></a><tt class="py-lineno"> 61</tt> <tt class="py-line"> <tt class="py-name">tree</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-40" class="py-name"><a title="lxml.cssselect.parse
349 lxml.etree._ElementTree.parse
351 lxml.html.ElementSoup.parse
352 lxml.html.html5parser.parse
354 lxml.html.soupparser.parse
356 lxml.tests.common_imports.HelperTestCase.parse" class="py-name" href="#" onclick="return doclink('link-40', 'parse', 'link-14');">parse</a></tt><tt class="py-op">(</tt><tt class="py-string">'<a><b/></a>'</tt><tt class="py-op">)</tt> </tt>
357 <a name="L62"></a><tt class="py-lineno"> 62</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEquals</tt><tt class="py-op">(</tt><tt class="py-op">[</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> </tt>
358 <a name="L63"></a><tt class="py-lineno"> 63</tt> <tt class="py-line"> <tt class="py-name">tree</tt><tt class="py-op">.</tt><tt id="link-41" class="py-name"><a title="lxml.cssselect.Attrib.xpath
359 lxml.cssselect.Class.xpath
360 lxml.cssselect.CombinedSelector.xpath
361 lxml.cssselect.Element.xpath
362 lxml.cssselect.Function.xpath
363 lxml.cssselect.Hash.xpath
364 lxml.cssselect.Or.xpath
365 lxml.cssselect.Pseudo.xpath
366 lxml.etree._Element.xpath
367 lxml.etree._ElementTree.xpath
368 lxml.tests.test_xpathevaluator.xpath" class="py-name" href="#" onclick="return doclink('link-41', 'xpath', 'link-16');">xpath</a></tt><tt class="py-op">(</tt><tt class="py-string">'/a/c'</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
369 <a name="L64"></a><tt class="py-lineno"> 64</tt> <tt class="py-line"> <tt class="py-comment"># this seems to pass a different code path, also should return nothing</tt> </tt>
370 <a name="L65"></a><tt class="py-lineno"> 65</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEquals</tt><tt class="py-op">(</tt><tt class="py-op">[</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> </tt>
371 <a name="L66"></a><tt class="py-lineno"> 66</tt> <tt class="py-line"> <tt class="py-name">tree</tt><tt class="py-op">.</tt><tt id="link-42" class="py-name"><a title="lxml.cssselect.Attrib.xpath
372 lxml.cssselect.Class.xpath
373 lxml.cssselect.CombinedSelector.xpath
374 lxml.cssselect.Element.xpath
375 lxml.cssselect.Function.xpath
376 lxml.cssselect.Hash.xpath
377 lxml.cssselect.Or.xpath
378 lxml.cssselect.Pseudo.xpath
379 lxml.etree._Element.xpath
380 lxml.etree._ElementTree.xpath
381 lxml.tests.test_xpathevaluator.xpath" class="py-name" href="#" onclick="return doclink('link-42', 'xpath', 'link-16');">xpath</a></tt><tt class="py-op">(</tt><tt class="py-string">'/a/c/text()'</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
382 </div><a name="L67"></a><tt class="py-lineno"> 67</tt> <tt class="py-line"> </tt>
383 <a name="ETreeXPathTestCase.test_xpath_list_text"></a><div id="ETreeXPathTestCase.test_xpath_list_text-def"><a name="L68"></a><tt class="py-lineno"> 68</tt> <a class="py-toggle" href="#" id="ETreeXPathTestCase.test_xpath_list_text-toggle" onclick="return toggle('ETreeXPathTestCase.test_xpath_list_text');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="lxml.tests.test_xpathevaluator.ETreeXPathTestCase-class.html#test_xpath_list_text">test_xpath_list_text</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
384 </div><div id="ETreeXPathTestCase.test_xpath_list_text-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="ETreeXPathTestCase.test_xpath_list_text-expanded"><a name="L69"></a><tt class="py-lineno"> 69</tt> <tt class="py-line"> <tt class="py-name">tree</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-43" class="py-name"><a title="lxml.cssselect.parse
385 lxml.etree._ElementTree.parse
387 lxml.html.ElementSoup.parse
388 lxml.html.html5parser.parse
390 lxml.html.soupparser.parse
392 lxml.tests.common_imports.HelperTestCase.parse" class="py-name" href="#" onclick="return doclink('link-43', 'parse', 'link-14');">parse</a></tt><tt class="py-op">(</tt><tt class="py-string">'<a><b>Foo</b><b>Bar</b></a>'</tt><tt class="py-op">)</tt> </tt>
393 <a name="L70"></a><tt class="py-lineno"> 70</tt> <tt class="py-line"> <tt id="link-44" class="py-name"><a title="lxml.etree.iterparse.root" class="py-name" href="#" onclick="return doclink('link-44', 'root', 'link-35');">root</a></tt> <tt class="py-op">=</tt> <tt class="py-name">tree</tt><tt class="py-op">.</tt><tt id="link-45" class="py-name"><a title="lxml.etree._ElementTree.getroot" class="py-name" href="#" onclick="return doclink('link-45', 'getroot', 'link-36');">getroot</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
394 <a name="L71"></a><tt class="py-lineno"> 71</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEquals</tt><tt class="py-op">(</tt><tt class="py-op">[</tt><tt class="py-string">'Foo'</tt><tt class="py-op">,</tt> <tt class="py-string">'Bar'</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> </tt>
395 <a name="L72"></a><tt class="py-lineno"> 72</tt> <tt class="py-line"> <tt class="py-name">tree</tt><tt class="py-op">.</tt><tt id="link-46" class="py-name"><a title="lxml.cssselect.Attrib.xpath
396 lxml.cssselect.Class.xpath
397 lxml.cssselect.CombinedSelector.xpath
398 lxml.cssselect.Element.xpath
399 lxml.cssselect.Function.xpath
400 lxml.cssselect.Hash.xpath
401 lxml.cssselect.Or.xpath
402 lxml.cssselect.Pseudo.xpath
403 lxml.etree._Element.xpath
404 lxml.etree._ElementTree.xpath
405 lxml.tests.test_xpathevaluator.xpath" class="py-name" href="#" onclick="return doclink('link-46', 'xpath', 'link-16');">xpath</a></tt><tt class="py-op">(</tt><tt class="py-string">'/a/b/text()'</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
406 </div><a name="L73"></a><tt class="py-lineno"> 73</tt> <tt class="py-line"> </tt>
407 <a name="ETreeXPathTestCase.test_xpath_list_text_parent"></a><div id="ETreeXPathTestCase.test_xpath_list_text_parent-def"><a name="L74"></a><tt class="py-lineno"> 74</tt> <a class="py-toggle" href="#" id="ETreeXPathTestCase.test_xpath_list_text_parent-toggle" onclick="return toggle('ETreeXPathTestCase.test_xpath_list_text_parent');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="lxml.tests.test_xpathevaluator.ETreeXPathTestCase-class.html#test_xpath_list_text_parent">test_xpath_list_text_parent</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
408 </div><div id="ETreeXPathTestCase.test_xpath_list_text_parent-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="ETreeXPathTestCase.test_xpath_list_text_parent-expanded"><a name="L75"></a><tt class="py-lineno"> 75</tt> <tt class="py-line"> <tt class="py-name">tree</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-47" class="py-name"><a title="lxml.cssselect.parse
409 lxml.etree._ElementTree.parse
411 lxml.html.ElementSoup.parse
412 lxml.html.html5parser.parse
414 lxml.html.soupparser.parse
416 lxml.tests.common_imports.HelperTestCase.parse" class="py-name" href="#" onclick="return doclink('link-47', 'parse', 'link-14');">parse</a></tt><tt class="py-op">(</tt><tt class="py-string">'<a><b>FooBar</b><b>BarFoo</b></a>'</tt><tt class="py-op">)</tt> </tt>
417 <a name="L76"></a><tt class="py-lineno"> 76</tt> <tt class="py-line"> <tt id="link-48" class="py-name"><a title="lxml.etree.iterparse.root" class="py-name" href="#" onclick="return doclink('link-48', 'root', 'link-35');">root</a></tt> <tt class="py-op">=</tt> <tt class="py-name">tree</tt><tt class="py-op">.</tt><tt id="link-49" class="py-name"><a title="lxml.etree._ElementTree.getroot" class="py-name" href="#" onclick="return doclink('link-49', 'getroot', 'link-36');">getroot</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
418 <a name="L77"></a><tt class="py-lineno"> 77</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEquals</tt><tt class="py-op">(</tt><tt class="py-op">[</tt><tt class="py-string">'FooBar'</tt><tt class="py-op">,</tt> <tt class="py-string">'BarFoo'</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> </tt>
419 <a name="L78"></a><tt class="py-lineno"> 78</tt> <tt class="py-line"> <tt class="py-name">tree</tt><tt class="py-op">.</tt><tt id="link-50" class="py-name"><a title="lxml.cssselect.Attrib.xpath
420 lxml.cssselect.Class.xpath
421 lxml.cssselect.CombinedSelector.xpath
422 lxml.cssselect.Element.xpath
423 lxml.cssselect.Function.xpath
424 lxml.cssselect.Hash.xpath
425 lxml.cssselect.Or.xpath
426 lxml.cssselect.Pseudo.xpath
427 lxml.etree._Element.xpath
428 lxml.etree._ElementTree.xpath
429 lxml.tests.test_xpathevaluator.xpath" class="py-name" href="#" onclick="return doclink('link-50', 'xpath', 'link-16');">xpath</a></tt><tt class="py-op">(</tt><tt class="py-string">'/a/b/text()'</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
430 <a name="L79"></a><tt class="py-lineno"> 79</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEquals</tt><tt class="py-op">(</tt><tt class="py-op">[</tt><tt id="link-51" class="py-name"><a title="lxml.etree.iterparse.root" class="py-name" href="#" onclick="return doclink('link-51', 'root', 'link-35');">root</a></tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> <tt id="link-52" class="py-name"><a title="lxml.etree.iterparse.root" class="py-name" href="#" onclick="return doclink('link-52', 'root', 'link-35');">root</a></tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> </tt>
431 <a name="L80"></a><tt class="py-lineno"> 80</tt> <tt class="py-line"> <tt class="py-op">[</tt><tt class="py-name">r</tt><tt class="py-op">.</tt><tt id="link-53" 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
432 lxml.etree._ElementStringResult.getparent
433 lxml.etree._ElementUnicodeResult.getparent
434 lxml.etree._ReadOnlyProxy.getparent" class="py-name" href="#" onclick="return doclink('link-53', 'getparent', 'link-53');">getparent</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> <tt class="py-keyword">for</tt> <tt class="py-name">r</tt> <tt class="py-keyword">in</tt> <tt class="py-name">tree</tt><tt class="py-op">.</tt><tt id="link-54" class="py-name"><a title="lxml.cssselect.Attrib.xpath
435 lxml.cssselect.Class.xpath
436 lxml.cssselect.CombinedSelector.xpath
437 lxml.cssselect.Element.xpath
438 lxml.cssselect.Function.xpath
439 lxml.cssselect.Hash.xpath
440 lxml.cssselect.Or.xpath
441 lxml.cssselect.Pseudo.xpath
442 lxml.etree._Element.xpath
443 lxml.etree._ElementTree.xpath
444 lxml.tests.test_xpathevaluator.xpath" class="py-name" href="#" onclick="return doclink('link-54', 'xpath', 'link-16');">xpath</a></tt><tt class="py-op">(</tt><tt class="py-string">'/a/b/text()'</tt><tt class="py-op">)</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
445 </div><a name="L81"></a><tt class="py-lineno"> 81</tt> <tt class="py-line"> </tt>
446 <a name="ETreeXPathTestCase.test_xpath_list_text_parent_no_smart_strings"></a><div id="ETreeXPathTestCase.test_xpath_list_text_parent_no_smart_strings-def"><a name="L82"></a><tt class="py-lineno"> 82</tt> <a class="py-toggle" href="#" id="ETreeXPathTestCase.test_xpath_list_text_parent_no_smart_strings-toggle" onclick="return toggle('ETreeXPathTestCase.test_xpath_list_text_parent_no_smart_strings');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="lxml.tests.test_xpathevaluator.ETreeXPathTestCase-class.html#test_xpath_list_text_parent_no_smart_strings">test_xpath_list_text_parent_no_smart_strings</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
447 </div><div id="ETreeXPathTestCase.test_xpath_list_text_parent_no_smart_strings-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="ETreeXPathTestCase.test_xpath_list_text_parent_no_smart_strings-expanded"><a name="L83"></a><tt class="py-lineno"> 83</tt> <tt class="py-line"> <tt class="py-name">tree</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-55" class="py-name"><a title="lxml.cssselect.parse
448 lxml.etree._ElementTree.parse
450 lxml.html.ElementSoup.parse
451 lxml.html.html5parser.parse
453 lxml.html.soupparser.parse
455 lxml.tests.common_imports.HelperTestCase.parse" class="py-name" href="#" onclick="return doclink('link-55', 'parse', 'link-14');">parse</a></tt><tt class="py-op">(</tt><tt class="py-string">'<a><b>FooBar</b><b>BarFoo</b></a>'</tt><tt class="py-op">)</tt> </tt>
456 <a name="L84"></a><tt class="py-lineno"> 84</tt> <tt class="py-line"> <tt id="link-56" class="py-name"><a title="lxml.etree.iterparse.root" class="py-name" href="#" onclick="return doclink('link-56', 'root', 'link-35');">root</a></tt> <tt class="py-op">=</tt> <tt class="py-name">tree</tt><tt class="py-op">.</tt><tt id="link-57" class="py-name"><a title="lxml.etree._ElementTree.getroot" class="py-name" href="#" onclick="return doclink('link-57', 'getroot', 'link-36');">getroot</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
457 <a name="L85"></a><tt class="py-lineno"> 85</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEquals</tt><tt class="py-op">(</tt><tt class="py-op">[</tt><tt class="py-string">'FooBar'</tt><tt class="py-op">,</tt> <tt class="py-string">'BarFoo'</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> </tt>
458 <a name="L86"></a><tt class="py-lineno"> 86</tt> <tt class="py-line"> <tt class="py-name">tree</tt><tt class="py-op">.</tt><tt id="link-58" class="py-name"><a title="lxml.cssselect.Attrib.xpath
459 lxml.cssselect.Class.xpath
460 lxml.cssselect.CombinedSelector.xpath
461 lxml.cssselect.Element.xpath
462 lxml.cssselect.Function.xpath
463 lxml.cssselect.Hash.xpath
464 lxml.cssselect.Or.xpath
465 lxml.cssselect.Pseudo.xpath
466 lxml.etree._Element.xpath
467 lxml.etree._ElementTree.xpath
468 lxml.tests.test_xpathevaluator.xpath" class="py-name" href="#" onclick="return doclink('link-58', 'xpath', 'link-16');">xpath</a></tt><tt class="py-op">(</tt><tt class="py-string">'/a/b/text()'</tt><tt class="py-op">,</tt> <tt class="py-name">smart_strings</tt><tt class="py-op">=</tt><tt class="py-name">True</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
469 <a name="L87"></a><tt class="py-lineno"> 87</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEquals</tt><tt class="py-op">(</tt><tt class="py-op">[</tt><tt id="link-59" class="py-name"><a title="lxml.etree.iterparse.root" class="py-name" href="#" onclick="return doclink('link-59', 'root', 'link-35');">root</a></tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> <tt id="link-60" class="py-name"><a title="lxml.etree.iterparse.root" class="py-name" href="#" onclick="return doclink('link-60', 'root', 'link-35');">root</a></tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> </tt>
470 <a name="L88"></a><tt class="py-lineno"> 88</tt> <tt class="py-line"> <tt class="py-op">[</tt><tt class="py-name">r</tt><tt class="py-op">.</tt><tt id="link-61" class="py-name"><a title="lxml.etree._Element.getparent
471 lxml.etree._ElementStringResult.getparent
472 lxml.etree._ElementUnicodeResult.getparent
473 lxml.etree._ReadOnlyProxy.getparent" class="py-name" href="#" onclick="return doclink('link-61', 'getparent', 'link-53');">getparent</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> <tt class="py-keyword">for</tt> <tt class="py-name">r</tt> <tt class="py-keyword">in</tt> </tt>
474 <a name="L89"></a><tt class="py-lineno"> 89</tt> <tt class="py-line"> <tt class="py-name">tree</tt><tt class="py-op">.</tt><tt id="link-62" class="py-name"><a title="lxml.cssselect.Attrib.xpath
475 lxml.cssselect.Class.xpath
476 lxml.cssselect.CombinedSelector.xpath
477 lxml.cssselect.Element.xpath
478 lxml.cssselect.Function.xpath
479 lxml.cssselect.Hash.xpath
480 lxml.cssselect.Or.xpath
481 lxml.cssselect.Pseudo.xpath
482 lxml.etree._Element.xpath
483 lxml.etree._ElementTree.xpath
484 lxml.tests.test_xpathevaluator.xpath" class="py-name" href="#" onclick="return doclink('link-62', 'xpath', 'link-16');">xpath</a></tt><tt class="py-op">(</tt><tt class="py-string">'/a/b/text()'</tt><tt class="py-op">,</tt> <tt class="py-name">smart_strings</tt><tt class="py-op">=</tt><tt class="py-name">True</tt><tt class="py-op">)</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
485 <a name="L90"></a><tt class="py-lineno"> 90</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEquals</tt><tt class="py-op">(</tt><tt class="py-op">[</tt><tt class="py-name">None</tt><tt class="py-op">,</tt> <tt class="py-name">None</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> </tt>
486 <a name="L91"></a><tt class="py-lineno"> 91</tt> <tt class="py-line"> <tt class="py-op">[</tt><tt class="py-name">r</tt><tt class="py-op">.</tt><tt id="link-63" class="py-name" targets="Variable lxml.etree._ElementUnicodeResult.attrname=lxml.etree._ElementUnicodeResult-class.html#attrname"><a title="lxml.etree._ElementUnicodeResult.attrname" class="py-name" href="#" onclick="return doclink('link-63', 'attrname', 'link-63');">attrname</a></tt> <tt class="py-keyword">for</tt> <tt class="py-name">r</tt> <tt class="py-keyword">in</tt> </tt>
487 <a name="L92"></a><tt class="py-lineno"> 92</tt> <tt class="py-line"> <tt class="py-name">tree</tt><tt class="py-op">.</tt><tt id="link-64" class="py-name"><a title="lxml.cssselect.Attrib.xpath
488 lxml.cssselect.Class.xpath
489 lxml.cssselect.CombinedSelector.xpath
490 lxml.cssselect.Element.xpath
491 lxml.cssselect.Function.xpath
492 lxml.cssselect.Hash.xpath
493 lxml.cssselect.Or.xpath
494 lxml.cssselect.Pseudo.xpath
495 lxml.etree._Element.xpath
496 lxml.etree._ElementTree.xpath
497 lxml.tests.test_xpathevaluator.xpath" class="py-name" href="#" onclick="return doclink('link-64', 'xpath', 'link-16');">xpath</a></tt><tt class="py-op">(</tt><tt class="py-string">'/a/b/text()'</tt><tt class="py-op">,</tt> <tt class="py-name">smart_strings</tt><tt class="py-op">=</tt><tt class="py-name">True</tt><tt class="py-op">)</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
498 <a name="L93"></a><tt class="py-lineno"> 93</tt> <tt class="py-line"> </tt>
499 <a name="L94"></a><tt class="py-lineno"> 94</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEquals</tt><tt class="py-op">(</tt><tt class="py-op">[</tt><tt class="py-string">'FooBar'</tt><tt class="py-op">,</tt> <tt class="py-string">'BarFoo'</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> </tt>
500 <a name="L95"></a><tt class="py-lineno"> 95</tt> <tt class="py-line"> <tt class="py-name">tree</tt><tt class="py-op">.</tt><tt id="link-65" class="py-name"><a title="lxml.cssselect.Attrib.xpath
501 lxml.cssselect.Class.xpath
502 lxml.cssselect.CombinedSelector.xpath
503 lxml.cssselect.Element.xpath
504 lxml.cssselect.Function.xpath
505 lxml.cssselect.Hash.xpath
506 lxml.cssselect.Or.xpath
507 lxml.cssselect.Pseudo.xpath
508 lxml.etree._Element.xpath
509 lxml.etree._ElementTree.xpath
510 lxml.tests.test_xpathevaluator.xpath" class="py-name" href="#" onclick="return doclink('link-65', 'xpath', 'link-16');">xpath</a></tt><tt class="py-op">(</tt><tt class="py-string">'/a/b/text()'</tt><tt class="py-op">,</tt> <tt class="py-name">smart_strings</tt><tt class="py-op">=</tt><tt class="py-name">False</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
511 <a name="L96"></a><tt class="py-lineno"> 96</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEquals</tt><tt class="py-op">(</tt><tt class="py-op">[</tt><tt class="py-name">False</tt><tt class="py-op">,</tt> <tt class="py-name">False</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> </tt>
512 <a name="L97"></a><tt class="py-lineno"> 97</tt> <tt class="py-line"> <tt class="py-op">[</tt><tt id="link-66" 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-66', 'hasattr', 'link-66');">hasattr</a></tt><tt class="py-op">(</tt><tt class="py-name">r</tt><tt class="py-op">,</tt> <tt class="py-string">'getparent'</tt><tt class="py-op">)</tt> <tt class="py-keyword">for</tt> <tt class="py-name">r</tt> <tt class="py-keyword">in</tt> </tt>
513 <a name="L98"></a><tt class="py-lineno"> 98</tt> <tt class="py-line"> <tt class="py-name">tree</tt><tt class="py-op">.</tt><tt id="link-67" class="py-name"><a title="lxml.cssselect.Attrib.xpath
514 lxml.cssselect.Class.xpath
515 lxml.cssselect.CombinedSelector.xpath
516 lxml.cssselect.Element.xpath
517 lxml.cssselect.Function.xpath
518 lxml.cssselect.Hash.xpath
519 lxml.cssselect.Or.xpath
520 lxml.cssselect.Pseudo.xpath
521 lxml.etree._Element.xpath
522 lxml.etree._ElementTree.xpath
523 lxml.tests.test_xpathevaluator.xpath" class="py-name" href="#" onclick="return doclink('link-67', 'xpath', 'link-16');">xpath</a></tt><tt class="py-op">(</tt><tt class="py-string">'/a/b/text()'</tt><tt class="py-op">,</tt> <tt class="py-name">smart_strings</tt><tt class="py-op">=</tt><tt class="py-name">False</tt><tt class="py-op">)</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
524 <a name="L99"></a><tt class="py-lineno"> 99</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEquals</tt><tt class="py-op">(</tt><tt class="py-op">[</tt><tt class="py-name">None</tt><tt class="py-op">,</tt> <tt class="py-name">None</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> </tt>
525 <a name="L100"></a><tt class="py-lineno">100</tt> <tt class="py-line"> <tt class="py-op">[</tt><tt class="py-name">r</tt><tt class="py-op">.</tt><tt id="link-68" class="py-name"><a title="lxml.etree._ElementUnicodeResult.attrname" class="py-name" href="#" onclick="return doclink('link-68', 'attrname', 'link-63');">attrname</a></tt> <tt class="py-keyword">for</tt> <tt class="py-name">r</tt> <tt class="py-keyword">in</tt> </tt>
526 <a name="L101"></a><tt class="py-lineno">101</tt> <tt class="py-line"> <tt class="py-name">tree</tt><tt class="py-op">.</tt><tt id="link-69" class="py-name"><a title="lxml.cssselect.Attrib.xpath
527 lxml.cssselect.Class.xpath
528 lxml.cssselect.CombinedSelector.xpath
529 lxml.cssselect.Element.xpath
530 lxml.cssselect.Function.xpath
531 lxml.cssselect.Hash.xpath
532 lxml.cssselect.Or.xpath
533 lxml.cssselect.Pseudo.xpath
534 lxml.etree._Element.xpath
535 lxml.etree._ElementTree.xpath
536 lxml.tests.test_xpathevaluator.xpath" class="py-name" href="#" onclick="return doclink('link-69', 'xpath', 'link-16');">xpath</a></tt><tt class="py-op">(</tt><tt class="py-string">'/a/b/text()'</tt><tt class="py-op">,</tt> <tt class="py-name">smart_strings</tt><tt class="py-op">=</tt><tt class="py-name">True</tt><tt class="py-op">)</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
537 </div><a name="L102"></a><tt class="py-lineno">102</tt> <tt class="py-line"> </tt>
538 <a name="ETreeXPathTestCase.test_xpath_list_unicode_text_parent"></a><div id="ETreeXPathTestCase.test_xpath_list_unicode_text_parent-def"><a name="L103"></a><tt class="py-lineno">103</tt> <a class="py-toggle" href="#" id="ETreeXPathTestCase.test_xpath_list_unicode_text_parent-toggle" onclick="return toggle('ETreeXPathTestCase.test_xpath_list_unicode_text_parent');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="lxml.tests.test_xpathevaluator.ETreeXPathTestCase-class.html#test_xpath_list_unicode_text_parent">test_xpath_list_unicode_text_parent</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
539 </div><div id="ETreeXPathTestCase.test_xpath_list_unicode_text_parent-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="ETreeXPathTestCase.test_xpath_list_unicode_text_parent-expanded"><a name="L104"></a><tt class="py-lineno">104</tt> <tt class="py-line"> <tt id="link-70" class="py-name" targets="Variable lxml.tests.test_threading.ThreadPipelineTestCase.xml=lxml.tests.test_threading.ThreadPipelineTestCase-class.html#xml"><a title="lxml.tests.test_threading.ThreadPipelineTestCase.xml" class="py-name" href="#" onclick="return doclink('link-70', 'xml', 'link-70');">xml</a></tt> <tt class="py-op">=</tt> <tt id="link-71" class="py-name"><a title="lxml.tests.common_imports._bytes" class="py-name" href="#" onclick="return doclink('link-71', '_bytes', 'link-11');">_bytes</a></tt><tt class="py-op">(</tt><tt class="py-string">'<a><b>FooBar\\u0680\\u3120</b><b>BarFoo\\u0680\\u3120</b></a>'</tt><tt class="py-op">)</tt><tt class="py-op">.</tt><tt class="py-name">decode</tt><tt class="py-op">(</tt><tt class="py-string">"unicode_escape"</tt><tt class="py-op">)</tt> </tt>
540 <a name="L105"></a><tt class="py-lineno">105</tt> <tt class="py-line"> <tt class="py-name">tree</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-72" class="py-name"><a title="lxml.cssselect.parse
541 lxml.etree._ElementTree.parse
543 lxml.html.ElementSoup.parse
544 lxml.html.html5parser.parse
546 lxml.html.soupparser.parse
548 lxml.tests.common_imports.HelperTestCase.parse" class="py-name" href="#" onclick="return doclink('link-72', 'parse', 'link-14');">parse</a></tt><tt class="py-op">(</tt><tt id="link-73" class="py-name"><a title="lxml.tests.test_threading.ThreadPipelineTestCase.xml" class="py-name" href="#" onclick="return doclink('link-73', 'xml', 'link-70');">xml</a></tt><tt class="py-op">.</tt><tt class="py-name">encode</tt><tt class="py-op">(</tt><tt class="py-string">'utf-8'</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
549 <a name="L106"></a><tt class="py-lineno">106</tt> <tt class="py-line"> <tt id="link-74" class="py-name"><a title="lxml.etree.iterparse.root" class="py-name" href="#" onclick="return doclink('link-74', 'root', 'link-35');">root</a></tt> <tt class="py-op">=</tt> <tt class="py-name">tree</tt><tt class="py-op">.</tt><tt id="link-75" class="py-name"><a title="lxml.etree._ElementTree.getroot" class="py-name" href="#" onclick="return doclink('link-75', 'getroot', 'link-36');">getroot</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
550 <a name="L107"></a><tt class="py-lineno">107</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEquals</tt><tt class="py-op">(</tt><tt class="py-op">[</tt><tt id="link-76" class="py-name"><a title="lxml.tests.common_imports._bytes" class="py-name" href="#" onclick="return doclink('link-76', '_bytes', 'link-11');">_bytes</a></tt><tt class="py-op">(</tt><tt class="py-string">'FooBar\\u0680\\u3120'</tt><tt class="py-op">)</tt><tt class="py-op">.</tt><tt class="py-name">decode</tt><tt class="py-op">(</tt><tt class="py-string">"unicode_escape"</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
551 <a name="L108"></a><tt class="py-lineno">108</tt> <tt class="py-line"> <tt id="link-77" class="py-name"><a title="lxml.tests.common_imports._bytes" class="py-name" href="#" onclick="return doclink('link-77', '_bytes', 'link-11');">_bytes</a></tt><tt class="py-op">(</tt><tt class="py-string">'BarFoo\\u0680\\u3120'</tt><tt class="py-op">)</tt><tt class="py-op">.</tt><tt class="py-name">decode</tt><tt class="py-op">(</tt><tt class="py-string">"unicode_escape"</tt><tt class="py-op">)</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> </tt>
552 <a name="L109"></a><tt class="py-lineno">109</tt> <tt class="py-line"> <tt class="py-name">tree</tt><tt class="py-op">.</tt><tt id="link-78" class="py-name"><a title="lxml.cssselect.Attrib.xpath
553 lxml.cssselect.Class.xpath
554 lxml.cssselect.CombinedSelector.xpath
555 lxml.cssselect.Element.xpath
556 lxml.cssselect.Function.xpath
557 lxml.cssselect.Hash.xpath
558 lxml.cssselect.Or.xpath
559 lxml.cssselect.Pseudo.xpath
560 lxml.etree._Element.xpath
561 lxml.etree._ElementTree.xpath
562 lxml.tests.test_xpathevaluator.xpath" class="py-name" href="#" onclick="return doclink('link-78', 'xpath', 'link-16');">xpath</a></tt><tt class="py-op">(</tt><tt class="py-string">'/a/b/text()'</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
563 <a name="L110"></a><tt class="py-lineno">110</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEquals</tt><tt class="py-op">(</tt><tt class="py-op">[</tt><tt id="link-79" class="py-name"><a title="lxml.etree.iterparse.root" class="py-name" href="#" onclick="return doclink('link-79', 'root', 'link-35');">root</a></tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> <tt id="link-80" class="py-name"><a title="lxml.etree.iterparse.root" class="py-name" href="#" onclick="return doclink('link-80', 'root', 'link-35');">root</a></tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> </tt>
564 <a name="L111"></a><tt class="py-lineno">111</tt> <tt class="py-line"> <tt class="py-op">[</tt><tt class="py-name">r</tt><tt class="py-op">.</tt><tt id="link-81" class="py-name"><a title="lxml.etree._Element.getparent
565 lxml.etree._ElementStringResult.getparent
566 lxml.etree._ElementUnicodeResult.getparent
567 lxml.etree._ReadOnlyProxy.getparent" class="py-name" href="#" onclick="return doclink('link-81', 'getparent', 'link-53');">getparent</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> <tt class="py-keyword">for</tt> <tt class="py-name">r</tt> <tt class="py-keyword">in</tt> <tt class="py-name">tree</tt><tt class="py-op">.</tt><tt id="link-82" class="py-name"><a title="lxml.cssselect.Attrib.xpath
568 lxml.cssselect.Class.xpath
569 lxml.cssselect.CombinedSelector.xpath
570 lxml.cssselect.Element.xpath
571 lxml.cssselect.Function.xpath
572 lxml.cssselect.Hash.xpath
573 lxml.cssselect.Or.xpath
574 lxml.cssselect.Pseudo.xpath
575 lxml.etree._Element.xpath
576 lxml.etree._ElementTree.xpath
577 lxml.tests.test_xpathevaluator.xpath" class="py-name" href="#" onclick="return doclink('link-82', 'xpath', 'link-16');">xpath</a></tt><tt class="py-op">(</tt><tt class="py-string">'/a/b/text()'</tt><tt class="py-op">)</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
578 </div><a name="L112"></a><tt class="py-lineno">112</tt> <tt class="py-line"> </tt>
579 <a name="ETreeXPathTestCase.test_xpath_list_attribute"></a><div id="ETreeXPathTestCase.test_xpath_list_attribute-def"><a name="L113"></a><tt class="py-lineno">113</tt> <a class="py-toggle" href="#" id="ETreeXPathTestCase.test_xpath_list_attribute-toggle" onclick="return toggle('ETreeXPathTestCase.test_xpath_list_attribute');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="lxml.tests.test_xpathevaluator.ETreeXPathTestCase-class.html#test_xpath_list_attribute">test_xpath_list_attribute</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
580 </div><div id="ETreeXPathTestCase.test_xpath_list_attribute-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="ETreeXPathTestCase.test_xpath_list_attribute-expanded"><a name="L114"></a><tt class="py-lineno">114</tt> <tt class="py-line"> <tt class="py-name">tree</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-83" class="py-name"><a title="lxml.cssselect.parse
581 lxml.etree._ElementTree.parse
583 lxml.html.ElementSoup.parse
584 lxml.html.html5parser.parse
586 lxml.html.soupparser.parse
588 lxml.tests.common_imports.HelperTestCase.parse" class="py-name" href="#" onclick="return doclink('link-83', 'parse', 'link-14');">parse</a></tt><tt class="py-op">(</tt><tt class="py-string">'<a b="B" c="C"/>'</tt><tt class="py-op">)</tt> </tt>
589 <a name="L115"></a><tt class="py-lineno">115</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEquals</tt><tt class="py-op">(</tt><tt class="py-op">[</tt><tt class="py-string">'B'</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> </tt>
590 <a name="L116"></a><tt class="py-lineno">116</tt> <tt class="py-line"> <tt class="py-name">tree</tt><tt class="py-op">.</tt><tt id="link-84" class="py-name"><a title="lxml.cssselect.Attrib.xpath
591 lxml.cssselect.Class.xpath
592 lxml.cssselect.CombinedSelector.xpath
593 lxml.cssselect.Element.xpath
594 lxml.cssselect.Function.xpath
595 lxml.cssselect.Hash.xpath
596 lxml.cssselect.Or.xpath
597 lxml.cssselect.Pseudo.xpath
598 lxml.etree._Element.xpath
599 lxml.etree._ElementTree.xpath
600 lxml.tests.test_xpathevaluator.xpath" class="py-name" href="#" onclick="return doclink('link-84', 'xpath', 'link-16');">xpath</a></tt><tt class="py-op">(</tt><tt class="py-string">'/a/@b'</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
601 </div><a name="L117"></a><tt class="py-lineno">117</tt> <tt class="py-line"> </tt>
602 <a name="ETreeXPathTestCase.test_xpath_list_attribute_parent"></a><div id="ETreeXPathTestCase.test_xpath_list_attribute_parent-def"><a name="L118"></a><tt class="py-lineno">118</tt> <a class="py-toggle" href="#" id="ETreeXPathTestCase.test_xpath_list_attribute_parent-toggle" onclick="return toggle('ETreeXPathTestCase.test_xpath_list_attribute_parent');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="lxml.tests.test_xpathevaluator.ETreeXPathTestCase-class.html#test_xpath_list_attribute_parent">test_xpath_list_attribute_parent</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
603 </div><div id="ETreeXPathTestCase.test_xpath_list_attribute_parent-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="ETreeXPathTestCase.test_xpath_list_attribute_parent-expanded"><a name="L119"></a><tt class="py-lineno">119</tt> <tt class="py-line"> <tt class="py-name">tree</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-85" class="py-name"><a title="lxml.cssselect.parse
604 lxml.etree._ElementTree.parse
606 lxml.html.ElementSoup.parse
607 lxml.html.html5parser.parse
609 lxml.html.soupparser.parse
611 lxml.tests.common_imports.HelperTestCase.parse" class="py-name" href="#" onclick="return doclink('link-85', 'parse', 'link-14');">parse</a></tt><tt class="py-op">(</tt><tt class="py-string">'<a b="BaSdFgHjKl" c="CqWeRtZuI"/>'</tt><tt class="py-op">)</tt> </tt>
612 <a name="L120"></a><tt class="py-lineno">120</tt> <tt class="py-line"> <tt class="py-name">results</tt> <tt class="py-op">=</tt> <tt class="py-name">tree</tt><tt class="py-op">.</tt><tt id="link-86" class="py-name"><a title="lxml.cssselect.Attrib.xpath
613 lxml.cssselect.Class.xpath
614 lxml.cssselect.CombinedSelector.xpath
615 lxml.cssselect.Element.xpath
616 lxml.cssselect.Function.xpath
617 lxml.cssselect.Hash.xpath
618 lxml.cssselect.Or.xpath
619 lxml.cssselect.Pseudo.xpath
620 lxml.etree._Element.xpath
621 lxml.etree._ElementTree.xpath
622 lxml.tests.test_xpathevaluator.xpath" class="py-name" href="#" onclick="return doclink('link-86', 'xpath', 'link-16');">xpath</a></tt><tt class="py-op">(</tt><tt class="py-string">'/a/@c'</tt><tt class="py-op">)</tt> </tt>
623 <a name="L121"></a><tt class="py-lineno">121</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEquals</tt><tt class="py-op">(</tt><tt class="py-number">1</tt><tt class="py-op">,</tt> <tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">results</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
624 <a name="L122"></a><tt class="py-lineno">122</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEquals</tt><tt class="py-op">(</tt><tt class="py-string">'CqWeRtZuI'</tt><tt class="py-op">,</tt> <tt class="py-name">results</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
625 <a name="L123"></a><tt class="py-lineno">123</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEquals</tt><tt class="py-op">(</tt><tt class="py-name">tree</tt><tt class="py-op">.</tt><tt id="link-87" class="py-name"><a title="lxml.etree._ElementTree.getroot" class="py-name" href="#" onclick="return doclink('link-87', 'getroot', 'link-36');">getroot</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">.</tt><tt id="link-88" 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
626 lxml.etree._Element.tag
627 lxml.etree._Entity.tag
628 lxml.etree._ProcessingInstruction.tag
629 lxml.etree._ReadOnlyProxy.tag
630 lxml.tests.test_xpathevaluator.tag
631 xml.etree.ElementTree.Element.tag" class="py-name" href="#" onclick="return doclink('link-88', 'tag', 'link-88');">tag</a></tt><tt class="py-op">,</tt> <tt class="py-name">results</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">.</tt><tt id="link-89" class="py-name"><a title="lxml.etree._Element.getparent
632 lxml.etree._ElementStringResult.getparent
633 lxml.etree._ElementUnicodeResult.getparent
634 lxml.etree._ReadOnlyProxy.getparent" class="py-name" href="#" onclick="return doclink('link-89', 'getparent', 'link-53');">getparent</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">.</tt><tt id="link-90" class="py-name"><a title="lxml.etree._Comment.tag
635 lxml.etree._Element.tag
636 lxml.etree._Entity.tag
637 lxml.etree._ProcessingInstruction.tag
638 lxml.etree._ReadOnlyProxy.tag
639 lxml.tests.test_xpathevaluator.tag
640 xml.etree.ElementTree.Element.tag" class="py-name" href="#" onclick="return doclink('link-90', 'tag', 'link-88');">tag</a></tt><tt class="py-op">)</tt> </tt>
641 </div><a name="L124"></a><tt class="py-lineno">124</tt> <tt class="py-line"> </tt>
642 <a name="ETreeXPathTestCase.test_xpath_list_attribute_parent_no_smart_strings"></a><div id="ETreeXPathTestCase.test_xpath_list_attribute_parent_no_smart_strings-def"><a name="L125"></a><tt class="py-lineno">125</tt> <a class="py-toggle" href="#" id="ETreeXPathTestCase.test_xpath_list_attribute_parent_no_smart_strings-toggle" onclick="return toggle('ETreeXPathTestCase.test_xpath_list_attribute_parent_no_smart_strings');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="lxml.tests.test_xpathevaluator.ETreeXPathTestCase-class.html#test_xpath_list_attribute_parent_no_smart_strings">test_xpath_list_attribute_parent_no_smart_strings</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
643 </div><div id="ETreeXPathTestCase.test_xpath_list_attribute_parent_no_smart_strings-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="ETreeXPathTestCase.test_xpath_list_attribute_parent_no_smart_strings-expanded"><a name="L126"></a><tt class="py-lineno">126</tt> <tt class="py-line"> <tt class="py-name">tree</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-91" class="py-name"><a title="lxml.cssselect.parse
644 lxml.etree._ElementTree.parse
646 lxml.html.ElementSoup.parse
647 lxml.html.html5parser.parse
649 lxml.html.soupparser.parse
651 lxml.tests.common_imports.HelperTestCase.parse" class="py-name" href="#" onclick="return doclink('link-91', 'parse', 'link-14');">parse</a></tt><tt class="py-op">(</tt><tt class="py-string">'<a b="BaSdFgHjKl" c="CqWeRtZuI"/>'</tt><tt class="py-op">)</tt> </tt>
652 <a name="L127"></a><tt class="py-lineno">127</tt> <tt class="py-line"> </tt>
653 <a name="L128"></a><tt class="py-lineno">128</tt> <tt class="py-line"> <tt class="py-name">results</tt> <tt class="py-op">=</tt> <tt class="py-name">tree</tt><tt class="py-op">.</tt><tt id="link-92" class="py-name"><a title="lxml.cssselect.Attrib.xpath
654 lxml.cssselect.Class.xpath
655 lxml.cssselect.CombinedSelector.xpath
656 lxml.cssselect.Element.xpath
657 lxml.cssselect.Function.xpath
658 lxml.cssselect.Hash.xpath
659 lxml.cssselect.Or.xpath
660 lxml.cssselect.Pseudo.xpath
661 lxml.etree._Element.xpath
662 lxml.etree._ElementTree.xpath
663 lxml.tests.test_xpathevaluator.xpath" class="py-name" href="#" onclick="return doclink('link-92', 'xpath', 'link-16');">xpath</a></tt><tt class="py-op">(</tt><tt class="py-string">'/a/@c'</tt><tt class="py-op">,</tt> <tt class="py-name">smart_strings</tt><tt class="py-op">=</tt><tt class="py-name">True</tt><tt class="py-op">)</tt> </tt>
664 <a name="L129"></a><tt class="py-lineno">129</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEquals</tt><tt class="py-op">(</tt><tt class="py-number">1</tt><tt class="py-op">,</tt> <tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">results</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
665 <a name="L130"></a><tt class="py-lineno">130</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEquals</tt><tt class="py-op">(</tt><tt class="py-string">'CqWeRtZuI'</tt><tt class="py-op">,</tt> <tt class="py-name">results</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
666 <a name="L131"></a><tt class="py-lineno">131</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEquals</tt><tt class="py-op">(</tt><tt class="py-string">'c'</tt><tt class="py-op">,</tt> <tt class="py-name">results</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">.</tt><tt id="link-93" class="py-name"><a title="lxml.etree._ElementUnicodeResult.attrname" class="py-name" href="#" onclick="return doclink('link-93', 'attrname', 'link-63');">attrname</a></tt><tt class="py-op">)</tt> </tt>
667 <a name="L132"></a><tt class="py-lineno">132</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEquals</tt><tt class="py-op">(</tt><tt class="py-name">tree</tt><tt class="py-op">.</tt><tt id="link-94" class="py-name"><a title="lxml.etree._ElementTree.getroot" class="py-name" href="#" onclick="return doclink('link-94', 'getroot', 'link-36');">getroot</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">.</tt><tt id="link-95" class="py-name"><a title="lxml.etree._Comment.tag
668 lxml.etree._Element.tag
669 lxml.etree._Entity.tag
670 lxml.etree._ProcessingInstruction.tag
671 lxml.etree._ReadOnlyProxy.tag
672 lxml.tests.test_xpathevaluator.tag
673 xml.etree.ElementTree.Element.tag" class="py-name" href="#" onclick="return doclink('link-95', 'tag', 'link-88');">tag</a></tt><tt class="py-op">,</tt> <tt class="py-name">results</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">.</tt><tt id="link-96" class="py-name"><a title="lxml.etree._Element.getparent
674 lxml.etree._ElementStringResult.getparent
675 lxml.etree._ElementUnicodeResult.getparent
676 lxml.etree._ReadOnlyProxy.getparent" class="py-name" href="#" onclick="return doclink('link-96', 'getparent', 'link-53');">getparent</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">.</tt><tt id="link-97" class="py-name"><a title="lxml.etree._Comment.tag
677 lxml.etree._Element.tag
678 lxml.etree._Entity.tag
679 lxml.etree._ProcessingInstruction.tag
680 lxml.etree._ReadOnlyProxy.tag
681 lxml.tests.test_xpathevaluator.tag
682 xml.etree.ElementTree.Element.tag" class="py-name" href="#" onclick="return doclink('link-97', 'tag', 'link-88');">tag</a></tt><tt class="py-op">)</tt> </tt>
683 <a name="L133"></a><tt class="py-lineno">133</tt> <tt class="py-line"> </tt>
684 <a name="L134"></a><tt class="py-lineno">134</tt> <tt class="py-line"> <tt class="py-name">results</tt> <tt class="py-op">=</tt> <tt class="py-name">tree</tt><tt class="py-op">.</tt><tt id="link-98" class="py-name"><a title="lxml.cssselect.Attrib.xpath
685 lxml.cssselect.Class.xpath
686 lxml.cssselect.CombinedSelector.xpath
687 lxml.cssselect.Element.xpath
688 lxml.cssselect.Function.xpath
689 lxml.cssselect.Hash.xpath
690 lxml.cssselect.Or.xpath
691 lxml.cssselect.Pseudo.xpath
692 lxml.etree._Element.xpath
693 lxml.etree._ElementTree.xpath
694 lxml.tests.test_xpathevaluator.xpath" class="py-name" href="#" onclick="return doclink('link-98', 'xpath', 'link-16');">xpath</a></tt><tt class="py-op">(</tt><tt class="py-string">'/a/@c'</tt><tt class="py-op">,</tt> <tt class="py-name">smart_strings</tt><tt class="py-op">=</tt><tt class="py-name">False</tt><tt class="py-op">)</tt> </tt>
695 <a name="L135"></a><tt class="py-lineno">135</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEquals</tt><tt class="py-op">(</tt><tt class="py-number">1</tt><tt class="py-op">,</tt> <tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">results</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
696 <a name="L136"></a><tt class="py-lineno">136</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEquals</tt><tt class="py-op">(</tt><tt class="py-string">'CqWeRtZuI'</tt><tt class="py-op">,</tt> <tt class="py-name">results</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
697 <a name="L137"></a><tt class="py-lineno">137</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEquals</tt><tt class="py-op">(</tt><tt class="py-name">False</tt><tt class="py-op">,</tt> <tt id="link-99" class="py-name"><a title="lxml.objectify.ObjectPath.hasattr" class="py-name" href="#" onclick="return doclink('link-99', 'hasattr', 'link-66');">hasattr</a></tt><tt class="py-op">(</tt><tt class="py-name">results</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> <tt class="py-string">'getparent'</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
698 <a name="L138"></a><tt class="py-lineno">138</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEquals</tt><tt class="py-op">(</tt><tt class="py-name">False</tt><tt class="py-op">,</tt> <tt id="link-100" class="py-name"><a title="lxml.objectify.ObjectPath.hasattr" class="py-name" href="#" onclick="return doclink('link-100', 'hasattr', 'link-66');">hasattr</a></tt><tt class="py-op">(</tt><tt class="py-name">results</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> <tt class="py-string">'attrname'</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
699 </div><a name="L139"></a><tt class="py-lineno">139</tt> <tt class="py-line"> </tt>
700 <a name="ETreeXPathTestCase.test_xpath_text_from_other_document"></a><div id="ETreeXPathTestCase.test_xpath_text_from_other_document-def"><a name="L140"></a><tt class="py-lineno">140</tt> <a class="py-toggle" href="#" id="ETreeXPathTestCase.test_xpath_text_from_other_document-toggle" onclick="return toggle('ETreeXPathTestCase.test_xpath_text_from_other_document');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="lxml.tests.test_xpathevaluator.ETreeXPathTestCase-class.html#test_xpath_text_from_other_document">test_xpath_text_from_other_document</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
701 </div><div id="ETreeXPathTestCase.test_xpath_text_from_other_document-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="ETreeXPathTestCase.test_xpath_text_from_other_document-expanded"><a name="L141"></a><tt class="py-lineno">141</tt> <tt class="py-line"> <tt class="py-name">xml_data</tt> <tt class="py-op">=</tt> <tt class="py-string">'''</tt> </tt>
702 <a name="L142"></a><tt class="py-lineno">142</tt> <tt class="py-line"><tt class="py-string"> <table></tt> </tt>
703 <a name="L143"></a><tt class="py-lineno">143</tt> <tt class="py-line"><tt class="py-string"> <item xml:id="k1"><value>v1</value></item></tt> </tt>
704 <a name="L144"></a><tt class="py-lineno">144</tt> <tt class="py-line"><tt class="py-string"> <item xml:id="k2"><value>v2</value></item></tt> </tt>
705 <a name="L145"></a><tt class="py-lineno">145</tt> <tt class="py-line"><tt class="py-string"> </table></tt> </tt>
706 <a name="L146"></a><tt class="py-lineno">146</tt> <tt class="py-line"><tt class="py-string"> '''</tt> </tt>
707 <a name="L147"></a><tt class="py-lineno">147</tt> <tt class="py-line"> </tt>
708 <a name="L148"></a><tt class="py-lineno">148</tt> <tt class="py-line"> <tt class="py-keyword">def</tt> <tt class="py-def-name">lookup</tt><tt class="py-op">(</tt><tt class="py-param">dummy</tt><tt class="py-op">,</tt> <tt class="py-param">id</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
709 <a name="L149"></a><tt class="py-lineno">149</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt id="link-101" class="py-name"><a title="lxml.etree
710 lxml.sax.ElementTreeContentHandler.etree
711 lxml.tests.test_elementtree.CElementTreeTestCase.etree
712 lxml.tests.test_elementtree.ETreeTestCaseBase.etree
713 lxml.tests.test_io.IOTestCaseBase.etree" class="py-name" href="#" onclick="return doclink('link-101', 'etree', 'link-9');">etree</a></tt><tt class="py-op">.</tt><tt id="link-102" class="py-name" targets="Function lxml.etree.XML()=lxml.etree-module.html#XML,Function lxml.objectify.XML()=lxml.objectify-module.html#XML,Method lxml.tests.test_objectify.ObjectifyTestCase.XML()=lxml.tests.test_objectify.ObjectifyTestCase-class.html#XML,Method lxml.tests.test_pyclasslookup.PyClassLookupTestCase.XML()=lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html#XML"><a title="lxml.etree.XML
715 lxml.tests.test_objectify.ObjectifyTestCase.XML
716 lxml.tests.test_pyclasslookup.PyClassLookupTestCase.XML" class="py-name" href="#" onclick="return doclink('link-102', 'XML', 'link-102');">XML</a></tt><tt class="py-op">(</tt><tt class="py-name">xml_data</tt><tt class="py-op">)</tt><tt class="py-op">.</tt><tt id="link-103" class="py-name"><a title="lxml.cssselect.Attrib.xpath
717 lxml.cssselect.Class.xpath
718 lxml.cssselect.CombinedSelector.xpath
719 lxml.cssselect.Element.xpath
720 lxml.cssselect.Function.xpath
721 lxml.cssselect.Hash.xpath
722 lxml.cssselect.Or.xpath
723 lxml.cssselect.Pseudo.xpath
724 lxml.etree._Element.xpath
725 lxml.etree._ElementTree.xpath
726 lxml.tests.test_xpathevaluator.xpath" class="py-name" href="#" onclick="return doclink('link-103', 'xpath', 'link-16');">xpath</a></tt><tt class="py-op">(</tt><tt class="py-string">'id(%r)'</tt> <tt class="py-op">%</tt> <tt class="py-name">id</tt><tt class="py-op">)</tt> </tt>
727 </div><a name="L150"></a><tt class="py-lineno">150</tt> <tt class="py-line"> <tt class="py-name">functions</tt> <tt class="py-op">=</tt> <tt class="py-op">{</tt><tt class="py-op">(</tt><tt class="py-name">None</tt><tt class="py-op">,</tt> <tt class="py-string">'lookup'</tt><tt class="py-op">)</tt> <tt class="py-op">:</tt> <tt id="link-104" class="py-name" targets="Method lxml.etree.CustomElementClassLookup.lookup()=lxml.etree.CustomElementClassLookup-class.html#lookup,Method lxml.etree.PythonElementClassLookup.lookup()=lxml.etree.PythonElementClassLookup-class.html#lookup,Method lxml.html.HtmlElementClassLookup.lookup()=lxml.html.HtmlElementClassLookup-class.html#lookup"><a title="lxml.etree.CustomElementClassLookup.lookup
728 lxml.etree.PythonElementClassLookup.lookup
729 lxml.html.HtmlElementClassLookup.lookup" class="py-name" href="#" onclick="return doclink('link-104', 'lookup', 'link-104');">lookup</a></tt><tt class="py-op">}</tt> </tt>
730 <a name="L151"></a><tt class="py-lineno">151</tt> <tt class="py-line"> </tt>
731 <a name="L152"></a><tt class="py-lineno">152</tt> <tt class="py-line"> <tt id="link-105" class="py-name"><a title="lxml.etree.iterparse.root" class="py-name" href="#" onclick="return doclink('link-105', 'root', 'link-35');">root</a></tt> <tt class="py-op">=</tt> <tt id="link-106" class="py-name"><a title="lxml.etree
732 lxml.sax.ElementTreeContentHandler.etree
733 lxml.tests.test_elementtree.CElementTreeTestCase.etree
734 lxml.tests.test_elementtree.ETreeTestCaseBase.etree
735 lxml.tests.test_io.IOTestCaseBase.etree" class="py-name" href="#" onclick="return doclink('link-106', 'etree', 'link-9');">etree</a></tt><tt class="py-op">.</tt><tt id="link-107" class="py-name"><a title="lxml.etree.XML
737 lxml.tests.test_objectify.ObjectifyTestCase.XML
738 lxml.tests.test_pyclasslookup.PyClassLookupTestCase.XML" class="py-name" href="#" onclick="return doclink('link-107', 'XML', 'link-102');">XML</a></tt><tt class="py-op">(</tt><tt class="py-string">'<dummy/>'</tt><tt class="py-op">)</tt> </tt>
739 <a name="L153"></a><tt class="py-lineno">153</tt> <tt class="py-line"> <tt id="link-108" class="py-name" targets="Method lxml.etree._Attrib.values()=lxml.etree._Attrib-class.html#values,Method lxml.etree._Element.values()=lxml.etree._Element-class.html#values,Method lxml.etree._IDDict.values()=lxml.etree._IDDict-class.html#values,Method lxml.etree._ReadOnlyElementProxy.values()=lxml.etree._ReadOnlyElementProxy-class.html#values,Method lxml.etree.__ContentOnlyElement.values()=lxml.etree.__ContentOnlyElement-class.html#values"><a title="lxml.etree._Attrib.values
740 lxml.etree._Element.values
741 lxml.etree._IDDict.values
742 lxml.etree._ReadOnlyElementProxy.values
743 lxml.etree.__ContentOnlyElement.values" class="py-name" href="#" onclick="return doclink('link-108', 'values', 'link-108');">values</a></tt> <tt class="py-op">=</tt> <tt id="link-109" class="py-name"><a title="lxml.etree.iterparse.root" class="py-name" href="#" onclick="return doclink('link-109', 'root', 'link-35');">root</a></tt><tt class="py-op">.</tt><tt id="link-110" class="py-name"><a title="lxml.cssselect.Attrib.xpath
744 lxml.cssselect.Class.xpath
745 lxml.cssselect.CombinedSelector.xpath
746 lxml.cssselect.Element.xpath
747 lxml.cssselect.Function.xpath
748 lxml.cssselect.Hash.xpath
749 lxml.cssselect.Or.xpath
750 lxml.cssselect.Pseudo.xpath
751 lxml.etree._Element.xpath
752 lxml.etree._ElementTree.xpath
753 lxml.tests.test_xpathevaluator.xpath" class="py-name" href="#" onclick="return doclink('link-110', 'xpath', 'link-16');">xpath</a></tt><tt class="py-op">(</tt><tt class="py-string">"lookup('k1')/value/text()"</tt><tt class="py-op">,</tt> </tt>
754 <a name="L154"></a><tt class="py-lineno">154</tt> <tt class="py-line"> <tt class="py-name">extensions</tt><tt class="py-op">=</tt><tt class="py-name">functions</tt><tt class="py-op">)</tt> </tt>
755 <a name="L155"></a><tt class="py-lineno">155</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEquals</tt><tt class="py-op">(</tt><tt class="py-op">[</tt><tt class="py-string">'v1'</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> <tt id="link-111" class="py-name"><a title="lxml.etree._Attrib.values
756 lxml.etree._Element.values
757 lxml.etree._IDDict.values
758 lxml.etree._ReadOnlyElementProxy.values
759 lxml.etree.__ContentOnlyElement.values" class="py-name" href="#" onclick="return doclink('link-111', 'values', 'link-108');">values</a></tt><tt class="py-op">)</tt> </tt>
760 <a name="L156"></a><tt class="py-lineno">156</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEquals</tt><tt class="py-op">(</tt><tt class="py-string">'value'</tt><tt class="py-op">,</tt> <tt id="link-112" class="py-name"><a title="lxml.etree._Attrib.values
761 lxml.etree._Element.values
762 lxml.etree._IDDict.values
763 lxml.etree._ReadOnlyElementProxy.values
764 lxml.etree.__ContentOnlyElement.values" class="py-name" href="#" onclick="return doclink('link-112', 'values', 'link-108');">values</a></tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">.</tt><tt id="link-113" class="py-name"><a title="lxml.etree._Element.getparent
765 lxml.etree._ElementStringResult.getparent
766 lxml.etree._ElementUnicodeResult.getparent
767 lxml.etree._ReadOnlyProxy.getparent" class="py-name" href="#" onclick="return doclink('link-113', 'getparent', 'link-53');">getparent</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">.</tt><tt id="link-114" class="py-name"><a title="lxml.etree._Comment.tag
768 lxml.etree._Element.tag
769 lxml.etree._Entity.tag
770 lxml.etree._ProcessingInstruction.tag
771 lxml.etree._ReadOnlyProxy.tag
772 lxml.tests.test_xpathevaluator.tag
773 xml.etree.ElementTree.Element.tag" class="py-name" href="#" onclick="return doclink('link-114', 'tag', 'link-88');">tag</a></tt><tt class="py-op">)</tt> </tt>
774 </div><a name="L157"></a><tt class="py-lineno">157</tt> <tt class="py-line"> </tt>
775 <a name="ETreeXPathTestCase.test_xpath_list_comment"></a><div id="ETreeXPathTestCase.test_xpath_list_comment-def"><a name="L158"></a><tt class="py-lineno">158</tt> <a class="py-toggle" href="#" id="ETreeXPathTestCase.test_xpath_list_comment-toggle" onclick="return toggle('ETreeXPathTestCase.test_xpath_list_comment');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="lxml.tests.test_xpathevaluator.ETreeXPathTestCase-class.html#test_xpath_list_comment">test_xpath_list_comment</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
776 </div><div id="ETreeXPathTestCase.test_xpath_list_comment-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="ETreeXPathTestCase.test_xpath_list_comment-expanded"><a name="L159"></a><tt class="py-lineno">159</tt> <tt class="py-line"> <tt class="py-name">tree</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-115" class="py-name"><a title="lxml.cssselect.parse
777 lxml.etree._ElementTree.parse
779 lxml.html.ElementSoup.parse
780 lxml.html.html5parser.parse
782 lxml.html.soupparser.parse
784 lxml.tests.common_imports.HelperTestCase.parse" class="py-name" href="#" onclick="return doclink('link-115', 'parse', 'link-14');">parse</a></tt><tt class="py-op">(</tt><tt class="py-string">'<a><!-- Foo --></a>'</tt><tt class="py-op">)</tt> </tt>
785 <a name="L160"></a><tt class="py-lineno">160</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEquals</tt><tt class="py-op">(</tt><tt class="py-op">[</tt><tt class="py-string">'<!-- Foo -->'</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> </tt>
786 <a name="L161"></a><tt class="py-lineno">161</tt> <tt class="py-line"> <tt class="py-name">list</tt><tt class="py-op">(</tt><tt class="py-name">map</tt><tt class="py-op">(</tt><tt class="py-name">repr</tt><tt class="py-op">,</tt> <tt class="py-name">tree</tt><tt class="py-op">.</tt><tt id="link-116" class="py-name"><a title="lxml.cssselect.Attrib.xpath
787 lxml.cssselect.Class.xpath
788 lxml.cssselect.CombinedSelector.xpath
789 lxml.cssselect.Element.xpath
790 lxml.cssselect.Function.xpath
791 lxml.cssselect.Hash.xpath
792 lxml.cssselect.Or.xpath
793 lxml.cssselect.Pseudo.xpath
794 lxml.etree._Element.xpath
795 lxml.etree._ElementTree.xpath
796 lxml.tests.test_xpathevaluator.xpath" class="py-name" href="#" onclick="return doclink('link-116', 'xpath', 'link-16');">xpath</a></tt><tt class="py-op">(</tt><tt class="py-string">'/a/node()'</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
797 </div><a name="L162"></a><tt class="py-lineno">162</tt> <tt class="py-line"> </tt>
798 <a name="ETreeXPathTestCase.test_rel_xpath_boolean"></a><div id="ETreeXPathTestCase.test_rel_xpath_boolean-def"><a name="L163"></a><tt class="py-lineno">163</tt> <a class="py-toggle" href="#" id="ETreeXPathTestCase.test_rel_xpath_boolean-toggle" onclick="return toggle('ETreeXPathTestCase.test_rel_xpath_boolean');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="lxml.tests.test_xpathevaluator.ETreeXPathTestCase-class.html#test_rel_xpath_boolean">test_rel_xpath_boolean</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
799 </div><div id="ETreeXPathTestCase.test_rel_xpath_boolean-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="ETreeXPathTestCase.test_rel_xpath_boolean-expanded"><a name="L164"></a><tt class="py-lineno">164</tt> <tt class="py-line"> <tt id="link-117" class="py-name"><a title="lxml.etree.iterparse.root" class="py-name" href="#" onclick="return doclink('link-117', 'root', 'link-35');">root</a></tt> <tt class="py-op">=</tt> <tt id="link-118" class="py-name"><a title="lxml.etree
800 lxml.sax.ElementTreeContentHandler.etree
801 lxml.tests.test_elementtree.CElementTreeTestCase.etree
802 lxml.tests.test_elementtree.ETreeTestCaseBase.etree
803 lxml.tests.test_io.IOTestCaseBase.etree" class="py-name" href="#" onclick="return doclink('link-118', 'etree', 'link-9');">etree</a></tt><tt class="py-op">.</tt><tt id="link-119" class="py-name"><a title="lxml.etree.XML
805 lxml.tests.test_objectify.ObjectifyTestCase.XML
806 lxml.tests.test_pyclasslookup.PyClassLookupTestCase.XML" class="py-name" href="#" onclick="return doclink('link-119', 'XML', 'link-102');">XML</a></tt><tt class="py-op">(</tt><tt class="py-string">'<a><b><c/></b></a>'</tt><tt class="py-op">)</tt> </tt>
807 <a name="L165"></a><tt class="py-lineno">165</tt> <tt class="py-line"> <tt class="py-name">el</tt> <tt class="py-op">=</tt> <tt id="link-120" class="py-name"><a title="lxml.etree.iterparse.root" class="py-name" href="#" onclick="return doclink('link-120', 'root', 'link-35');">root</a></tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt> </tt>
808 <a name="L166"></a><tt class="py-lineno">166</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-121" class="py-name"><a title="lxml.etree._Validator.assert_" class="py-name" href="#" onclick="return doclink('link-121', 'assert_', 'link-15');">assert_</a></tt><tt class="py-op">(</tt><tt class="py-name">el</tt><tt class="py-op">.</tt><tt id="link-122" class="py-name"><a title="lxml.cssselect.Attrib.xpath
809 lxml.cssselect.Class.xpath
810 lxml.cssselect.CombinedSelector.xpath
811 lxml.cssselect.Element.xpath
812 lxml.cssselect.Function.xpath
813 lxml.cssselect.Hash.xpath
814 lxml.cssselect.Or.xpath
815 lxml.cssselect.Pseudo.xpath
816 lxml.etree._Element.xpath
817 lxml.etree._ElementTree.xpath
818 lxml.tests.test_xpathevaluator.xpath" class="py-name" href="#" onclick="return doclink('link-122', 'xpath', 'link-16');">xpath</a></tt><tt class="py-op">(</tt><tt class="py-string">'boolean(c)'</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
819 <a name="L167"></a><tt class="py-lineno">167</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-123" class="py-name"><a title="lxml.etree._Validator.assert_" class="py-name" href="#" onclick="return doclink('link-123', 'assert_', 'link-15');">assert_</a></tt><tt class="py-op">(</tt><tt class="py-keyword">not</tt> <tt class="py-name">el</tt><tt class="py-op">.</tt><tt id="link-124" class="py-name"><a title="lxml.cssselect.Attrib.xpath
820 lxml.cssselect.Class.xpath
821 lxml.cssselect.CombinedSelector.xpath
822 lxml.cssselect.Element.xpath
823 lxml.cssselect.Function.xpath
824 lxml.cssselect.Hash.xpath
825 lxml.cssselect.Or.xpath
826 lxml.cssselect.Pseudo.xpath
827 lxml.etree._Element.xpath
828 lxml.etree._ElementTree.xpath
829 lxml.tests.test_xpathevaluator.xpath" class="py-name" href="#" onclick="return doclink('link-124', 'xpath', 'link-16');">xpath</a></tt><tt class="py-op">(</tt><tt class="py-string">'boolean(d)'</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
830 </div><a name="L168"></a><tt class="py-lineno">168</tt> <tt class="py-line"> </tt>
831 <a name="ETreeXPathTestCase.test_rel_xpath_list_elements"></a><div id="ETreeXPathTestCase.test_rel_xpath_list_elements-def"><a name="L169"></a><tt class="py-lineno">169</tt> <a class="py-toggle" href="#" id="ETreeXPathTestCase.test_rel_xpath_list_elements-toggle" onclick="return toggle('ETreeXPathTestCase.test_rel_xpath_list_elements');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="lxml.tests.test_xpathevaluator.ETreeXPathTestCase-class.html#test_rel_xpath_list_elements">test_rel_xpath_list_elements</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
832 </div><div id="ETreeXPathTestCase.test_rel_xpath_list_elements-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="ETreeXPathTestCase.test_rel_xpath_list_elements-expanded"><a name="L170"></a><tt class="py-lineno">170</tt> <tt class="py-line"> <tt class="py-name">tree</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-125" class="py-name"><a title="lxml.cssselect.parse
833 lxml.etree._ElementTree.parse
835 lxml.html.ElementSoup.parse
836 lxml.html.html5parser.parse
838 lxml.html.soupparser.parse
840 lxml.tests.common_imports.HelperTestCase.parse" class="py-name" href="#" onclick="return doclink('link-125', 'parse', 'link-14');">parse</a></tt><tt class="py-op">(</tt><tt class="py-string">'<a><c><b>Foo</b><b>Bar</b></c><c><b>Hey</b></c></a>'</tt><tt class="py-op">)</tt> </tt>
841 <a name="L171"></a><tt class="py-lineno">171</tt> <tt class="py-line"> <tt id="link-126" class="py-name"><a title="lxml.etree.iterparse.root" class="py-name" href="#" onclick="return doclink('link-126', 'root', 'link-35');">root</a></tt> <tt class="py-op">=</tt> <tt class="py-name">tree</tt><tt class="py-op">.</tt><tt id="link-127" class="py-name"><a title="lxml.etree._ElementTree.getroot" class="py-name" href="#" onclick="return doclink('link-127', 'getroot', 'link-36');">getroot</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
842 <a name="L172"></a><tt class="py-lineno">172</tt> <tt class="py-line"> <tt class="py-name">c</tt> <tt class="py-op">=</tt> <tt id="link-128" class="py-name"><a title="lxml.etree.iterparse.root" class="py-name" href="#" onclick="return doclink('link-128', 'root', 'link-35');">root</a></tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt> </tt>
843 <a name="L173"></a><tt class="py-lineno">173</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEquals</tt><tt class="py-op">(</tt><tt class="py-op">[</tt><tt class="py-name">c</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> <tt class="py-name">c</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> </tt>
844 <a name="L174"></a><tt class="py-lineno">174</tt> <tt class="py-line"> <tt class="py-name">c</tt><tt class="py-op">.</tt><tt id="link-129" class="py-name"><a title="lxml.cssselect.Attrib.xpath
845 lxml.cssselect.Class.xpath
846 lxml.cssselect.CombinedSelector.xpath
847 lxml.cssselect.Element.xpath
848 lxml.cssselect.Function.xpath
849 lxml.cssselect.Hash.xpath
850 lxml.cssselect.Or.xpath
851 lxml.cssselect.Pseudo.xpath
852 lxml.etree._Element.xpath
853 lxml.etree._ElementTree.xpath
854 lxml.tests.test_xpathevaluator.xpath" class="py-name" href="#" onclick="return doclink('link-129', 'xpath', 'link-16');">xpath</a></tt><tt class="py-op">(</tt><tt class="py-string">'b'</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
855 <a name="L175"></a><tt class="py-lineno">175</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEquals</tt><tt class="py-op">(</tt><tt class="py-op">[</tt><tt class="py-name">c</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> <tt class="py-name">c</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> <tt id="link-130" class="py-name"><a title="lxml.etree.iterparse.root" class="py-name" href="#" onclick="return doclink('link-130', 'root', 'link-35');">root</a></tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> </tt>
856 <a name="L176"></a><tt class="py-lineno">176</tt> <tt class="py-line"> <tt class="py-name">c</tt><tt class="py-op">.</tt><tt id="link-131" class="py-name"><a title="lxml.cssselect.Attrib.xpath
857 lxml.cssselect.Class.xpath
858 lxml.cssselect.CombinedSelector.xpath
859 lxml.cssselect.Element.xpath
860 lxml.cssselect.Function.xpath
861 lxml.cssselect.Hash.xpath
862 lxml.cssselect.Or.xpath
863 lxml.cssselect.Pseudo.xpath
864 lxml.etree._Element.xpath
865 lxml.etree._ElementTree.xpath
866 lxml.tests.test_xpathevaluator.xpath" class="py-name" href="#" onclick="return doclink('link-131', 'xpath', 'link-16');">xpath</a></tt><tt class="py-op">(</tt><tt class="py-string">'//b'</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
867 </div><a name="L177"></a><tt class="py-lineno">177</tt> <tt class="py-line"> </tt>
868 <a name="ETreeXPathTestCase.test_xpath_ns"></a><div id="ETreeXPathTestCase.test_xpath_ns-def"><a name="L178"></a><tt class="py-lineno">178</tt> <a class="py-toggle" href="#" id="ETreeXPathTestCase.test_xpath_ns-toggle" onclick="return toggle('ETreeXPathTestCase.test_xpath_ns');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="lxml.tests.test_xpathevaluator.ETreeXPathTestCase-class.html#test_xpath_ns">test_xpath_ns</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
869 </div><div id="ETreeXPathTestCase.test_xpath_ns-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="ETreeXPathTestCase.test_xpath_ns-expanded"><a name="L179"></a><tt class="py-lineno">179</tt> <tt class="py-line"> <tt class="py-name">tree</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-132" class="py-name"><a title="lxml.cssselect.parse
870 lxml.etree._ElementTree.parse
872 lxml.html.ElementSoup.parse
873 lxml.html.html5parser.parse
875 lxml.html.soupparser.parse
877 lxml.tests.common_imports.HelperTestCase.parse" class="py-name" href="#" onclick="return doclink('link-132', 'parse', 'link-14');">parse</a></tt><tt class="py-op">(</tt><tt class="py-string">'<a xmlns="uri:a"><b></b></a>'</tt><tt class="py-op">)</tt> </tt>
878 <a name="L180"></a><tt class="py-lineno">180</tt> <tt class="py-line"> <tt id="link-133" class="py-name"><a title="lxml.etree.iterparse.root" class="py-name" href="#" onclick="return doclink('link-133', 'root', 'link-35');">root</a></tt> <tt class="py-op">=</tt> <tt class="py-name">tree</tt><tt class="py-op">.</tt><tt id="link-134" class="py-name"><a title="lxml.etree._ElementTree.getroot" class="py-name" href="#" onclick="return doclink('link-134', 'getroot', 'link-36');">getroot</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
879 <a name="L181"></a><tt class="py-lineno">181</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEquals</tt><tt class="py-op">(</tt> </tt>
880 <a name="L182"></a><tt class="py-lineno">182</tt> <tt class="py-line"> <tt class="py-op">[</tt><tt id="link-135" class="py-name"><a title="lxml.etree.iterparse.root" class="py-name" href="#" onclick="return doclink('link-135', 'root', 'link-35');">root</a></tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> </tt>
881 <a name="L183"></a><tt class="py-lineno">183</tt> <tt class="py-line"> <tt class="py-name">tree</tt><tt class="py-op">.</tt><tt id="link-136" class="py-name"><a title="lxml.cssselect.Attrib.xpath
882 lxml.cssselect.Class.xpath
883 lxml.cssselect.CombinedSelector.xpath
884 lxml.cssselect.Element.xpath
885 lxml.cssselect.Function.xpath
886 lxml.cssselect.Hash.xpath
887 lxml.cssselect.Or.xpath
888 lxml.cssselect.Pseudo.xpath
889 lxml.etree._Element.xpath
890 lxml.etree._ElementTree.xpath
891 lxml.tests.test_xpathevaluator.xpath" class="py-name" href="#" onclick="return doclink('link-136', 'xpath', 'link-16');">xpath</a></tt><tt class="py-op">(</tt><tt class="py-string">'//foo:b'</tt><tt class="py-op">,</tt> <tt class="py-name">namespaces</tt><tt class="py-op">=</tt><tt class="py-op">{</tt><tt class="py-string">'foo'</tt><tt class="py-op">:</tt> <tt class="py-string">'uri:a'</tt><tt class="py-op">}</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
892 <a name="L184"></a><tt class="py-lineno">184</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEquals</tt><tt class="py-op">(</tt> </tt>
893 <a name="L185"></a><tt class="py-lineno">185</tt> <tt class="py-line"> <tt class="py-op">[</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> </tt>
894 <a name="L186"></a><tt class="py-lineno">186</tt> <tt class="py-line"> <tt class="py-name">tree</tt><tt class="py-op">.</tt><tt id="link-137" class="py-name"><a title="lxml.cssselect.Attrib.xpath
895 lxml.cssselect.Class.xpath
896 lxml.cssselect.CombinedSelector.xpath
897 lxml.cssselect.Element.xpath
898 lxml.cssselect.Function.xpath
899 lxml.cssselect.Hash.xpath
900 lxml.cssselect.Or.xpath
901 lxml.cssselect.Pseudo.xpath
902 lxml.etree._Element.xpath
903 lxml.etree._ElementTree.xpath
904 lxml.tests.test_xpathevaluator.xpath" class="py-name" href="#" onclick="return doclink('link-137', 'xpath', 'link-16');">xpath</a></tt><tt class="py-op">(</tt><tt class="py-string">'//foo:b'</tt><tt class="py-op">,</tt> <tt class="py-name">namespaces</tt><tt class="py-op">=</tt><tt class="py-op">{</tt><tt class="py-string">'foo'</tt><tt class="py-op">:</tt> <tt class="py-string">'uri:c'</tt><tt class="py-op">}</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
905 <a name="L187"></a><tt class="py-lineno">187</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEquals</tt><tt class="py-op">(</tt> </tt>
906 <a name="L188"></a><tt class="py-lineno">188</tt> <tt class="py-line"> <tt class="py-op">[</tt><tt id="link-138" class="py-name"><a title="lxml.etree.iterparse.root" class="py-name" href="#" onclick="return doclink('link-138', 'root', 'link-35');">root</a></tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> </tt>
907 <a name="L189"></a><tt class="py-lineno">189</tt> <tt class="py-line"> <tt id="link-139" class="py-name"><a title="lxml.etree.iterparse.root" class="py-name" href="#" onclick="return doclink('link-139', 'root', 'link-35');">root</a></tt><tt class="py-op">.</tt><tt id="link-140" class="py-name"><a title="lxml.cssselect.Attrib.xpath
908 lxml.cssselect.Class.xpath
909 lxml.cssselect.CombinedSelector.xpath
910 lxml.cssselect.Element.xpath
911 lxml.cssselect.Function.xpath
912 lxml.cssselect.Hash.xpath
913 lxml.cssselect.Or.xpath
914 lxml.cssselect.Pseudo.xpath
915 lxml.etree._Element.xpath
916 lxml.etree._ElementTree.xpath
917 lxml.tests.test_xpathevaluator.xpath" class="py-name" href="#" onclick="return doclink('link-140', 'xpath', 'link-16');">xpath</a></tt><tt class="py-op">(</tt><tt class="py-string">'//baz:b'</tt><tt class="py-op">,</tt> <tt class="py-name">namespaces</tt><tt class="py-op">=</tt><tt class="py-op">{</tt><tt class="py-string">'baz'</tt><tt class="py-op">:</tt> <tt class="py-string">'uri:a'</tt><tt class="py-op">}</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
918 </div><a name="L190"></a><tt class="py-lineno">190</tt> <tt class="py-line"> </tt>
919 <a name="ETreeXPathTestCase.test_xpath_ns_none"></a><div id="ETreeXPathTestCase.test_xpath_ns_none-def"><a name="L191"></a><tt class="py-lineno">191</tt> <a class="py-toggle" href="#" id="ETreeXPathTestCase.test_xpath_ns_none-toggle" onclick="return toggle('ETreeXPathTestCase.test_xpath_ns_none');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="lxml.tests.test_xpathevaluator.ETreeXPathTestCase-class.html#test_xpath_ns_none">test_xpath_ns_none</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
920 </div><div id="ETreeXPathTestCase.test_xpath_ns_none-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="ETreeXPathTestCase.test_xpath_ns_none-expanded"><a name="L192"></a><tt class="py-lineno">192</tt> <tt class="py-line"> <tt class="py-name">tree</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-141" class="py-name"><a title="lxml.cssselect.parse
921 lxml.etree._ElementTree.parse
923 lxml.html.ElementSoup.parse
924 lxml.html.html5parser.parse
926 lxml.html.soupparser.parse
928 lxml.tests.common_imports.HelperTestCase.parse" class="py-name" href="#" onclick="return doclink('link-141', 'parse', 'link-14');">parse</a></tt><tt class="py-op">(</tt><tt class="py-string">'<a xmlns="uri:a"><b></b></a>'</tt><tt class="py-op">)</tt> </tt>
929 <a name="L193"></a><tt class="py-lineno">193</tt> <tt class="py-line"> <tt id="link-142" class="py-name"><a title="lxml.etree.iterparse.root" class="py-name" href="#" onclick="return doclink('link-142', 'root', 'link-35');">root</a></tt> <tt class="py-op">=</tt> <tt class="py-name">tree</tt><tt class="py-op">.</tt><tt id="link-143" class="py-name"><a title="lxml.etree._ElementTree.getroot" class="py-name" href="#" onclick="return doclink('link-143', 'getroot', 'link-36');">getroot</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
930 <a name="L194"></a><tt class="py-lineno">194</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertRaises</tt><tt class="py-op">(</tt> </tt>
931 <a name="L195"></a><tt class="py-lineno">195</tt> <tt class="py-line"> <tt class="py-name">TypeError</tt><tt class="py-op">,</tt> </tt>
932 <a name="L196"></a><tt class="py-lineno">196</tt> <tt class="py-line"> <tt id="link-144" class="py-name"><a title="lxml.etree.iterparse.root" class="py-name" href="#" onclick="return doclink('link-144', 'root', 'link-35');">root</a></tt><tt class="py-op">.</tt><tt id="link-145" class="py-name"><a title="lxml.cssselect.Attrib.xpath
933 lxml.cssselect.Class.xpath
934 lxml.cssselect.CombinedSelector.xpath
935 lxml.cssselect.Element.xpath
936 lxml.cssselect.Function.xpath
937 lxml.cssselect.Hash.xpath
938 lxml.cssselect.Or.xpath
939 lxml.cssselect.Pseudo.xpath
940 lxml.etree._Element.xpath
941 lxml.etree._ElementTree.xpath
942 lxml.tests.test_xpathevaluator.xpath" class="py-name" href="#" onclick="return doclink('link-145', 'xpath', 'link-16');">xpath</a></tt><tt class="py-op">,</tt> <tt class="py-string">'//b'</tt><tt class="py-op">,</tt> <tt class="py-name">namespaces</tt><tt class="py-op">=</tt><tt class="py-op">{</tt><tt class="py-name">None</tt><tt class="py-op">:</tt> <tt class="py-string">'uri:a'</tt><tt class="py-op">}</tt><tt class="py-op">)</tt> </tt>
943 </div><a name="L197"></a><tt class="py-lineno">197</tt> <tt class="py-line"> </tt>
944 <a name="ETreeXPathTestCase.test_xpath_ns_empty"></a><div id="ETreeXPathTestCase.test_xpath_ns_empty-def"><a name="L198"></a><tt class="py-lineno">198</tt> <a class="py-toggle" href="#" id="ETreeXPathTestCase.test_xpath_ns_empty-toggle" onclick="return toggle('ETreeXPathTestCase.test_xpath_ns_empty');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="lxml.tests.test_xpathevaluator.ETreeXPathTestCase-class.html#test_xpath_ns_empty">test_xpath_ns_empty</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
945 </div><div id="ETreeXPathTestCase.test_xpath_ns_empty-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="ETreeXPathTestCase.test_xpath_ns_empty-expanded"><a name="L199"></a><tt class="py-lineno">199</tt> <tt class="py-line"> <tt class="py-name">tree</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-146" class="py-name"><a title="lxml.cssselect.parse
946 lxml.etree._ElementTree.parse
948 lxml.html.ElementSoup.parse
949 lxml.html.html5parser.parse
951 lxml.html.soupparser.parse
953 lxml.tests.common_imports.HelperTestCase.parse" class="py-name" href="#" onclick="return doclink('link-146', 'parse', 'link-14');">parse</a></tt><tt class="py-op">(</tt><tt class="py-string">'<a xmlns="uri:a"><b></b></a>'</tt><tt class="py-op">)</tt> </tt>
954 <a name="L200"></a><tt class="py-lineno">200</tt> <tt class="py-line"> <tt id="link-147" class="py-name"><a title="lxml.etree.iterparse.root" class="py-name" href="#" onclick="return doclink('link-147', 'root', 'link-35');">root</a></tt> <tt class="py-op">=</tt> <tt class="py-name">tree</tt><tt class="py-op">.</tt><tt id="link-148" class="py-name"><a title="lxml.etree._ElementTree.getroot" class="py-name" href="#" onclick="return doclink('link-148', 'getroot', 'link-36');">getroot</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
955 <a name="L201"></a><tt class="py-lineno">201</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertRaises</tt><tt class="py-op">(</tt> </tt>
956 <a name="L202"></a><tt class="py-lineno">202</tt> <tt class="py-line"> <tt class="py-name">TypeError</tt><tt class="py-op">,</tt> </tt>
957 <a name="L203"></a><tt class="py-lineno">203</tt> <tt class="py-line"> <tt id="link-149" class="py-name"><a title="lxml.etree.iterparse.root" class="py-name" href="#" onclick="return doclink('link-149', 'root', 'link-35');">root</a></tt><tt class="py-op">.</tt><tt id="link-150" class="py-name"><a title="lxml.cssselect.Attrib.xpath
958 lxml.cssselect.Class.xpath
959 lxml.cssselect.CombinedSelector.xpath
960 lxml.cssselect.Element.xpath
961 lxml.cssselect.Function.xpath
962 lxml.cssselect.Hash.xpath
963 lxml.cssselect.Or.xpath
964 lxml.cssselect.Pseudo.xpath
965 lxml.etree._Element.xpath
966 lxml.etree._ElementTree.xpath
967 lxml.tests.test_xpathevaluator.xpath" class="py-name" href="#" onclick="return doclink('link-150', 'xpath', 'link-16');">xpath</a></tt><tt class="py-op">,</tt> <tt class="py-string">'//b'</tt><tt class="py-op">,</tt> <tt class="py-name">namespaces</tt><tt class="py-op">=</tt><tt class="py-op">{</tt><tt class="py-string">''</tt><tt class="py-op">:</tt> <tt class="py-string">'uri:a'</tt><tt class="py-op">}</tt><tt class="py-op">)</tt> </tt>
968 </div><a name="L204"></a><tt class="py-lineno">204</tt> <tt class="py-line"> </tt>
969 <a name="ETreeXPathTestCase.test_xpath_error"></a><div id="ETreeXPathTestCase.test_xpath_error-def"><a name="L205"></a><tt class="py-lineno">205</tt> <a class="py-toggle" href="#" id="ETreeXPathTestCase.test_xpath_error-toggle" onclick="return toggle('ETreeXPathTestCase.test_xpath_error');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="lxml.tests.test_xpathevaluator.ETreeXPathTestCase-class.html#test_xpath_error">test_xpath_error</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
970 </div><div id="ETreeXPathTestCase.test_xpath_error-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="ETreeXPathTestCase.test_xpath_error-expanded"><a name="L206"></a><tt class="py-lineno">206</tt> <tt class="py-line"> <tt class="py-name">tree</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-151" class="py-name"><a title="lxml.cssselect.parse
971 lxml.etree._ElementTree.parse
973 lxml.html.ElementSoup.parse
974 lxml.html.html5parser.parse
976 lxml.html.soupparser.parse
978 lxml.tests.common_imports.HelperTestCase.parse" class="py-name" href="#" onclick="return doclink('link-151', 'parse', 'link-14');">parse</a></tt><tt class="py-op">(</tt><tt class="py-string">'<a/>'</tt><tt class="py-op">)</tt> </tt>
979 <a name="L207"></a><tt class="py-lineno">207</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertRaises</tt><tt class="py-op">(</tt><tt id="link-152" class="py-name"><a title="lxml.etree
980 lxml.sax.ElementTreeContentHandler.etree
981 lxml.tests.test_elementtree.CElementTreeTestCase.etree
982 lxml.tests.test_elementtree.ETreeTestCaseBase.etree
983 lxml.tests.test_io.IOTestCaseBase.etree" class="py-name" href="#" onclick="return doclink('link-152', 'etree', 'link-9');">etree</a></tt><tt class="py-op">.</tt><tt id="link-153" class="py-name" targets="Class lxml.etree.XPathEvalError=lxml.etree.XPathEvalError-class.html"><a title="lxml.etree.XPathEvalError" class="py-name" href="#" onclick="return doclink('link-153', 'XPathEvalError', 'link-153');">XPathEvalError</a></tt><tt class="py-op">,</tt> <tt class="py-name">tree</tt><tt class="py-op">.</tt><tt id="link-154" class="py-name"><a title="lxml.cssselect.Attrib.xpath
984 lxml.cssselect.Class.xpath
985 lxml.cssselect.CombinedSelector.xpath
986 lxml.cssselect.Element.xpath
987 lxml.cssselect.Function.xpath
988 lxml.cssselect.Hash.xpath
989 lxml.cssselect.Or.xpath
990 lxml.cssselect.Pseudo.xpath
991 lxml.etree._Element.xpath
992 lxml.etree._ElementTree.xpath
993 lxml.tests.test_xpathevaluator.xpath" class="py-name" href="#" onclick="return doclink('link-154', 'xpath', 'link-16');">xpath</a></tt><tt class="py-op">,</tt> <tt class="py-string">'\\fad'</tt><tt class="py-op">)</tt> </tt>
994 </div><a name="L208"></a><tt class="py-lineno">208</tt> <tt class="py-line"> </tt>
995 <a name="ETreeXPathTestCase.test_xpath_class_error"></a><div id="ETreeXPathTestCase.test_xpath_class_error-def"><a name="L209"></a><tt class="py-lineno">209</tt> <a class="py-toggle" href="#" id="ETreeXPathTestCase.test_xpath_class_error-toggle" onclick="return toggle('ETreeXPathTestCase.test_xpath_class_error');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="lxml.tests.test_xpathevaluator.ETreeXPathTestCase-class.html#test_xpath_class_error">test_xpath_class_error</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
996 </div><div id="ETreeXPathTestCase.test_xpath_class_error-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="ETreeXPathTestCase.test_xpath_class_error-expanded"><a name="L210"></a><tt class="py-lineno">210</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertRaises</tt><tt class="py-op">(</tt><tt class="py-name">SyntaxError</tt><tt class="py-op">,</tt> <tt id="link-155" class="py-name"><a title="lxml.etree
997 lxml.sax.ElementTreeContentHandler.etree
998 lxml.tests.test_elementtree.CElementTreeTestCase.etree
999 lxml.tests.test_elementtree.ETreeTestCaseBase.etree
1000 lxml.tests.test_io.IOTestCaseBase.etree" class="py-name" href="#" onclick="return doclink('link-155', 'etree', 'link-9');">etree</a></tt><tt class="py-op">.</tt><tt id="link-156" class="py-name" targets="Class lxml.etree.XPath=lxml.etree.XPath-class.html"><a title="lxml.etree.XPath" class="py-name" href="#" onclick="return doclink('link-156', 'XPath', 'link-156');">XPath</a></tt><tt class="py-op">,</tt> <tt class="py-string">'\\fad'</tt><tt class="py-op">)</tt> </tt>
1001 <a name="L211"></a><tt class="py-lineno">211</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertRaises</tt><tt class="py-op">(</tt><tt id="link-157" class="py-name"><a title="lxml.etree
1002 lxml.sax.ElementTreeContentHandler.etree
1003 lxml.tests.test_elementtree.CElementTreeTestCase.etree
1004 lxml.tests.test_elementtree.ETreeTestCaseBase.etree
1005 lxml.tests.test_io.IOTestCaseBase.etree" class="py-name" href="#" onclick="return doclink('link-157', 'etree', 'link-9');">etree</a></tt><tt class="py-op">.</tt><tt id="link-158" class="py-name" targets="Class lxml.etree.XPathSyntaxError=lxml.etree.XPathSyntaxError-class.html"><a title="lxml.etree.XPathSyntaxError" class="py-name" href="#" onclick="return doclink('link-158', 'XPathSyntaxError', 'link-158');">XPathSyntaxError</a></tt><tt class="py-op">,</tt> <tt id="link-159" class="py-name"><a title="lxml.etree
1006 lxml.sax.ElementTreeContentHandler.etree
1007 lxml.tests.test_elementtree.CElementTreeTestCase.etree
1008 lxml.tests.test_elementtree.ETreeTestCaseBase.etree
1009 lxml.tests.test_io.IOTestCaseBase.etree" class="py-name" href="#" onclick="return doclink('link-159', 'etree', 'link-9');">etree</a></tt><tt class="py-op">.</tt><tt id="link-160" class="py-name"><a title="lxml.etree.XPath" class="py-name" href="#" onclick="return doclink('link-160', 'XPath', 'link-156');">XPath</a></tt><tt class="py-op">,</tt> <tt class="py-string">'\\fad'</tt><tt class="py-op">)</tt> </tt>
1010 </div><a name="L212"></a><tt class="py-lineno">212</tt> <tt class="py-line"> </tt>
1011 <a name="ETreeXPathTestCase.test_xpath_prefix_error"></a><div id="ETreeXPathTestCase.test_xpath_prefix_error-def"><a name="L213"></a><tt class="py-lineno">213</tt> <a class="py-toggle" href="#" id="ETreeXPathTestCase.test_xpath_prefix_error-toggle" onclick="return toggle('ETreeXPathTestCase.test_xpath_prefix_error');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="lxml.tests.test_xpathevaluator.ETreeXPathTestCase-class.html#test_xpath_prefix_error">test_xpath_prefix_error</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
1012 </div><div id="ETreeXPathTestCase.test_xpath_prefix_error-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="ETreeXPathTestCase.test_xpath_prefix_error-expanded"><a name="L214"></a><tt class="py-lineno">214</tt> <tt class="py-line"> <tt class="py-name">tree</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-161" class="py-name"><a title="lxml.cssselect.parse
1013 lxml.etree._ElementTree.parse
1015 lxml.html.ElementSoup.parse
1016 lxml.html.html5parser.parse
1018 lxml.html.soupparser.parse
1019 lxml.objectify.parse
1020 lxml.tests.common_imports.HelperTestCase.parse" class="py-name" href="#" onclick="return doclink('link-161', 'parse', 'link-14');">parse</a></tt><tt class="py-op">(</tt><tt class="py-string">'<a/>'</tt><tt class="py-op">)</tt> </tt>
1021 <a name="L215"></a><tt class="py-lineno">215</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertRaises</tt><tt class="py-op">(</tt><tt id="link-162" class="py-name"><a title="lxml.etree
1022 lxml.sax.ElementTreeContentHandler.etree
1023 lxml.tests.test_elementtree.CElementTreeTestCase.etree
1024 lxml.tests.test_elementtree.ETreeTestCaseBase.etree
1025 lxml.tests.test_io.IOTestCaseBase.etree" class="py-name" href="#" onclick="return doclink('link-162', 'etree', 'link-9');">etree</a></tt><tt class="py-op">.</tt><tt id="link-163" class="py-name"><a title="lxml.etree.XPathEvalError" class="py-name" href="#" onclick="return doclink('link-163', 'XPathEvalError', 'link-153');">XPathEvalError</a></tt><tt class="py-op">,</tt> <tt class="py-name">tree</tt><tt class="py-op">.</tt><tt id="link-164" class="py-name"><a title="lxml.cssselect.Attrib.xpath
1026 lxml.cssselect.Class.xpath
1027 lxml.cssselect.CombinedSelector.xpath
1028 lxml.cssselect.Element.xpath
1029 lxml.cssselect.Function.xpath
1030 lxml.cssselect.Hash.xpath
1031 lxml.cssselect.Or.xpath
1032 lxml.cssselect.Pseudo.xpath
1033 lxml.etree._Element.xpath
1034 lxml.etree._ElementTree.xpath
1035 lxml.tests.test_xpathevaluator.xpath" class="py-name" href="#" onclick="return doclink('link-164', 'xpath', 'link-16');">xpath</a></tt><tt class="py-op">,</tt> <tt class="py-string">'/fa:d'</tt><tt class="py-op">)</tt> </tt>
1036 </div><a name="L216"></a><tt class="py-lineno">216</tt> <tt class="py-line"> </tt>
1037 <a name="ETreeXPathTestCase.test_xpath_class_prefix_error"></a><div id="ETreeXPathTestCase.test_xpath_class_prefix_error-def"><a name="L217"></a><tt class="py-lineno">217</tt> <a class="py-toggle" href="#" id="ETreeXPathTestCase.test_xpath_class_prefix_error-toggle" onclick="return toggle('ETreeXPathTestCase.test_xpath_class_prefix_error');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="lxml.tests.test_xpathevaluator.ETreeXPathTestCase-class.html#test_xpath_class_prefix_error">test_xpath_class_prefix_error</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
1038 </div><div id="ETreeXPathTestCase.test_xpath_class_prefix_error-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="ETreeXPathTestCase.test_xpath_class_prefix_error-expanded"><a name="L218"></a><tt class="py-lineno">218</tt> <tt class="py-line"> <tt class="py-name">tree</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-165" class="py-name"><a title="lxml.cssselect.parse
1039 lxml.etree._ElementTree.parse
1041 lxml.html.ElementSoup.parse
1042 lxml.html.html5parser.parse
1044 lxml.html.soupparser.parse
1045 lxml.objectify.parse
1046 lxml.tests.common_imports.HelperTestCase.parse" class="py-name" href="#" onclick="return doclink('link-165', 'parse', 'link-14');">parse</a></tt><tt class="py-op">(</tt><tt class="py-string">'<a/>'</tt><tt class="py-op">)</tt> </tt>
1047 <a name="L219"></a><tt class="py-lineno">219</tt> <tt class="py-line"> <tt id="link-166" class="py-name"><a title="lxml.cssselect.Attrib.xpath
1048 lxml.cssselect.Class.xpath
1049 lxml.cssselect.CombinedSelector.xpath
1050 lxml.cssselect.Element.xpath
1051 lxml.cssselect.Function.xpath
1052 lxml.cssselect.Hash.xpath
1053 lxml.cssselect.Or.xpath
1054 lxml.cssselect.Pseudo.xpath
1055 lxml.etree._Element.xpath
1056 lxml.etree._ElementTree.xpath
1057 lxml.tests.test_xpathevaluator.xpath" class="py-name" href="#" onclick="return doclink('link-166', 'xpath', 'link-16');">xpath</a></tt> <tt class="py-op">=</tt> <tt id="link-167" class="py-name"><a title="lxml.etree
1058 lxml.sax.ElementTreeContentHandler.etree
1059 lxml.tests.test_elementtree.CElementTreeTestCase.etree
1060 lxml.tests.test_elementtree.ETreeTestCaseBase.etree
1061 lxml.tests.test_io.IOTestCaseBase.etree" class="py-name" href="#" onclick="return doclink('link-167', 'etree', 'link-9');">etree</a></tt><tt class="py-op">.</tt><tt id="link-168" class="py-name"><a title="lxml.etree.XPath" class="py-name" href="#" onclick="return doclink('link-168', 'XPath', 'link-156');">XPath</a></tt><tt class="py-op">(</tt><tt class="py-string">"/fa:d"</tt><tt class="py-op">)</tt> </tt>
1062 <a name="L220"></a><tt class="py-lineno">220</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertRaises</tt><tt class="py-op">(</tt><tt id="link-169" class="py-name"><a title="lxml.etree
1063 lxml.sax.ElementTreeContentHandler.etree
1064 lxml.tests.test_elementtree.CElementTreeTestCase.etree
1065 lxml.tests.test_elementtree.ETreeTestCaseBase.etree
1066 lxml.tests.test_io.IOTestCaseBase.etree" class="py-name" href="#" onclick="return doclink('link-169', 'etree', 'link-9');">etree</a></tt><tt class="py-op">.</tt><tt id="link-170" class="py-name"><a title="lxml.etree.XPathEvalError" class="py-name" href="#" onclick="return doclink('link-170', 'XPathEvalError', 'link-153');">XPathEvalError</a></tt><tt class="py-op">,</tt> <tt id="link-171" class="py-name"><a title="lxml.cssselect.Attrib.xpath
1067 lxml.cssselect.Class.xpath
1068 lxml.cssselect.CombinedSelector.xpath
1069 lxml.cssselect.Element.xpath
1070 lxml.cssselect.Function.xpath
1071 lxml.cssselect.Hash.xpath
1072 lxml.cssselect.Or.xpath
1073 lxml.cssselect.Pseudo.xpath
1074 lxml.etree._Element.xpath
1075 lxml.etree._ElementTree.xpath
1076 lxml.tests.test_xpathevaluator.xpath" class="py-name" href="#" onclick="return doclink('link-171', 'xpath', 'link-16');">xpath</a></tt><tt class="py-op">,</tt> <tt class="py-name">tree</tt><tt class="py-op">)</tt> </tt>
1077 </div><a name="L221"></a><tt class="py-lineno">221</tt> <tt class="py-line"> </tt>
1078 <a name="ETreeXPathTestCase.test_elementtree_getpath"></a><div id="ETreeXPathTestCase.test_elementtree_getpath-def"><a name="L222"></a><tt class="py-lineno">222</tt> <a class="py-toggle" href="#" id="ETreeXPathTestCase.test_elementtree_getpath-toggle" onclick="return toggle('ETreeXPathTestCase.test_elementtree_getpath');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="lxml.tests.test_xpathevaluator.ETreeXPathTestCase-class.html#test_elementtree_getpath">test_elementtree_getpath</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
1079 </div><div id="ETreeXPathTestCase.test_elementtree_getpath-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="ETreeXPathTestCase.test_elementtree_getpath-expanded"><a name="L223"></a><tt class="py-lineno">223</tt> <tt class="py-line"> <tt class="py-name">a</tt> <tt class="py-op">=</tt> <tt id="link-172" class="py-name"><a title="lxml.etree
1080 lxml.sax.ElementTreeContentHandler.etree
1081 lxml.tests.test_elementtree.CElementTreeTestCase.etree
1082 lxml.tests.test_elementtree.ETreeTestCaseBase.etree
1083 lxml.tests.test_io.IOTestCaseBase.etree" class="py-name" href="#" onclick="return doclink('link-172', 'etree', 'link-9');">etree</a></tt><tt class="py-op">.</tt><tt id="link-173" class="py-name" targets="Class lxml.cssselect.Element=lxml.cssselect.Element-class.html,Function lxml.etree.Element()=lxml.etree-module.html#Element,Function lxml.html.Element()=lxml.html-module.html#Element,Function lxml.objectify.Element()=lxml.objectify-module.html#Element,Method lxml.tests.test_pyclasslookup.PyClassLookupTestCase.Element()=lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html#Element,Class xml.etree.ElementTree.Element=xml.etree.ElementTree.Element-class.html"><a title="lxml.cssselect.Element
1086 lxml.objectify.Element
1087 lxml.tests.test_pyclasslookup.PyClassLookupTestCase.Element
1088 xml.etree.ElementTree.Element" class="py-name" href="#" onclick="return doclink('link-173', 'Element', 'link-173');">Element</a></tt><tt class="py-op">(</tt><tt class="py-string">"a"</tt><tt class="py-op">)</tt> </tt>
1089 <a name="L224"></a><tt class="py-lineno">224</tt> <tt class="py-line"> <tt class="py-name">b</tt> <tt class="py-op">=</tt> <tt id="link-174" class="py-name"><a title="lxml.etree
1090 lxml.sax.ElementTreeContentHandler.etree
1091 lxml.tests.test_elementtree.CElementTreeTestCase.etree
1092 lxml.tests.test_elementtree.ETreeTestCaseBase.etree
1093 lxml.tests.test_io.IOTestCaseBase.etree" class="py-name" href="#" onclick="return doclink('link-174', 'etree', 'link-9');">etree</a></tt><tt class="py-op">.</tt><tt id="link-175" class="py-name" targets="Function lxml.etree.SubElement()=lxml.etree-module.html#SubElement"><a title="lxml.etree.SubElement" class="py-name" href="#" onclick="return doclink('link-175', 'SubElement', 'link-175');">SubElement</a></tt><tt class="py-op">(</tt><tt class="py-name">a</tt><tt class="py-op">,</tt> <tt class="py-string">"b"</tt><tt class="py-op">)</tt> </tt>
1094 <a name="L225"></a><tt class="py-lineno">225</tt> <tt class="py-line"> <tt class="py-name">c</tt> <tt class="py-op">=</tt> <tt id="link-176" class="py-name"><a title="lxml.etree
1095 lxml.sax.ElementTreeContentHandler.etree
1096 lxml.tests.test_elementtree.CElementTreeTestCase.etree
1097 lxml.tests.test_elementtree.ETreeTestCaseBase.etree
1098 lxml.tests.test_io.IOTestCaseBase.etree" class="py-name" href="#" onclick="return doclink('link-176', 'etree', 'link-9');">etree</a></tt><tt class="py-op">.</tt><tt id="link-177" class="py-name"><a title="lxml.etree.SubElement" class="py-name" href="#" onclick="return doclink('link-177', 'SubElement', 'link-175');">SubElement</a></tt><tt class="py-op">(</tt><tt class="py-name">a</tt><tt class="py-op">,</tt> <tt class="py-string">"c"</tt><tt class="py-op">)</tt> </tt>
1099 <a name="L226"></a><tt class="py-lineno">226</tt> <tt class="py-line"> <tt class="py-name">d1</tt> <tt class="py-op">=</tt> <tt id="link-178" class="py-name"><a title="lxml.etree
1100 lxml.sax.ElementTreeContentHandler.etree
1101 lxml.tests.test_elementtree.CElementTreeTestCase.etree
1102 lxml.tests.test_elementtree.ETreeTestCaseBase.etree
1103 lxml.tests.test_io.IOTestCaseBase.etree" class="py-name" href="#" onclick="return doclink('link-178', 'etree', 'link-9');">etree</a></tt><tt class="py-op">.</tt><tt id="link-179" class="py-name"><a title="lxml.etree.SubElement" class="py-name" href="#" onclick="return doclink('link-179', 'SubElement', 'link-175');">SubElement</a></tt><tt class="py-op">(</tt><tt class="py-name">c</tt><tt class="py-op">,</tt> <tt class="py-string">"d"</tt><tt class="py-op">)</tt> </tt>
1104 <a name="L227"></a><tt class="py-lineno">227</tt> <tt class="py-line"> <tt class="py-name">d2</tt> <tt class="py-op">=</tt> <tt id="link-180" class="py-name"><a title="lxml.etree
1105 lxml.sax.ElementTreeContentHandler.etree
1106 lxml.tests.test_elementtree.CElementTreeTestCase.etree
1107 lxml.tests.test_elementtree.ETreeTestCaseBase.etree
1108 lxml.tests.test_io.IOTestCaseBase.etree" class="py-name" href="#" onclick="return doclink('link-180', 'etree', 'link-9');">etree</a></tt><tt class="py-op">.</tt><tt id="link-181" class="py-name"><a title="lxml.etree.SubElement" class="py-name" href="#" onclick="return doclink('link-181', 'SubElement', 'link-175');">SubElement</a></tt><tt class="py-op">(</tt><tt class="py-name">c</tt><tt class="py-op">,</tt> <tt class="py-string">"d"</tt><tt class="py-op">)</tt> </tt>
1109 <a name="L228"></a><tt class="py-lineno">228</tt> <tt class="py-line"> </tt>
1110 <a name="L229"></a><tt class="py-lineno">229</tt> <tt class="py-line"> <tt class="py-name">tree</tt> <tt class="py-op">=</tt> <tt id="link-182" class="py-name"><a title="lxml.etree
1111 lxml.sax.ElementTreeContentHandler.etree
1112 lxml.tests.test_elementtree.CElementTreeTestCase.etree
1113 lxml.tests.test_elementtree.ETreeTestCaseBase.etree
1114 lxml.tests.test_io.IOTestCaseBase.etree" class="py-name" href="#" onclick="return doclink('link-182', 'etree', 'link-9');">etree</a></tt><tt class="py-op">.</tt><tt id="link-183" class="py-name" targets="Function lxml.etree.ElementTree()=lxml.etree-module.html#ElementTree,Module xml.etree.ElementTree=xml.etree.ElementTree-module.html,Class xml.etree.ElementTree.ElementTree=xml.etree.ElementTree.ElementTree-class.html"><a title="lxml.etree.ElementTree
1115 xml.etree.ElementTree
1116 xml.etree.ElementTree.ElementTree" class="py-name" href="#" onclick="return doclink('link-183', 'ElementTree', 'link-183');">ElementTree</a></tt><tt class="py-op">(</tt><tt class="py-name">a</tt><tt class="py-op">)</tt> </tt>
1117 <a name="L230"></a><tt class="py-lineno">230</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEqual</tt><tt class="py-op">(</tt><tt class="py-string">'/a/c/d'</tt><tt class="py-op">,</tt> </tt>
1118 <a name="L231"></a><tt class="py-lineno">231</tt> <tt class="py-line"> <tt class="py-name">tree</tt><tt class="py-op">.</tt><tt id="link-184" class="py-name" targets="Method lxml.etree._ElementTree.getpath()=lxml.etree._ElementTree-class.html#getpath"><a title="lxml.etree._ElementTree.getpath" class="py-name" href="#" onclick="return doclink('link-184', 'getpath', 'link-184');">getpath</a></tt><tt class="py-op">(</tt><tt class="py-name">d2</tt><tt class="py-op">)</tt><tt class="py-op">[</tt><tt class="py-op">:</tt><tt class="py-number">6</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
1119 <a name="L232"></a><tt class="py-lineno">232</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEqual</tt><tt class="py-op">(</tt><tt class="py-op">[</tt><tt class="py-name">d2</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> </tt>
1120 <a name="L233"></a><tt class="py-lineno">233</tt> <tt class="py-line"> <tt class="py-name">tree</tt><tt class="py-op">.</tt><tt id="link-185" class="py-name"><a title="lxml.cssselect.Attrib.xpath
1121 lxml.cssselect.Class.xpath
1122 lxml.cssselect.CombinedSelector.xpath
1123 lxml.cssselect.Element.xpath
1124 lxml.cssselect.Function.xpath
1125 lxml.cssselect.Hash.xpath
1126 lxml.cssselect.Or.xpath
1127 lxml.cssselect.Pseudo.xpath
1128 lxml.etree._Element.xpath
1129 lxml.etree._ElementTree.xpath
1130 lxml.tests.test_xpathevaluator.xpath" class="py-name" href="#" onclick="return doclink('link-185', 'xpath', 'link-16');">xpath</a></tt><tt class="py-op">(</tt><tt class="py-name">tree</tt><tt class="py-op">.</tt><tt id="link-186" class="py-name"><a title="lxml.etree._ElementTree.getpath" class="py-name" href="#" onclick="return doclink('link-186', 'getpath', 'link-184');">getpath</a></tt><tt class="py-op">(</tt><tt class="py-name">d2</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
1131 </div><a name="L234"></a><tt class="py-lineno">234</tt> <tt class="py-line"> </tt>
1132 <a name="ETreeXPathTestCase.test_elementtree_getpath_partial"></a><div id="ETreeXPathTestCase.test_elementtree_getpath_partial-def"><a name="L235"></a><tt class="py-lineno">235</tt> <a class="py-toggle" href="#" id="ETreeXPathTestCase.test_elementtree_getpath_partial-toggle" onclick="return toggle('ETreeXPathTestCase.test_elementtree_getpath_partial');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="lxml.tests.test_xpathevaluator.ETreeXPathTestCase-class.html#test_elementtree_getpath_partial">test_elementtree_getpath_partial</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
1133 </div><div id="ETreeXPathTestCase.test_elementtree_getpath_partial-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="ETreeXPathTestCase.test_elementtree_getpath_partial-expanded"><a name="L236"></a><tt class="py-lineno">236</tt> <tt class="py-line"> <tt class="py-name">a</tt> <tt class="py-op">=</tt> <tt id="link-187" class="py-name"><a title="lxml.etree
1134 lxml.sax.ElementTreeContentHandler.etree
1135 lxml.tests.test_elementtree.CElementTreeTestCase.etree
1136 lxml.tests.test_elementtree.ETreeTestCaseBase.etree
1137 lxml.tests.test_io.IOTestCaseBase.etree" class="py-name" href="#" onclick="return doclink('link-187', 'etree', 'link-9');">etree</a></tt><tt class="py-op">.</tt><tt id="link-188" class="py-name"><a title="lxml.cssselect.Element
1140 lxml.objectify.Element
1141 lxml.tests.test_pyclasslookup.PyClassLookupTestCase.Element
1142 xml.etree.ElementTree.Element" class="py-name" href="#" onclick="return doclink('link-188', 'Element', 'link-173');">Element</a></tt><tt class="py-op">(</tt><tt class="py-string">"a"</tt><tt class="py-op">)</tt> </tt>
1143 <a name="L237"></a><tt class="py-lineno">237</tt> <tt class="py-line"> <tt class="py-name">b</tt> <tt class="py-op">=</tt> <tt id="link-189" class="py-name"><a title="lxml.etree
1144 lxml.sax.ElementTreeContentHandler.etree
1145 lxml.tests.test_elementtree.CElementTreeTestCase.etree
1146 lxml.tests.test_elementtree.ETreeTestCaseBase.etree
1147 lxml.tests.test_io.IOTestCaseBase.etree" class="py-name" href="#" onclick="return doclink('link-189', 'etree', 'link-9');">etree</a></tt><tt class="py-op">.</tt><tt id="link-190" class="py-name"><a title="lxml.etree.SubElement" class="py-name" href="#" onclick="return doclink('link-190', 'SubElement', 'link-175');">SubElement</a></tt><tt class="py-op">(</tt><tt class="py-name">a</tt><tt class="py-op">,</tt> <tt class="py-string">"b"</tt><tt class="py-op">)</tt> </tt>
1148 <a name="L238"></a><tt class="py-lineno">238</tt> <tt class="py-line"> <tt class="py-name">c</tt> <tt class="py-op">=</tt> <tt id="link-191" class="py-name"><a title="lxml.etree
1149 lxml.sax.ElementTreeContentHandler.etree
1150 lxml.tests.test_elementtree.CElementTreeTestCase.etree
1151 lxml.tests.test_elementtree.ETreeTestCaseBase.etree
1152 lxml.tests.test_io.IOTestCaseBase.etree" class="py-name" href="#" onclick="return doclink('link-191', 'etree', 'link-9');">etree</a></tt><tt class="py-op">.</tt><tt id="link-192" class="py-name"><a title="lxml.etree.SubElement" class="py-name" href="#" onclick="return doclink('link-192', 'SubElement', 'link-175');">SubElement</a></tt><tt class="py-op">(</tt><tt class="py-name">a</tt><tt class="py-op">,</tt> <tt class="py-string">"c"</tt><tt class="py-op">)</tt> </tt>
1153 <a name="L239"></a><tt class="py-lineno">239</tt> <tt class="py-line"> <tt class="py-name">d1</tt> <tt class="py-op">=</tt> <tt id="link-193" class="py-name"><a title="lxml.etree
1154 lxml.sax.ElementTreeContentHandler.etree
1155 lxml.tests.test_elementtree.CElementTreeTestCase.etree
1156 lxml.tests.test_elementtree.ETreeTestCaseBase.etree
1157 lxml.tests.test_io.IOTestCaseBase.etree" class="py-name" href="#" onclick="return doclink('link-193', 'etree', 'link-9');">etree</a></tt><tt class="py-op">.</tt><tt id="link-194" class="py-name"><a title="lxml.etree.SubElement" class="py-name" href="#" onclick="return doclink('link-194', 'SubElement', 'link-175');">SubElement</a></tt><tt class="py-op">(</tt><tt class="py-name">c</tt><tt class="py-op">,</tt> <tt class="py-string">"d"</tt><tt class="py-op">)</tt> </tt>
1158 <a name="L240"></a><tt class="py-lineno">240</tt> <tt class="py-line"> <tt class="py-name">d2</tt> <tt class="py-op">=</tt> <tt id="link-195" class="py-name"><a title="lxml.etree
1159 lxml.sax.ElementTreeContentHandler.etree
1160 lxml.tests.test_elementtree.CElementTreeTestCase.etree
1161 lxml.tests.test_elementtree.ETreeTestCaseBase.etree
1162 lxml.tests.test_io.IOTestCaseBase.etree" class="py-name" href="#" onclick="return doclink('link-195', 'etree', 'link-9');">etree</a></tt><tt class="py-op">.</tt><tt id="link-196" class="py-name"><a title="lxml.etree.SubElement" class="py-name" href="#" onclick="return doclink('link-196', 'SubElement', 'link-175');">SubElement</a></tt><tt class="py-op">(</tt><tt class="py-name">c</tt><tt class="py-op">,</tt> <tt class="py-string">"d"</tt><tt class="py-op">)</tt> </tt>
1163 <a name="L241"></a><tt class="py-lineno">241</tt> <tt class="py-line"> </tt>
1164 <a name="L242"></a><tt class="py-lineno">242</tt> <tt class="py-line"> <tt class="py-name">tree</tt> <tt class="py-op">=</tt> <tt id="link-197" class="py-name"><a title="lxml.etree
1165 lxml.sax.ElementTreeContentHandler.etree
1166 lxml.tests.test_elementtree.CElementTreeTestCase.etree
1167 lxml.tests.test_elementtree.ETreeTestCaseBase.etree
1168 lxml.tests.test_io.IOTestCaseBase.etree" class="py-name" href="#" onclick="return doclink('link-197', 'etree', 'link-9');">etree</a></tt><tt class="py-op">.</tt><tt id="link-198" class="py-name"><a title="lxml.etree.ElementTree
1169 xml.etree.ElementTree
1170 xml.etree.ElementTree.ElementTree" class="py-name" href="#" onclick="return doclink('link-198', 'ElementTree', 'link-183');">ElementTree</a></tt><tt class="py-op">(</tt><tt class="py-name">c</tt><tt class="py-op">)</tt> </tt>
1171 <a name="L243"></a><tt class="py-lineno">243</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEqual</tt><tt class="py-op">(</tt><tt class="py-string">'/c/d'</tt><tt class="py-op">,</tt> </tt>
1172 <a name="L244"></a><tt class="py-lineno">244</tt> <tt class="py-line"> <tt class="py-name">tree</tt><tt class="py-op">.</tt><tt id="link-199" class="py-name"><a title="lxml.etree._ElementTree.getpath" class="py-name" href="#" onclick="return doclink('link-199', 'getpath', 'link-184');">getpath</a></tt><tt class="py-op">(</tt><tt class="py-name">d2</tt><tt class="py-op">)</tt><tt class="py-op">[</tt><tt class="py-op">:</tt><tt class="py-number">4</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
1173 <a name="L245"></a><tt class="py-lineno">245</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEqual</tt><tt class="py-op">(</tt><tt class="py-op">[</tt><tt class="py-name">d2</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> </tt>
1174 <a name="L246"></a><tt class="py-lineno">246</tt> <tt class="py-line"> <tt class="py-name">tree</tt><tt class="py-op">.</tt><tt id="link-200" class="py-name"><a title="lxml.cssselect.Attrib.xpath
1175 lxml.cssselect.Class.xpath
1176 lxml.cssselect.CombinedSelector.xpath
1177 lxml.cssselect.Element.xpath
1178 lxml.cssselect.Function.xpath
1179 lxml.cssselect.Hash.xpath
1180 lxml.cssselect.Or.xpath
1181 lxml.cssselect.Pseudo.xpath
1182 lxml.etree._Element.xpath
1183 lxml.etree._ElementTree.xpath
1184 lxml.tests.test_xpathevaluator.xpath" class="py-name" href="#" onclick="return doclink('link-200', 'xpath', 'link-16');">xpath</a></tt><tt class="py-op">(</tt><tt class="py-name">tree</tt><tt class="py-op">.</tt><tt id="link-201" class="py-name"><a title="lxml.etree._ElementTree.getpath" class="py-name" href="#" onclick="return doclink('link-201', 'getpath', 'link-184');">getpath</a></tt><tt class="py-op">(</tt><tt class="py-name">d2</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
1185 </div><a name="L247"></a><tt class="py-lineno">247</tt> <tt class="py-line"> </tt>
1186 <a name="ETreeXPathTestCase.test_xpath_evaluator"></a><div id="ETreeXPathTestCase.test_xpath_evaluator-def"><a name="L248"></a><tt class="py-lineno">248</tt> <a class="py-toggle" href="#" id="ETreeXPathTestCase.test_xpath_evaluator-toggle" onclick="return toggle('ETreeXPathTestCase.test_xpath_evaluator');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="lxml.tests.test_xpathevaluator.ETreeXPathTestCase-class.html#test_xpath_evaluator">test_xpath_evaluator</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
1187 </div><div id="ETreeXPathTestCase.test_xpath_evaluator-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="ETreeXPathTestCase.test_xpath_evaluator-expanded"><a name="L249"></a><tt class="py-lineno">249</tt> <tt class="py-line"> <tt class="py-name">tree</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-202" class="py-name"><a title="lxml.cssselect.parse
1188 lxml.etree._ElementTree.parse
1190 lxml.html.ElementSoup.parse
1191 lxml.html.html5parser.parse
1193 lxml.html.soupparser.parse
1194 lxml.objectify.parse
1195 lxml.tests.common_imports.HelperTestCase.parse" class="py-name" href="#" onclick="return doclink('link-202', 'parse', 'link-14');">parse</a></tt><tt class="py-op">(</tt><tt class="py-string">'<a><b><c></c></b></a>'</tt><tt class="py-op">)</tt> </tt>
1196 <a name="L250"></a><tt class="py-lineno">250</tt> <tt class="py-line"> <tt class="py-name">e</tt> <tt class="py-op">=</tt> <tt id="link-203" class="py-name"><a title="lxml.etree
1197 lxml.sax.ElementTreeContentHandler.etree
1198 lxml.tests.test_elementtree.CElementTreeTestCase.etree
1199 lxml.tests.test_elementtree.ETreeTestCaseBase.etree
1200 lxml.tests.test_io.IOTestCaseBase.etree" class="py-name" href="#" onclick="return doclink('link-203', 'etree', 'link-9');">etree</a></tt><tt class="py-op">.</tt><tt id="link-204" class="py-name" targets="Function lxml.etree.XPathEvaluator()=lxml.etree-module.html#XPathEvaluator"><a title="lxml.etree.XPathEvaluator" class="py-name" href="#" onclick="return doclink('link-204', 'XPathEvaluator', 'link-204');">XPathEvaluator</a></tt><tt class="py-op">(</tt><tt class="py-name">tree</tt><tt class="py-op">)</tt> </tt>
1201 <a name="L251"></a><tt class="py-lineno">251</tt> <tt class="py-line"> <tt id="link-205" class="py-name"><a title="lxml.etree.iterparse.root" class="py-name" href="#" onclick="return doclink('link-205', 'root', 'link-35');">root</a></tt> <tt class="py-op">=</tt> <tt class="py-name">tree</tt><tt class="py-op">.</tt><tt id="link-206" class="py-name"><a title="lxml.etree._ElementTree.getroot" class="py-name" href="#" onclick="return doclink('link-206', 'getroot', 'link-36');">getroot</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
1202 <a name="L252"></a><tt class="py-lineno">252</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEquals</tt><tt class="py-op">(</tt> </tt>
1203 <a name="L253"></a><tt class="py-lineno">253</tt> <tt class="py-line"> <tt class="py-op">[</tt><tt id="link-207" class="py-name"><a title="lxml.etree.iterparse.root" class="py-name" href="#" onclick="return doclink('link-207', 'root', 'link-35');">root</a></tt><tt class="py-op">]</tt><tt class="py-op">,</tt> </tt>
1204 <a name="L254"></a><tt class="py-lineno">254</tt> <tt class="py-line"> <tt class="py-name">e</tt><tt class="py-op">(</tt><tt class="py-string">'//a'</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
1205 </div><a name="L255"></a><tt class="py-lineno">255</tt> <tt class="py-line"> </tt>
1206 <a name="ETreeXPathTestCase.test_xpath_evaluator_tree"></a><div id="ETreeXPathTestCase.test_xpath_evaluator_tree-def"><a name="L256"></a><tt class="py-lineno">256</tt> <a class="py-toggle" href="#" id="ETreeXPathTestCase.test_xpath_evaluator_tree-toggle" onclick="return toggle('ETreeXPathTestCase.test_xpath_evaluator_tree');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="lxml.tests.test_xpathevaluator.ETreeXPathTestCase-class.html#test_xpath_evaluator_tree">test_xpath_evaluator_tree</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
1207 </div><div id="ETreeXPathTestCase.test_xpath_evaluator_tree-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="ETreeXPathTestCase.test_xpath_evaluator_tree-expanded"><a name="L257"></a><tt class="py-lineno">257</tt> <tt class="py-line"> <tt class="py-name">tree</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-208" class="py-name"><a title="lxml.cssselect.parse
1208 lxml.etree._ElementTree.parse
1210 lxml.html.ElementSoup.parse
1211 lxml.html.html5parser.parse
1213 lxml.html.soupparser.parse
1214 lxml.objectify.parse
1215 lxml.tests.common_imports.HelperTestCase.parse" class="py-name" href="#" onclick="return doclink('link-208', 'parse', 'link-14');">parse</a></tt><tt class="py-op">(</tt><tt class="py-string">'<a><b><c></c></b></a>'</tt><tt class="py-op">)</tt> </tt>
1216 <a name="L258"></a><tt class="py-lineno">258</tt> <tt class="py-line"> <tt class="py-name">child_tree</tt> <tt class="py-op">=</tt> <tt id="link-209" class="py-name"><a title="lxml.etree
1217 lxml.sax.ElementTreeContentHandler.etree
1218 lxml.tests.test_elementtree.CElementTreeTestCase.etree
1219 lxml.tests.test_elementtree.ETreeTestCaseBase.etree
1220 lxml.tests.test_io.IOTestCaseBase.etree" class="py-name" href="#" onclick="return doclink('link-209', 'etree', 'link-9');">etree</a></tt><tt class="py-op">.</tt><tt id="link-210" class="py-name"><a title="lxml.etree.ElementTree
1221 xml.etree.ElementTree
1222 xml.etree.ElementTree.ElementTree" class="py-name" href="#" onclick="return doclink('link-210', 'ElementTree', 'link-183');">ElementTree</a></tt><tt class="py-op">(</tt><tt class="py-name">tree</tt><tt class="py-op">.</tt><tt id="link-211" class="py-name"><a title="lxml.etree._ElementTree.getroot" class="py-name" href="#" onclick="return doclink('link-211', 'getroot', 'link-36');">getroot</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
1223 <a name="L259"></a><tt class="py-lineno">259</tt> <tt class="py-line"> <tt class="py-name">e</tt> <tt class="py-op">=</tt> <tt id="link-212" class="py-name"><a title="lxml.etree
1224 lxml.sax.ElementTreeContentHandler.etree
1225 lxml.tests.test_elementtree.CElementTreeTestCase.etree
1226 lxml.tests.test_elementtree.ETreeTestCaseBase.etree
1227 lxml.tests.test_io.IOTestCaseBase.etree" class="py-name" href="#" onclick="return doclink('link-212', 'etree', 'link-9');">etree</a></tt><tt class="py-op">.</tt><tt id="link-213" class="py-name"><a title="lxml.etree.XPathEvaluator" class="py-name" href="#" onclick="return doclink('link-213', 'XPathEvaluator', 'link-204');">XPathEvaluator</a></tt><tt class="py-op">(</tt><tt class="py-name">child_tree</tt><tt class="py-op">)</tt> </tt>
1228 <a name="L260"></a><tt class="py-lineno">260</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEquals</tt><tt class="py-op">(</tt> </tt>
1229 <a name="L261"></a><tt class="py-lineno">261</tt> <tt class="py-line"> <tt class="py-op">[</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> </tt>
1230 <a name="L262"></a><tt class="py-lineno">262</tt> <tt class="py-line"> <tt class="py-name">e</tt><tt class="py-op">(</tt><tt class="py-string">'a'</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
1231 <a name="L263"></a><tt class="py-lineno">263</tt> <tt class="py-line"> <tt id="link-214" class="py-name"><a title="lxml.etree.iterparse.root" class="py-name" href="#" onclick="return doclink('link-214', 'root', 'link-35');">root</a></tt> <tt class="py-op">=</tt> <tt class="py-name">child_tree</tt><tt class="py-op">.</tt><tt id="link-215" class="py-name"><a title="lxml.etree._ElementTree.getroot" class="py-name" href="#" onclick="return doclink('link-215', 'getroot', 'link-36');">getroot</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
1232 <a name="L264"></a><tt class="py-lineno">264</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEquals</tt><tt class="py-op">(</tt> </tt>
1233 <a name="L265"></a><tt class="py-lineno">265</tt> <tt class="py-line"> <tt class="py-op">[</tt><tt id="link-216" class="py-name"><a title="lxml.etree.iterparse.root" class="py-name" href="#" onclick="return doclink('link-216', 'root', 'link-35');">root</a></tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> </tt>
1234 <a name="L266"></a><tt class="py-lineno">266</tt> <tt class="py-line"> <tt class="py-name">e</tt><tt class="py-op">(</tt><tt class="py-string">'c'</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
1235 </div><a name="L267"></a><tt class="py-lineno">267</tt> <tt class="py-line"> </tt>
1236 <a name="ETreeXPathTestCase.test_xpath_evaluator_tree_absolute"></a><div id="ETreeXPathTestCase.test_xpath_evaluator_tree_absolute-def"><a name="L268"></a><tt class="py-lineno">268</tt> <a class="py-toggle" href="#" id="ETreeXPathTestCase.test_xpath_evaluator_tree_absolute-toggle" onclick="return toggle('ETreeXPathTestCase.test_xpath_evaluator_tree_absolute');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="lxml.tests.test_xpathevaluator.ETreeXPathTestCase-class.html#test_xpath_evaluator_tree_absolute">test_xpath_evaluator_tree_absolute</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
1237 </div><div id="ETreeXPathTestCase.test_xpath_evaluator_tree_absolute-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="ETreeXPathTestCase.test_xpath_evaluator_tree_absolute-expanded"><a name="L269"></a><tt class="py-lineno">269</tt> <tt class="py-line"> <tt class="py-name">tree</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-217" class="py-name"><a title="lxml.cssselect.parse
1238 lxml.etree._ElementTree.parse
1240 lxml.html.ElementSoup.parse
1241 lxml.html.html5parser.parse
1243 lxml.html.soupparser.parse
1244 lxml.objectify.parse
1245 lxml.tests.common_imports.HelperTestCase.parse" class="py-name" href="#" onclick="return doclink('link-217', 'parse', 'link-14');">parse</a></tt><tt class="py-op">(</tt><tt class="py-string">'<a><b><c></c></b></a>'</tt><tt class="py-op">)</tt> </tt>
1246 <a name="L270"></a><tt class="py-lineno">270</tt> <tt class="py-line"> <tt class="py-name">child_tree</tt> <tt class="py-op">=</tt> <tt id="link-218" class="py-name"><a title="lxml.etree
1247 lxml.sax.ElementTreeContentHandler.etree
1248 lxml.tests.test_elementtree.CElementTreeTestCase.etree
1249 lxml.tests.test_elementtree.ETreeTestCaseBase.etree
1250 lxml.tests.test_io.IOTestCaseBase.etree" class="py-name" href="#" onclick="return doclink('link-218', 'etree', 'link-9');">etree</a></tt><tt class="py-op">.</tt><tt id="link-219" class="py-name"><a title="lxml.etree.ElementTree
1251 xml.etree.ElementTree
1252 xml.etree.ElementTree.ElementTree" class="py-name" href="#" onclick="return doclink('link-219', 'ElementTree', 'link-183');">ElementTree</a></tt><tt class="py-op">(</tt><tt class="py-name">tree</tt><tt class="py-op">.</tt><tt id="link-220" class="py-name"><a title="lxml.etree._ElementTree.getroot" class="py-name" href="#" onclick="return doclink('link-220', 'getroot', 'link-36');">getroot</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
1253 <a name="L271"></a><tt class="py-lineno">271</tt> <tt class="py-line"> <tt class="py-name">e</tt> <tt class="py-op">=</tt> <tt id="link-221" class="py-name"><a title="lxml.etree
1254 lxml.sax.ElementTreeContentHandler.etree
1255 lxml.tests.test_elementtree.CElementTreeTestCase.etree
1256 lxml.tests.test_elementtree.ETreeTestCaseBase.etree
1257 lxml.tests.test_io.IOTestCaseBase.etree" class="py-name" href="#" onclick="return doclink('link-221', 'etree', 'link-9');">etree</a></tt><tt class="py-op">.</tt><tt id="link-222" class="py-name"><a title="lxml.etree.XPathEvaluator" class="py-name" href="#" onclick="return doclink('link-222', 'XPathEvaluator', 'link-204');">XPathEvaluator</a></tt><tt class="py-op">(</tt><tt class="py-name">child_tree</tt><tt class="py-op">)</tt> </tt>
1258 <a name="L272"></a><tt class="py-lineno">272</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEquals</tt><tt class="py-op">(</tt> </tt>
1259 <a name="L273"></a><tt class="py-lineno">273</tt> <tt class="py-line"> <tt class="py-op">[</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> </tt>
1260 <a name="L274"></a><tt class="py-lineno">274</tt> <tt class="py-line"> <tt class="py-name">e</tt><tt class="py-op">(</tt><tt class="py-string">'/a'</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
1261 <a name="L275"></a><tt class="py-lineno">275</tt> <tt class="py-line"> <tt id="link-223" class="py-name"><a title="lxml.etree.iterparse.root" class="py-name" href="#" onclick="return doclink('link-223', 'root', 'link-35');">root</a></tt> <tt class="py-op">=</tt> <tt class="py-name">child_tree</tt><tt class="py-op">.</tt><tt id="link-224" class="py-name"><a title="lxml.etree._ElementTree.getroot" class="py-name" href="#" onclick="return doclink('link-224', 'getroot', 'link-36');">getroot</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
1262 <a name="L276"></a><tt class="py-lineno">276</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEquals</tt><tt class="py-op">(</tt> </tt>
1263 <a name="L277"></a><tt class="py-lineno">277</tt> <tt class="py-line"> <tt class="py-op">[</tt><tt id="link-225" class="py-name"><a title="lxml.etree.iterparse.root" class="py-name" href="#" onclick="return doclink('link-225', 'root', 'link-35');">root</a></tt><tt class="py-op">]</tt><tt class="py-op">,</tt> </tt>
1264 <a name="L278"></a><tt class="py-lineno">278</tt> <tt class="py-line"> <tt class="py-name">e</tt><tt class="py-op">(</tt><tt class="py-string">'/b'</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
1265 <a name="L279"></a><tt class="py-lineno">279</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEquals</tt><tt class="py-op">(</tt> </tt>
1266 <a name="L280"></a><tt class="py-lineno">280</tt> <tt class="py-line"> <tt class="py-op">[</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> </tt>
1267 <a name="L281"></a><tt class="py-lineno">281</tt> <tt class="py-line"> <tt class="py-name">e</tt><tt class="py-op">(</tt><tt class="py-string">'/c'</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
1268 </div><a name="L282"></a><tt class="py-lineno">282</tt> <tt class="py-line"> </tt>
1269 <a name="ETreeXPathTestCase.test_xpath_evaluator_element"></a><div id="ETreeXPathTestCase.test_xpath_evaluator_element-def"><a name="L283"></a><tt class="py-lineno">283</tt> <a class="py-toggle" href="#" id="ETreeXPathTestCase.test_xpath_evaluator_element-toggle" onclick="return toggle('ETreeXPathTestCase.test_xpath_evaluator_element');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="lxml.tests.test_xpathevaluator.ETreeXPathTestCase-class.html#test_xpath_evaluator_element">test_xpath_evaluator_element</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
1270 </div><div id="ETreeXPathTestCase.test_xpath_evaluator_element-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="ETreeXPathTestCase.test_xpath_evaluator_element-expanded"><a name="L284"></a><tt class="py-lineno">284</tt> <tt class="py-line"> <tt class="py-name">tree</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-226" class="py-name"><a title="lxml.cssselect.parse
1271 lxml.etree._ElementTree.parse
1273 lxml.html.ElementSoup.parse
1274 lxml.html.html5parser.parse
1276 lxml.html.soupparser.parse
1277 lxml.objectify.parse
1278 lxml.tests.common_imports.HelperTestCase.parse" class="py-name" href="#" onclick="return doclink('link-226', 'parse', 'link-14');">parse</a></tt><tt class="py-op">(</tt><tt class="py-string">'<a><b><c></c></b></a>'</tt><tt class="py-op">)</tt> </tt>
1279 <a name="L285"></a><tt class="py-lineno">285</tt> <tt class="py-line"> <tt id="link-227" class="py-name"><a title="lxml.etree.iterparse.root" class="py-name" href="#" onclick="return doclink('link-227', 'root', 'link-35');">root</a></tt> <tt class="py-op">=</tt> <tt class="py-name">tree</tt><tt class="py-op">.</tt><tt id="link-228" class="py-name"><a title="lxml.etree._ElementTree.getroot" class="py-name" href="#" onclick="return doclink('link-228', 'getroot', 'link-36');">getroot</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
1280 <a name="L286"></a><tt class="py-lineno">286</tt> <tt class="py-line"> <tt class="py-name">e</tt> <tt class="py-op">=</tt> <tt id="link-229" class="py-name"><a title="lxml.etree
1281 lxml.sax.ElementTreeContentHandler.etree
1282 lxml.tests.test_elementtree.CElementTreeTestCase.etree
1283 lxml.tests.test_elementtree.ETreeTestCaseBase.etree
1284 lxml.tests.test_io.IOTestCaseBase.etree" class="py-name" href="#" onclick="return doclink('link-229', 'etree', 'link-9');">etree</a></tt><tt class="py-op">.</tt><tt id="link-230" class="py-name"><a title="lxml.etree.XPathEvaluator" class="py-name" href="#" onclick="return doclink('link-230', 'XPathEvaluator', 'link-204');">XPathEvaluator</a></tt><tt class="py-op">(</tt><tt id="link-231" class="py-name"><a title="lxml.etree.iterparse.root" class="py-name" href="#" onclick="return doclink('link-231', 'root', 'link-35');">root</a></tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
1285 <a name="L287"></a><tt class="py-lineno">287</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEquals</tt><tt class="py-op">(</tt> </tt>
1286 <a name="L288"></a><tt class="py-lineno">288</tt> <tt class="py-line"> <tt class="py-op">[</tt><tt id="link-232" class="py-name"><a title="lxml.etree.iterparse.root" class="py-name" href="#" onclick="return doclink('link-232', 'root', 'link-35');">root</a></tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> </tt>
1287 <a name="L289"></a><tt class="py-lineno">289</tt> <tt class="py-line"> <tt class="py-name">e</tt><tt class="py-op">(</tt><tt class="py-string">'c'</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
1288 </div><a name="L290"></a><tt class="py-lineno">290</tt> <tt class="py-line"> </tt>
1289 <a name="ETreeXPathTestCase.test_xpath_extensions"></a><div id="ETreeXPathTestCase.test_xpath_extensions-def"><a name="L291"></a><tt class="py-lineno">291</tt> <a class="py-toggle" href="#" id="ETreeXPathTestCase.test_xpath_extensions-toggle" onclick="return toggle('ETreeXPathTestCase.test_xpath_extensions');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="lxml.tests.test_xpathevaluator.ETreeXPathTestCase-class.html#test_xpath_extensions">test_xpath_extensions</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
1290 </div><div id="ETreeXPathTestCase.test_xpath_extensions-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="ETreeXPathTestCase.test_xpath_extensions-expanded"><a name="L292"></a><tt class="py-lineno">292</tt> <tt class="py-line"> <tt class="py-keyword">def</tt> <tt class="py-def-name">foo</tt><tt class="py-op">(</tt><tt class="py-param">evaluator</tt><tt class="py-op">,</tt> <tt class="py-param">a</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
1291 <a name="L293"></a><tt class="py-lineno">293</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-string">'hello %s'</tt> <tt class="py-op">%</tt> <tt class="py-name">a</tt> </tt>
1292 </div><a name="L294"></a><tt class="py-lineno">294</tt> <tt class="py-line"> <tt id="link-233" class="py-name" targets="Variable lxml.tests.test_xpathevaluator.extension=lxml.tests.test_xpathevaluator-module.html#extension"><a title="lxml.tests.test_xpathevaluator.extension" class="py-name" href="#" onclick="return doclink('link-233', 'extension', 'link-233');">extension</a></tt> <tt class="py-op">=</tt> <tt class="py-op">{</tt><tt class="py-op">(</tt><tt class="py-name">None</tt><tt class="py-op">,</tt> <tt class="py-string">'foo'</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> <tt class="py-name">foo</tt><tt class="py-op">}</tt> </tt>
1293 <a name="L295"></a><tt class="py-lineno">295</tt> <tt class="py-line"> <tt class="py-name">tree</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-234" class="py-name"><a title="lxml.cssselect.parse
1294 lxml.etree._ElementTree.parse
1296 lxml.html.ElementSoup.parse
1297 lxml.html.html5parser.parse
1299 lxml.html.soupparser.parse
1300 lxml.objectify.parse
1301 lxml.tests.common_imports.HelperTestCase.parse" class="py-name" href="#" onclick="return doclink('link-234', 'parse', 'link-14');">parse</a></tt><tt class="py-op">(</tt><tt class="py-string">'<a><b></b></a>'</tt><tt class="py-op">)</tt> </tt>
1302 <a name="L296"></a><tt class="py-lineno">296</tt> <tt class="py-line"> <tt class="py-name">e</tt> <tt class="py-op">=</tt> <tt id="link-235" class="py-name"><a title="lxml.etree
1303 lxml.sax.ElementTreeContentHandler.etree
1304 lxml.tests.test_elementtree.CElementTreeTestCase.etree
1305 lxml.tests.test_elementtree.ETreeTestCaseBase.etree
1306 lxml.tests.test_io.IOTestCaseBase.etree" class="py-name" href="#" onclick="return doclink('link-235', 'etree', 'link-9');">etree</a></tt><tt class="py-op">.</tt><tt id="link-236" class="py-name"><a title="lxml.etree.XPathEvaluator" class="py-name" href="#" onclick="return doclink('link-236', 'XPathEvaluator', 'link-204');">XPathEvaluator</a></tt><tt class="py-op">(</tt><tt class="py-name">tree</tt><tt class="py-op">,</tt> <tt class="py-name">extensions</tt><tt class="py-op">=</tt><tt class="py-op">[</tt><tt id="link-237" class="py-name"><a title="lxml.tests.test_xpathevaluator.extension" class="py-name" href="#" onclick="return doclink('link-237', 'extension', 'link-233');">extension</a></tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
1307 <a name="L297"></a><tt class="py-lineno">297</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEquals</tt><tt class="py-op">(</tt> </tt>
1308 <a name="L298"></a><tt class="py-lineno">298</tt> <tt class="py-line"> <tt class="py-string">"hello you"</tt><tt class="py-op">,</tt> <tt class="py-name">e</tt><tt class="py-op">(</tt><tt class="py-string">"foo('you')"</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
1309 </div><a name="L299"></a><tt class="py-lineno">299</tt> <tt class="py-line"> </tt>
1310 <a name="ETreeXPathTestCase.test_xpath_extensions_wrong_args"></a><div id="ETreeXPathTestCase.test_xpath_extensions_wrong_args-def"><a name="L300"></a><tt class="py-lineno">300</tt> <a class="py-toggle" href="#" id="ETreeXPathTestCase.test_xpath_extensions_wrong_args-toggle" onclick="return toggle('ETreeXPathTestCase.test_xpath_extensions_wrong_args');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="lxml.tests.test_xpathevaluator.ETreeXPathTestCase-class.html#test_xpath_extensions_wrong_args">test_xpath_extensions_wrong_args</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
1311 </div><div id="ETreeXPathTestCase.test_xpath_extensions_wrong_args-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="ETreeXPathTestCase.test_xpath_extensions_wrong_args-expanded"><a name="L301"></a><tt class="py-lineno">301</tt> <tt class="py-line"> <tt class="py-keyword">def</tt> <tt class="py-def-name">foo</tt><tt class="py-op">(</tt><tt class="py-param">evaluator</tt><tt class="py-op">,</tt> <tt class="py-param">a</tt><tt class="py-op">,</tt> <tt class="py-param">b</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
1312 <a name="L302"></a><tt class="py-lineno">302</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-string">"hello %s and %s"</tt> <tt class="py-op">%</tt> <tt class="py-op">(</tt><tt class="py-name">a</tt><tt class="py-op">,</tt> <tt class="py-name">b</tt><tt class="py-op">)</tt> </tt>
1313 </div><a name="L303"></a><tt class="py-lineno">303</tt> <tt class="py-line"> <tt id="link-238" class="py-name"><a title="lxml.tests.test_xpathevaluator.extension" class="py-name" href="#" onclick="return doclink('link-238', 'extension', 'link-233');">extension</a></tt> <tt class="py-op">=</tt> <tt class="py-op">{</tt><tt class="py-op">(</tt><tt class="py-name">None</tt><tt class="py-op">,</tt> <tt class="py-string">'foo'</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> <tt class="py-name">foo</tt><tt class="py-op">}</tt> </tt>
1314 <a name="L304"></a><tt class="py-lineno">304</tt> <tt class="py-line"> <tt class="py-name">tree</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-239" class="py-name"><a title="lxml.cssselect.parse
1315 lxml.etree._ElementTree.parse
1317 lxml.html.ElementSoup.parse
1318 lxml.html.html5parser.parse
1320 lxml.html.soupparser.parse
1321 lxml.objectify.parse
1322 lxml.tests.common_imports.HelperTestCase.parse" class="py-name" href="#" onclick="return doclink('link-239', 'parse', 'link-14');">parse</a></tt><tt class="py-op">(</tt><tt class="py-string">'<a><b></b></a>'</tt><tt class="py-op">)</tt> </tt>
1323 <a name="L305"></a><tt class="py-lineno">305</tt> <tt class="py-line"> <tt class="py-name">e</tt> <tt class="py-op">=</tt> <tt id="link-240" class="py-name"><a title="lxml.etree
1324 lxml.sax.ElementTreeContentHandler.etree
1325 lxml.tests.test_elementtree.CElementTreeTestCase.etree
1326 lxml.tests.test_elementtree.ETreeTestCaseBase.etree
1327 lxml.tests.test_io.IOTestCaseBase.etree" class="py-name" href="#" onclick="return doclink('link-240', 'etree', 'link-9');">etree</a></tt><tt class="py-op">.</tt><tt id="link-241" class="py-name"><a title="lxml.etree.XPathEvaluator" class="py-name" href="#" onclick="return doclink('link-241', 'XPathEvaluator', 'link-204');">XPathEvaluator</a></tt><tt class="py-op">(</tt><tt class="py-name">tree</tt><tt class="py-op">,</tt> <tt class="py-name">extensions</tt><tt class="py-op">=</tt><tt class="py-op">[</tt><tt id="link-242" class="py-name"><a title="lxml.tests.test_xpathevaluator.extension" class="py-name" href="#" onclick="return doclink('link-242', 'extension', 'link-233');">extension</a></tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
1328 <a name="L306"></a><tt class="py-lineno">306</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertRaises</tt><tt class="py-op">(</tt><tt class="py-name">TypeError</tt><tt class="py-op">,</tt> <tt class="py-name">e</tt><tt class="py-op">,</tt> <tt class="py-string">"foo('you')"</tt><tt class="py-op">)</tt> </tt>
1329 </div><a name="L307"></a><tt class="py-lineno">307</tt> <tt class="py-line"> </tt>
1330 <a name="ETreeXPathTestCase.test_xpath_extensions_error"></a><div id="ETreeXPathTestCase.test_xpath_extensions_error-def"><a name="L308"></a><tt class="py-lineno">308</tt> <a class="py-toggle" href="#" id="ETreeXPathTestCase.test_xpath_extensions_error-toggle" onclick="return toggle('ETreeXPathTestCase.test_xpath_extensions_error');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="lxml.tests.test_xpathevaluator.ETreeXPathTestCase-class.html#test_xpath_extensions_error">test_xpath_extensions_error</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
1331 </div><div id="ETreeXPathTestCase.test_xpath_extensions_error-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="ETreeXPathTestCase.test_xpath_extensions_error-expanded"><a name="L309"></a><tt class="py-lineno">309</tt> <tt class="py-line"> <tt class="py-keyword">def</tt> <tt class="py-def-name">foo</tt><tt class="py-op">(</tt><tt class="py-param">evaluator</tt><tt class="py-op">,</tt> <tt class="py-param">a</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
1332 <a name="L310"></a><tt class="py-lineno">310</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-number">1</tt><tt class="py-op">/</tt><tt class="py-number">0</tt> </tt>
1333 </div><a name="L311"></a><tt class="py-lineno">311</tt> <tt class="py-line"> <tt id="link-243" class="py-name"><a title="lxml.tests.test_xpathevaluator.extension" class="py-name" href="#" onclick="return doclink('link-243', 'extension', 'link-233');">extension</a></tt> <tt class="py-op">=</tt> <tt class="py-op">{</tt><tt class="py-op">(</tt><tt class="py-name">None</tt><tt class="py-op">,</tt> <tt class="py-string">'foo'</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> <tt class="py-name">foo</tt><tt class="py-op">}</tt> </tt>
1334 <a name="L312"></a><tt class="py-lineno">312</tt> <tt class="py-line"> <tt class="py-name">tree</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-244" class="py-name"><a title="lxml.cssselect.parse
1335 lxml.etree._ElementTree.parse
1337 lxml.html.ElementSoup.parse
1338 lxml.html.html5parser.parse
1340 lxml.html.soupparser.parse
1341 lxml.objectify.parse
1342 lxml.tests.common_imports.HelperTestCase.parse" class="py-name" href="#" onclick="return doclink('link-244', 'parse', 'link-14');">parse</a></tt><tt class="py-op">(</tt><tt class="py-string">'<a/>'</tt><tt class="py-op">)</tt> </tt>
1343 <a name="L313"></a><tt class="py-lineno">313</tt> <tt class="py-line"> <tt class="py-name">e</tt> <tt class="py-op">=</tt> <tt id="link-245" class="py-name"><a title="lxml.etree
1344 lxml.sax.ElementTreeContentHandler.etree
1345 lxml.tests.test_elementtree.CElementTreeTestCase.etree
1346 lxml.tests.test_elementtree.ETreeTestCaseBase.etree
1347 lxml.tests.test_io.IOTestCaseBase.etree" class="py-name" href="#" onclick="return doclink('link-245', 'etree', 'link-9');">etree</a></tt><tt class="py-op">.</tt><tt id="link-246" class="py-name"><a title="lxml.etree.XPathEvaluator" class="py-name" href="#" onclick="return doclink('link-246', 'XPathEvaluator', 'link-204');">XPathEvaluator</a></tt><tt class="py-op">(</tt><tt class="py-name">tree</tt><tt class="py-op">,</tt> <tt class="py-name">extensions</tt><tt class="py-op">=</tt><tt class="py-op">[</tt><tt id="link-247" class="py-name"><a title="lxml.tests.test_xpathevaluator.extension" class="py-name" href="#" onclick="return doclink('link-247', 'extension', 'link-233');">extension</a></tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
1348 <a name="L314"></a><tt class="py-lineno">314</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertRaises</tt><tt class="py-op">(</tt><tt class="py-name">ZeroDivisionError</tt><tt class="py-op">,</tt> <tt class="py-name">e</tt><tt class="py-op">,</tt> <tt class="py-string">"foo('test')"</tt><tt class="py-op">)</tt> </tt>
1349 </div><a name="L315"></a><tt class="py-lineno">315</tt> <tt class="py-line"> </tt>
1350 <a name="ETreeXPathTestCase.test_xpath_extensions_nodes"></a><div id="ETreeXPathTestCase.test_xpath_extensions_nodes-def"><a name="L316"></a><tt class="py-lineno">316</tt> <a class="py-toggle" href="#" id="ETreeXPathTestCase.test_xpath_extensions_nodes-toggle" onclick="return toggle('ETreeXPathTestCase.test_xpath_extensions_nodes');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="lxml.tests.test_xpathevaluator.ETreeXPathTestCase-class.html#test_xpath_extensions_nodes">test_xpath_extensions_nodes</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
1351 </div><div id="ETreeXPathTestCase.test_xpath_extensions_nodes-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="ETreeXPathTestCase.test_xpath_extensions_nodes-expanded"><a name="L317"></a><tt class="py-lineno">317</tt> <tt class="py-line"> <tt class="py-keyword">def</tt> <tt class="py-def-name">f</tt><tt class="py-op">(</tt><tt class="py-param">evaluator</tt><tt class="py-op">,</tt> <tt class="py-param">arg</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
1352 <a name="L318"></a><tt class="py-lineno">318</tt> <tt class="py-line"> <tt class="py-name">r</tt> <tt class="py-op">=</tt> <tt id="link-248" class="py-name"><a title="lxml.etree
1353 lxml.sax.ElementTreeContentHandler.etree
1354 lxml.tests.test_elementtree.CElementTreeTestCase.etree
1355 lxml.tests.test_elementtree.ETreeTestCaseBase.etree
1356 lxml.tests.test_io.IOTestCaseBase.etree" class="py-name" href="#" onclick="return doclink('link-248', 'etree', 'link-9');">etree</a></tt><tt class="py-op">.</tt><tt id="link-249" class="py-name"><a title="lxml.cssselect.Element
1359 lxml.objectify.Element
1360 lxml.tests.test_pyclasslookup.PyClassLookupTestCase.Element
1361 xml.etree.ElementTree.Element" class="py-name" href="#" onclick="return doclink('link-249', 'Element', 'link-173');">Element</a></tt><tt class="py-op">(</tt><tt class="py-string">'results'</tt><tt class="py-op">)</tt> </tt>
1362 <a name="L319"></a><tt class="py-lineno">319</tt> <tt class="py-line"> <tt class="py-name">b</tt> <tt class="py-op">=</tt> <tt id="link-250" class="py-name"><a title="lxml.etree
1363 lxml.sax.ElementTreeContentHandler.etree
1364 lxml.tests.test_elementtree.CElementTreeTestCase.etree
1365 lxml.tests.test_elementtree.ETreeTestCaseBase.etree
1366 lxml.tests.test_io.IOTestCaseBase.etree" class="py-name" href="#" onclick="return doclink('link-250', 'etree', 'link-9');">etree</a></tt><tt class="py-op">.</tt><tt id="link-251" class="py-name"><a title="lxml.etree.SubElement" class="py-name" href="#" onclick="return doclink('link-251', 'SubElement', 'link-175');">SubElement</a></tt><tt class="py-op">(</tt><tt class="py-name">r</tt><tt class="py-op">,</tt> <tt class="py-string">'result'</tt><tt class="py-op">)</tt> </tt>
1367 <a name="L320"></a><tt class="py-lineno">320</tt> <tt class="py-line"> <tt class="py-name">b</tt><tt class="py-op">.</tt><tt id="link-252" 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
1368 lxml.etree._AppendOnlyElementProxy.text
1369 lxml.etree._Element.text
1370 lxml.etree._Entity.text
1371 lxml.etree._ModifyContentOnlyProxy.text
1372 lxml.etree._ReadOnlyEntityProxy.text
1373 lxml.etree._ReadOnlyProxy.text
1374 lxml.etree.__ContentOnlyElement.text
1375 lxml.objectify.ObjectifiedElement.text
1376 xml.etree.ElementTree.Element.text" class="py-name" href="#" onclick="return doclink('link-252', 'text', 'link-252');">text</a></tt> <tt class="py-op">=</tt> <tt class="py-string">'Hoi'</tt> </tt>
1377 <a name="L321"></a><tt class="py-lineno">321</tt> <tt class="py-line"> <tt class="py-name">b</tt> <tt class="py-op">=</tt> <tt id="link-253" class="py-name"><a title="lxml.etree
1378 lxml.sax.ElementTreeContentHandler.etree
1379 lxml.tests.test_elementtree.CElementTreeTestCase.etree
1380 lxml.tests.test_elementtree.ETreeTestCaseBase.etree
1381 lxml.tests.test_io.IOTestCaseBase.etree" class="py-name" href="#" onclick="return doclink('link-253', 'etree', 'link-9');">etree</a></tt><tt class="py-op">.</tt><tt id="link-254" class="py-name"><a title="lxml.etree.SubElement" class="py-name" href="#" onclick="return doclink('link-254', 'SubElement', 'link-175');">SubElement</a></tt><tt class="py-op">(</tt><tt class="py-name">r</tt><tt class="py-op">,</tt> <tt class="py-string">'result'</tt><tt class="py-op">)</tt> </tt>
1382 <a name="L322"></a><tt class="py-lineno">322</tt> <tt class="py-line"> <tt class="py-name">b</tt><tt class="py-op">.</tt><tt id="link-255" class="py-name"><a title="lxml.etree.QName.text
1383 lxml.etree._AppendOnlyElementProxy.text
1384 lxml.etree._Element.text
1385 lxml.etree._Entity.text
1386 lxml.etree._ModifyContentOnlyProxy.text
1387 lxml.etree._ReadOnlyEntityProxy.text
1388 lxml.etree._ReadOnlyProxy.text
1389 lxml.etree.__ContentOnlyElement.text
1390 lxml.objectify.ObjectifiedElement.text
1391 xml.etree.ElementTree.Element.text" class="py-name" href="#" onclick="return doclink('link-255', 'text', 'link-252');">text</a></tt> <tt class="py-op">=</tt> <tt class="py-string">'Dag'</tt> </tt>
1392 <a name="L323"></a><tt class="py-lineno">323</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">r</tt> </tt>
1393 </div><a name="L324"></a><tt class="py-lineno">324</tt> <tt class="py-line"> </tt>
1394 <a name="L325"></a><tt class="py-lineno">325</tt> <tt class="py-line"> <tt class="py-name">x</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-256" class="py-name"><a title="lxml.cssselect.parse
1395 lxml.etree._ElementTree.parse
1397 lxml.html.ElementSoup.parse
1398 lxml.html.html5parser.parse
1400 lxml.html.soupparser.parse
1401 lxml.objectify.parse
1402 lxml.tests.common_imports.HelperTestCase.parse" class="py-name" href="#" onclick="return doclink('link-256', 'parse', 'link-14');">parse</a></tt><tt class="py-op">(</tt><tt class="py-string">'<a/>'</tt><tt class="py-op">)</tt> </tt>
1403 <a name="L326"></a><tt class="py-lineno">326</tt> <tt class="py-line"> <tt class="py-name">e</tt> <tt class="py-op">=</tt> <tt id="link-257" class="py-name"><a title="lxml.etree
1404 lxml.sax.ElementTreeContentHandler.etree
1405 lxml.tests.test_elementtree.CElementTreeTestCase.etree
1406 lxml.tests.test_elementtree.ETreeTestCaseBase.etree
1407 lxml.tests.test_io.IOTestCaseBase.etree" class="py-name" href="#" onclick="return doclink('link-257', 'etree', 'link-9');">etree</a></tt><tt class="py-op">.</tt><tt id="link-258" class="py-name"><a title="lxml.etree.XPathEvaluator" class="py-name" href="#" onclick="return doclink('link-258', 'XPathEvaluator', 'link-204');">XPathEvaluator</a></tt><tt class="py-op">(</tt><tt class="py-name">x</tt><tt class="py-op">,</tt> <tt class="py-name">extensions</tt><tt class="py-op">=</tt><tt class="py-op">[</tt><tt class="py-op">{</tt><tt class="py-op">(</tt><tt class="py-name">None</tt><tt class="py-op">,</tt> <tt class="py-string">'foo'</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> <tt class="py-name">f</tt><tt class="py-op">}</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
1408 <a name="L327"></a><tt class="py-lineno">327</tt> <tt class="py-line"> <tt class="py-name">r</tt> <tt class="py-op">=</tt> <tt class="py-name">e</tt><tt class="py-op">(</tt><tt class="py-string">"foo('World')/result"</tt><tt class="py-op">)</tt> </tt>
1409 <a name="L328"></a><tt class="py-lineno">328</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEquals</tt><tt class="py-op">(</tt><tt class="py-number">2</tt><tt class="py-op">,</tt> <tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">r</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
1410 <a name="L329"></a><tt class="py-lineno">329</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEquals</tt><tt class="py-op">(</tt><tt class="py-string">'Hoi'</tt><tt class="py-op">,</tt> <tt class="py-name">r</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">.</tt><tt id="link-259" class="py-name"><a title="lxml.etree.QName.text
1411 lxml.etree._AppendOnlyElementProxy.text
1412 lxml.etree._Element.text
1413 lxml.etree._Entity.text
1414 lxml.etree._ModifyContentOnlyProxy.text
1415 lxml.etree._ReadOnlyEntityProxy.text
1416 lxml.etree._ReadOnlyProxy.text
1417 lxml.etree.__ContentOnlyElement.text
1418 lxml.objectify.ObjectifiedElement.text
1419 xml.etree.ElementTree.Element.text" class="py-name" href="#" onclick="return doclink('link-259', 'text', 'link-252');">text</a></tt><tt class="py-op">)</tt> </tt>
1420 <a name="L330"></a><tt class="py-lineno">330</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEquals</tt><tt class="py-op">(</tt><tt class="py-string">'Dag'</tt><tt class="py-op">,</tt> <tt class="py-name">r</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">.</tt><tt id="link-260" class="py-name"><a title="lxml.etree.QName.text
1421 lxml.etree._AppendOnlyElementProxy.text
1422 lxml.etree._Element.text
1423 lxml.etree._Entity.text
1424 lxml.etree._ModifyContentOnlyProxy.text
1425 lxml.etree._ReadOnlyEntityProxy.text
1426 lxml.etree._ReadOnlyProxy.text
1427 lxml.etree.__ContentOnlyElement.text
1428 lxml.objectify.ObjectifiedElement.text
1429 xml.etree.ElementTree.Element.text" class="py-name" href="#" onclick="return doclink('link-260', 'text', 'link-252');">text</a></tt><tt class="py-op">)</tt> </tt>
1430 </div><a name="L331"></a><tt class="py-lineno">331</tt> <tt class="py-line"> </tt>
1431 <a name="ETreeXPathTestCase.test_xpath_extensions_nodes_append"></a><div id="ETreeXPathTestCase.test_xpath_extensions_nodes_append-def"><a name="L332"></a><tt class="py-lineno">332</tt> <a class="py-toggle" href="#" id="ETreeXPathTestCase.test_xpath_extensions_nodes_append-toggle" onclick="return toggle('ETreeXPathTestCase.test_xpath_extensions_nodes_append');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="lxml.tests.test_xpathevaluator.ETreeXPathTestCase-class.html#test_xpath_extensions_nodes_append">test_xpath_extensions_nodes_append</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
1432 </div><div id="ETreeXPathTestCase.test_xpath_extensions_nodes_append-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="ETreeXPathTestCase.test_xpath_extensions_nodes_append-expanded"><a name="L333"></a><tt class="py-lineno">333</tt> <tt class="py-line"> <tt class="py-keyword">def</tt> <tt class="py-def-name">f</tt><tt class="py-op">(</tt><tt class="py-param">evaluator</tt><tt class="py-op">,</tt> <tt class="py-param">nodes</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
1433 <a name="L334"></a><tt class="py-lineno">334</tt> <tt class="py-line"> <tt class="py-name">r</tt> <tt class="py-op">=</tt> <tt id="link-261" class="py-name"><a title="lxml.etree
1434 lxml.sax.ElementTreeContentHandler.etree
1435 lxml.tests.test_elementtree.CElementTreeTestCase.etree
1436 lxml.tests.test_elementtree.ETreeTestCaseBase.etree
1437 lxml.tests.test_io.IOTestCaseBase.etree" class="py-name" href="#" onclick="return doclink('link-261', 'etree', 'link-9');">etree</a></tt><tt class="py-op">.</tt><tt id="link-262" class="py-name"><a title="lxml.etree.SubElement" class="py-name" href="#" onclick="return doclink('link-262', 'SubElement', 'link-175');">SubElement</a></tt><tt class="py-op">(</tt><tt class="py-name">nodes</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> <tt class="py-string">'results'</tt><tt class="py-op">)</tt> </tt>
1438 <a name="L335"></a><tt class="py-lineno">335</tt> <tt class="py-line"> <tt class="py-name">b</tt> <tt class="py-op">=</tt> <tt id="link-263" class="py-name"><a title="lxml.etree
1439 lxml.sax.ElementTreeContentHandler.etree
1440 lxml.tests.test_elementtree.CElementTreeTestCase.etree
1441 lxml.tests.test_elementtree.ETreeTestCaseBase.etree
1442 lxml.tests.test_io.IOTestCaseBase.etree" class="py-name" href="#" onclick="return doclink('link-263', 'etree', 'link-9');">etree</a></tt><tt class="py-op">.</tt><tt id="link-264" class="py-name"><a title="lxml.etree.SubElement" class="py-name" href="#" onclick="return doclink('link-264', 'SubElement', 'link-175');">SubElement</a></tt><tt class="py-op">(</tt><tt class="py-name">r</tt><tt class="py-op">,</tt> <tt class="py-string">'result'</tt><tt class="py-op">)</tt> </tt>
1443 <a name="L336"></a><tt class="py-lineno">336</tt> <tt class="py-line"> <tt class="py-name">b</tt><tt class="py-op">.</tt><tt id="link-265" class="py-name"><a title="lxml.etree.QName.text
1444 lxml.etree._AppendOnlyElementProxy.text
1445 lxml.etree._Element.text
1446 lxml.etree._Entity.text
1447 lxml.etree._ModifyContentOnlyProxy.text
1448 lxml.etree._ReadOnlyEntityProxy.text
1449 lxml.etree._ReadOnlyProxy.text
1450 lxml.etree.__ContentOnlyElement.text
1451 lxml.objectify.ObjectifiedElement.text
1452 xml.etree.ElementTree.Element.text" class="py-name" href="#" onclick="return doclink('link-265', 'text', 'link-252');">text</a></tt> <tt class="py-op">=</tt> <tt class="py-string">'Hoi'</tt> </tt>
1453 <a name="L337"></a><tt class="py-lineno">337</tt> <tt class="py-line"> <tt class="py-name">b</tt> <tt class="py-op">=</tt> <tt id="link-266" class="py-name"><a title="lxml.etree
1454 lxml.sax.ElementTreeContentHandler.etree
1455 lxml.tests.test_elementtree.CElementTreeTestCase.etree
1456 lxml.tests.test_elementtree.ETreeTestCaseBase.etree
1457 lxml.tests.test_io.IOTestCaseBase.etree" class="py-name" href="#" onclick="return doclink('link-266', 'etree', 'link-9');">etree</a></tt><tt class="py-op">.</tt><tt id="link-267" class="py-name"><a title="lxml.etree.SubElement" class="py-name" href="#" onclick="return doclink('link-267', 'SubElement', 'link-175');">SubElement</a></tt><tt class="py-op">(</tt><tt class="py-name">r</tt><tt class="py-op">,</tt> <tt class="py-string">'result'</tt><tt class="py-op">)</tt> </tt>
1458 <a name="L338"></a><tt class="py-lineno">338</tt> <tt class="py-line"> <tt class="py-name">b</tt><tt class="py-op">.</tt><tt id="link-268" class="py-name"><a title="lxml.etree.QName.text
1459 lxml.etree._AppendOnlyElementProxy.text
1460 lxml.etree._Element.text
1461 lxml.etree._Entity.text
1462 lxml.etree._ModifyContentOnlyProxy.text
1463 lxml.etree._ReadOnlyEntityProxy.text
1464 lxml.etree._ReadOnlyProxy.text
1465 lxml.etree.__ContentOnlyElement.text
1466 lxml.objectify.ObjectifiedElement.text
1467 xml.etree.ElementTree.Element.text" class="py-name" href="#" onclick="return doclink('link-268', 'text', 'link-252');">text</a></tt> <tt class="py-op">=</tt> <tt class="py-string">'Dag'</tt> </tt>
1468 <a name="L339"></a><tt class="py-lineno">339</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">r</tt> </tt>
1469 </div><a name="L340"></a><tt class="py-lineno">340</tt> <tt class="py-line"> </tt>
1470 <a name="L341"></a><tt class="py-lineno">341</tt> <tt class="py-line"> <tt class="py-name">x</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-269" class="py-name"><a title="lxml.cssselect.parse
1471 lxml.etree._ElementTree.parse
1473 lxml.html.ElementSoup.parse
1474 lxml.html.html5parser.parse
1476 lxml.html.soupparser.parse
1477 lxml.objectify.parse
1478 lxml.tests.common_imports.HelperTestCase.parse" class="py-name" href="#" onclick="return doclink('link-269', 'parse', 'link-14');">parse</a></tt><tt class="py-op">(</tt><tt class="py-string">'<a/>'</tt><tt class="py-op">)</tt> </tt>
1479 <a name="L342"></a><tt class="py-lineno">342</tt> <tt class="py-line"> <tt class="py-name">e</tt> <tt class="py-op">=</tt> <tt id="link-270" class="py-name"><a title="lxml.etree
1480 lxml.sax.ElementTreeContentHandler.etree
1481 lxml.tests.test_elementtree.CElementTreeTestCase.etree
1482 lxml.tests.test_elementtree.ETreeTestCaseBase.etree
1483 lxml.tests.test_io.IOTestCaseBase.etree" class="py-name" href="#" onclick="return doclink('link-270', 'etree', 'link-9');">etree</a></tt><tt class="py-op">.</tt><tt id="link-271" class="py-name"><a title="lxml.etree.XPathEvaluator" class="py-name" href="#" onclick="return doclink('link-271', 'XPathEvaluator', 'link-204');">XPathEvaluator</a></tt><tt class="py-op">(</tt><tt class="py-name">x</tt><tt class="py-op">,</tt> <tt class="py-name">extensions</tt><tt class="py-op">=</tt><tt class="py-op">[</tt><tt class="py-op">{</tt><tt class="py-op">(</tt><tt class="py-name">None</tt><tt class="py-op">,</tt> <tt class="py-string">'foo'</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> <tt class="py-name">f</tt><tt class="py-op">}</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
1484 <a name="L343"></a><tt class="py-lineno">343</tt> <tt class="py-line"> <tt class="py-name">r</tt> <tt class="py-op">=</tt> <tt class="py-name">e</tt><tt class="py-op">(</tt><tt class="py-string">"foo(/*)/result"</tt><tt class="py-op">)</tt> </tt>
1485 <a name="L344"></a><tt class="py-lineno">344</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEquals</tt><tt class="py-op">(</tt><tt class="py-number">2</tt><tt class="py-op">,</tt> <tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">r</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
1486 <a name="L345"></a><tt class="py-lineno">345</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEquals</tt><tt class="py-op">(</tt><tt class="py-string">'Hoi'</tt><tt class="py-op">,</tt> <tt class="py-name">r</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">.</tt><tt id="link-272" class="py-name"><a title="lxml.etree.QName.text
1487 lxml.etree._AppendOnlyElementProxy.text
1488 lxml.etree._Element.text
1489 lxml.etree._Entity.text
1490 lxml.etree._ModifyContentOnlyProxy.text
1491 lxml.etree._ReadOnlyEntityProxy.text
1492 lxml.etree._ReadOnlyProxy.text
1493 lxml.etree.__ContentOnlyElement.text
1494 lxml.objectify.ObjectifiedElement.text
1495 xml.etree.ElementTree.Element.text" class="py-name" href="#" onclick="return doclink('link-272', 'text', 'link-252');">text</a></tt><tt class="py-op">)</tt> </tt>
1496 <a name="L346"></a><tt class="py-lineno">346</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEquals</tt><tt class="py-op">(</tt><tt class="py-string">'Dag'</tt><tt class="py-op">,</tt> <tt class="py-name">r</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">.</tt><tt id="link-273" class="py-name"><a title="lxml.etree.QName.text
1497 lxml.etree._AppendOnlyElementProxy.text
1498 lxml.etree._Element.text
1499 lxml.etree._Entity.text
1500 lxml.etree._ModifyContentOnlyProxy.text
1501 lxml.etree._ReadOnlyEntityProxy.text
1502 lxml.etree._ReadOnlyProxy.text
1503 lxml.etree.__ContentOnlyElement.text
1504 lxml.objectify.ObjectifiedElement.text
1505 xml.etree.ElementTree.Element.text" class="py-name" href="#" onclick="return doclink('link-273', 'text', 'link-252');">text</a></tt><tt class="py-op">)</tt> </tt>
1506 </div><a name="L347"></a><tt class="py-lineno">347</tt> <tt class="py-line"> </tt>
1507 <a name="ETreeXPathTestCase.test_xpath_extensions_nodes_append2"></a><div id="ETreeXPathTestCase.test_xpath_extensions_nodes_append2-def"><a name="L348"></a><tt class="py-lineno">348</tt> <a class="py-toggle" href="#" id="ETreeXPathTestCase.test_xpath_extensions_nodes_append2-toggle" onclick="return toggle('ETreeXPathTestCase.test_xpath_extensions_nodes_append2');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="lxml.tests.test_xpathevaluator.ETreeXPathTestCase-class.html#test_xpath_extensions_nodes_append2">test_xpath_extensions_nodes_append2</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
1508 </div><div id="ETreeXPathTestCase.test_xpath_extensions_nodes_append2-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="ETreeXPathTestCase.test_xpath_extensions_nodes_append2-expanded"><a name="L349"></a><tt class="py-lineno">349</tt> <tt class="py-line"> <tt class="py-keyword">def</tt> <tt class="py-def-name">f</tt><tt class="py-op">(</tt><tt class="py-param">evaluator</tt><tt class="py-op">,</tt> <tt class="py-param">nodes</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
1509 <a name="L350"></a><tt class="py-lineno">350</tt> <tt class="py-line"> <tt class="py-name">r</tt> <tt class="py-op">=</tt> <tt id="link-274" class="py-name"><a title="lxml.etree
1510 lxml.sax.ElementTreeContentHandler.etree
1511 lxml.tests.test_elementtree.CElementTreeTestCase.etree
1512 lxml.tests.test_elementtree.ETreeTestCaseBase.etree
1513 lxml.tests.test_io.IOTestCaseBase.etree" class="py-name" href="#" onclick="return doclink('link-274', 'etree', 'link-9');">etree</a></tt><tt class="py-op">.</tt><tt id="link-275" class="py-name"><a title="lxml.cssselect.Element
1516 lxml.objectify.Element
1517 lxml.tests.test_pyclasslookup.PyClassLookupTestCase.Element
1518 xml.etree.ElementTree.Element" class="py-name" href="#" onclick="return doclink('link-275', 'Element', 'link-173');">Element</a></tt><tt class="py-op">(</tt><tt class="py-string">'results'</tt><tt class="py-op">)</tt> </tt>
1519 <a name="L351"></a><tt class="py-lineno">351</tt> <tt class="py-line"> <tt class="py-name">b</tt> <tt class="py-op">=</tt> <tt id="link-276" class="py-name"><a title="lxml.etree
1520 lxml.sax.ElementTreeContentHandler.etree
1521 lxml.tests.test_elementtree.CElementTreeTestCase.etree
1522 lxml.tests.test_elementtree.ETreeTestCaseBase.etree
1523 lxml.tests.test_io.IOTestCaseBase.etree" class="py-name" href="#" onclick="return doclink('link-276', 'etree', 'link-9');">etree</a></tt><tt class="py-op">.</tt><tt id="link-277" class="py-name"><a title="lxml.etree.SubElement" class="py-name" href="#" onclick="return doclink('link-277', 'SubElement', 'link-175');">SubElement</a></tt><tt class="py-op">(</tt><tt class="py-name">r</tt><tt class="py-op">,</tt> <tt class="py-string">'result'</tt><tt class="py-op">)</tt> </tt>
1524 <a name="L352"></a><tt class="py-lineno">352</tt> <tt class="py-line"> <tt class="py-name">b</tt><tt class="py-op">.</tt><tt id="link-278" class="py-name"><a title="lxml.etree.QName.text
1525 lxml.etree._AppendOnlyElementProxy.text
1526 lxml.etree._Element.text
1527 lxml.etree._Entity.text
1528 lxml.etree._ModifyContentOnlyProxy.text
1529 lxml.etree._ReadOnlyEntityProxy.text
1530 lxml.etree._ReadOnlyProxy.text
1531 lxml.etree.__ContentOnlyElement.text
1532 lxml.objectify.ObjectifiedElement.text
1533 xml.etree.ElementTree.Element.text" class="py-name" href="#" onclick="return doclink('link-278', 'text', 'link-252');">text</a></tt> <tt class="py-op">=</tt> <tt class="py-string">'Hoi'</tt> </tt>
1534 <a name="L353"></a><tt class="py-lineno">353</tt> <tt class="py-line"> <tt class="py-name">b</tt> <tt class="py-op">=</tt> <tt id="link-279" class="py-name"><a title="lxml.etree
1535 lxml.sax.ElementTreeContentHandler.etree
1536 lxml.tests.test_elementtree.CElementTreeTestCase.etree
1537 lxml.tests.test_elementtree.ETreeTestCaseBase.etree
1538 lxml.tests.test_io.IOTestCaseBase.etree" class="py-name" href="#" onclick="return doclink('link-279', 'etree', 'link-9');">etree</a></tt><tt class="py-op">.</tt><tt id="link-280" class="py-name"><a title="lxml.etree.SubElement" class="py-name" href="#" onclick="return doclink('link-280', 'SubElement', 'link-175');">SubElement</a></tt><tt class="py-op">(</tt><tt class="py-name">r</tt><tt class="py-op">,</tt> <tt class="py-string">'result'</tt><tt class="py-op">)</tt> </tt>
1539 <a name="L354"></a><tt class="py-lineno">354</tt> <tt class="py-line"> <tt class="py-name">b</tt><tt class="py-op">.</tt><tt id="link-281" class="py-name"><a title="lxml.etree.QName.text
1540 lxml.etree._AppendOnlyElementProxy.text
1541 lxml.etree._Element.text
1542 lxml.etree._Entity.text
1543 lxml.etree._ModifyContentOnlyProxy.text
1544 lxml.etree._ReadOnlyEntityProxy.text
1545 lxml.etree._ReadOnlyProxy.text
1546 lxml.etree.__ContentOnlyElement.text
1547 lxml.objectify.ObjectifiedElement.text
1548 xml.etree.ElementTree.Element.text" class="py-name" href="#" onclick="return doclink('link-281', 'text', 'link-252');">text</a></tt> <tt class="py-op">=</tt> <tt class="py-string">'Dag'</tt> </tt>
1549 <a name="L355"></a><tt class="py-lineno">355</tt> <tt class="py-line"> <tt class="py-name">r</tt><tt class="py-op">.</tt><tt id="link-282" class="py-name" targets="Method lxml.etree._AppendOnlyElementProxy.append()=lxml.etree._AppendOnlyElementProxy-class.html#append,Method lxml.etree._Element.append()=lxml.etree._Element-class.html#append,Method lxml.etree._OpaqueDocumentWrapper.append()=lxml.etree._OpaqueDocumentWrapper-class.html#append,Method lxml.etree.__ContentOnlyElement.append()=lxml.etree.__ContentOnlyElement-class.html#append"><a title="lxml.etree._AppendOnlyElementProxy.append
1550 lxml.etree._Element.append
1551 lxml.etree._OpaqueDocumentWrapper.append
1552 lxml.etree.__ContentOnlyElement.append" class="py-name" href="#" onclick="return doclink('link-282', 'append', 'link-282');">append</a></tt><tt class="py-op">(</tt><tt class="py-name">nodes</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
1553 <a name="L356"></a><tt class="py-lineno">356</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">r</tt> </tt>
1554 </div><a name="L357"></a><tt class="py-lineno">357</tt> <tt class="py-line"> </tt>
1555 <a name="L358"></a><tt class="py-lineno">358</tt> <tt class="py-line"> <tt class="py-name">x</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-283" class="py-name"><a title="lxml.cssselect.parse
1556 lxml.etree._ElementTree.parse
1558 lxml.html.ElementSoup.parse
1559 lxml.html.html5parser.parse
1561 lxml.html.soupparser.parse
1562 lxml.objectify.parse
1563 lxml.tests.common_imports.HelperTestCase.parse" class="py-name" href="#" onclick="return doclink('link-283', 'parse', 'link-14');">parse</a></tt><tt class="py-op">(</tt><tt class="py-string">'<result>Honk</result>'</tt><tt class="py-op">)</tt> </tt>
1564 <a name="L359"></a><tt class="py-lineno">359</tt> <tt class="py-line"> <tt class="py-name">e</tt> <tt class="py-op">=</tt> <tt id="link-284" class="py-name"><a title="lxml.etree
1565 lxml.sax.ElementTreeContentHandler.etree
1566 lxml.tests.test_elementtree.CElementTreeTestCase.etree
1567 lxml.tests.test_elementtree.ETreeTestCaseBase.etree
1568 lxml.tests.test_io.IOTestCaseBase.etree" class="py-name" href="#" onclick="return doclink('link-284', 'etree', 'link-9');">etree</a></tt><tt class="py-op">.</tt><tt id="link-285" class="py-name"><a title="lxml.etree.XPathEvaluator" class="py-name" href="#" onclick="return doclink('link-285', 'XPathEvaluator', 'link-204');">XPathEvaluator</a></tt><tt class="py-op">(</tt><tt class="py-name">x</tt><tt class="py-op">,</tt> <tt class="py-name">extensions</tt><tt class="py-op">=</tt><tt class="py-op">[</tt><tt class="py-op">{</tt><tt class="py-op">(</tt><tt class="py-name">None</tt><tt class="py-op">,</tt> <tt class="py-string">'foo'</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> <tt class="py-name">f</tt><tt class="py-op">}</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
1569 <a name="L360"></a><tt class="py-lineno">360</tt> <tt class="py-line"> <tt class="py-name">r</tt> <tt class="py-op">=</tt> <tt class="py-name">e</tt><tt class="py-op">(</tt><tt class="py-string">"foo(/*)/result"</tt><tt class="py-op">)</tt> </tt>
1570 <a name="L361"></a><tt class="py-lineno">361</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEquals</tt><tt class="py-op">(</tt><tt class="py-number">3</tt><tt class="py-op">,</tt> <tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">r</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
1571 <a name="L362"></a><tt class="py-lineno">362</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEquals</tt><tt class="py-op">(</tt><tt class="py-string">'Hoi'</tt><tt class="py-op">,</tt> <tt class="py-name">r</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">.</tt><tt id="link-286" class="py-name"><a title="lxml.etree.QName.text
1572 lxml.etree._AppendOnlyElementProxy.text
1573 lxml.etree._Element.text
1574 lxml.etree._Entity.text
1575 lxml.etree._ModifyContentOnlyProxy.text
1576 lxml.etree._ReadOnlyEntityProxy.text
1577 lxml.etree._ReadOnlyProxy.text
1578 lxml.etree.__ContentOnlyElement.text
1579 lxml.objectify.ObjectifiedElement.text
1580 xml.etree.ElementTree.Element.text" class="py-name" href="#" onclick="return doclink('link-286', 'text', 'link-252');">text</a></tt><tt class="py-op">)</tt> </tt>
1581 <a name="L363"></a><tt class="py-lineno">363</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEquals</tt><tt class="py-op">(</tt><tt class="py-string">'Dag'</tt><tt class="py-op">,</tt> <tt class="py-name">r</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">.</tt><tt id="link-287" class="py-name"><a title="lxml.etree.QName.text
1582 lxml.etree._AppendOnlyElementProxy.text
1583 lxml.etree._Element.text
1584 lxml.etree._Entity.text
1585 lxml.etree._ModifyContentOnlyProxy.text
1586 lxml.etree._ReadOnlyEntityProxy.text
1587 lxml.etree._ReadOnlyProxy.text
1588 lxml.etree.__ContentOnlyElement.text
1589 lxml.objectify.ObjectifiedElement.text
1590 xml.etree.ElementTree.Element.text" class="py-name" href="#" onclick="return doclink('link-287', 'text', 'link-252');">text</a></tt><tt class="py-op">)</tt> </tt>
1591 <a name="L364"></a><tt class="py-lineno">364</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEquals</tt><tt class="py-op">(</tt><tt class="py-string">'Honk'</tt><tt class="py-op">,</tt> <tt class="py-name">r</tt><tt class="py-op">[</tt><tt class="py-number">2</tt><tt class="py-op">]</tt><tt class="py-op">.</tt><tt id="link-288" class="py-name"><a title="lxml.etree.QName.text
1592 lxml.etree._AppendOnlyElementProxy.text
1593 lxml.etree._Element.text
1594 lxml.etree._Entity.text
1595 lxml.etree._ModifyContentOnlyProxy.text
1596 lxml.etree._ReadOnlyEntityProxy.text
1597 lxml.etree._ReadOnlyProxy.text
1598 lxml.etree.__ContentOnlyElement.text
1599 lxml.objectify.ObjectifiedElement.text
1600 xml.etree.ElementTree.Element.text" class="py-name" href="#" onclick="return doclink('link-288', 'text', 'link-252');">text</a></tt><tt class="py-op">)</tt> </tt>
1601 </div><a name="L365"></a><tt class="py-lineno">365</tt> <tt class="py-line"> </tt>
1602 <a name="ETreeXPathTestCase.test_xpath_context_node"></a><div id="ETreeXPathTestCase.test_xpath_context_node-def"><a name="L366"></a><tt class="py-lineno">366</tt> <a class="py-toggle" href="#" id="ETreeXPathTestCase.test_xpath_context_node-toggle" onclick="return toggle('ETreeXPathTestCase.test_xpath_context_node');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="lxml.tests.test_xpathevaluator.ETreeXPathTestCase-class.html#test_xpath_context_node">test_xpath_context_node</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
1603 </div><div id="ETreeXPathTestCase.test_xpath_context_node-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="ETreeXPathTestCase.test_xpath_context_node-expanded"><a name="L367"></a><tt class="py-lineno">367</tt> <tt class="py-line"> <tt class="py-name">tree</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-289" class="py-name"><a title="lxml.cssselect.parse
1604 lxml.etree._ElementTree.parse
1606 lxml.html.ElementSoup.parse
1607 lxml.html.html5parser.parse
1609 lxml.html.soupparser.parse
1610 lxml.objectify.parse
1611 lxml.tests.common_imports.HelperTestCase.parse" class="py-name" href="#" onclick="return doclink('link-289', 'parse', 'link-14');">parse</a></tt><tt class="py-op">(</tt><tt class="py-string">'<root><a/><b><c/></b></root>'</tt><tt class="py-op">)</tt> </tt>
1612 <a name="L368"></a><tt class="py-lineno">368</tt> <tt class="py-line"> </tt>
1613 <a name="L369"></a><tt class="py-lineno">369</tt> <tt class="py-line"> <tt class="py-name">check_call</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> </tt>
1614 <a name="L370"></a><tt class="py-lineno">370</tt> <tt class="py-line"> <tt class="py-keyword">def</tt> <tt class="py-def-name">check_context</tt><tt class="py-op">(</tt><tt class="py-param">ctxt</tt><tt class="py-op">,</tt> <tt class="py-param">nodes</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
1615 <a name="L371"></a><tt class="py-lineno">371</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEquals</tt><tt class="py-op">(</tt><tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">nodes</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-number">1</tt><tt class="py-op">)</tt> </tt>
1616 <a name="L372"></a><tt class="py-lineno">372</tt> <tt class="py-line"> <tt class="py-name">check_call</tt><tt class="py-op">.</tt><tt id="link-290" class="py-name"><a title="lxml.etree._AppendOnlyElementProxy.append
1617 lxml.etree._Element.append
1618 lxml.etree._OpaqueDocumentWrapper.append
1619 lxml.etree.__ContentOnlyElement.append" class="py-name" href="#" onclick="return doclink('link-290', 'append', 'link-282');">append</a></tt><tt class="py-op">(</tt><tt class="py-name">nodes</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">.</tt><tt id="link-291" class="py-name"><a title="lxml.etree._Comment.tag
1620 lxml.etree._Element.tag
1621 lxml.etree._Entity.tag
1622 lxml.etree._ProcessingInstruction.tag
1623 lxml.etree._ReadOnlyProxy.tag
1624 lxml.tests.test_xpathevaluator.tag
1625 xml.etree.ElementTree.Element.tag" class="py-name" href="#" onclick="return doclink('link-291', 'tag', 'link-88');">tag</a></tt><tt class="py-op">)</tt> </tt>
1626 <a name="L373"></a><tt class="py-lineno">373</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEquals</tt><tt class="py-op">(</tt><tt class="py-name">ctxt</tt><tt class="py-op">.</tt><tt id="link-292" class="py-name" targets="Variable lxml.etree._BaseContext.context_node=lxml.etree._BaseContext-class.html#context_node"><a title="lxml.etree._BaseContext.context_node" class="py-name" href="#" onclick="return doclink('link-292', 'context_node', 'link-292');">context_node</a></tt><tt class="py-op">,</tt> <tt class="py-name">nodes</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
1627 <a name="L374"></a><tt class="py-lineno">374</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">True</tt> </tt>
1628 </div><a name="L375"></a><tt class="py-lineno">375</tt> <tt class="py-line"> </tt>
1629 <a name="L376"></a><tt class="py-lineno">376</tt> <tt class="py-line"> <tt id="link-293" class="py-name" targets="Method lxml.etree._Element.find()=lxml.etree._Element-class.html#find,Method lxml.etree._ElementTree.find()=lxml.etree._ElementTree-class.html#find,Variable lxml.objectify.ObjectPath.find=lxml.objectify.ObjectPath-class.html#find,Method lxml.objectify.ObjectifiedElement.find()=lxml.objectify.ObjectifiedElement-class.html#find"><a title="lxml.etree._Element.find
1630 lxml.etree._ElementTree.find
1631 lxml.objectify.ObjectPath.find
1632 lxml.objectify.ObjectifiedElement.find" class="py-name" href="#" onclick="return doclink('link-293', 'find', 'link-293');">find</a></tt> <tt class="py-op">=</tt> <tt id="link-294" class="py-name"><a title="lxml.etree
1633 lxml.sax.ElementTreeContentHandler.etree
1634 lxml.tests.test_elementtree.CElementTreeTestCase.etree
1635 lxml.tests.test_elementtree.ETreeTestCaseBase.etree
1636 lxml.tests.test_io.IOTestCaseBase.etree" class="py-name" href="#" onclick="return doclink('link-294', 'etree', 'link-9');">etree</a></tt><tt class="py-op">.</tt><tt id="link-295" class="py-name"><a title="lxml.etree.XPath" class="py-name" href="#" onclick="return doclink('link-295', 'XPath', 'link-156');">XPath</a></tt><tt class="py-op">(</tt><tt class="py-string">"//*[p:foo(.)]"</tt><tt class="py-op">,</tt> </tt>
1637 <a name="L377"></a><tt class="py-lineno">377</tt> <tt class="py-line"> <tt class="py-name">namespaces</tt><tt class="py-op">=</tt><tt class="py-op">{</tt><tt class="py-string">'p'</tt> <tt class="py-op">:</tt> <tt class="py-string">'ns'</tt><tt class="py-op">}</tt><tt class="py-op">,</tt> </tt>
1638 <a name="L378"></a><tt class="py-lineno">378</tt> <tt class="py-line"> <tt class="py-name">extensions</tt><tt class="py-op">=</tt><tt class="py-op">[</tt><tt class="py-op">{</tt><tt class="py-op">(</tt><tt class="py-string">'ns'</tt><tt class="py-op">,</tt> <tt class="py-string">'foo'</tt><tt class="py-op">)</tt> <tt class="py-op">:</tt> <tt class="py-name">check_context</tt><tt class="py-op">}</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
1639 <a name="L379"></a><tt class="py-lineno">379</tt> <tt class="py-line"> <tt id="link-296" class="py-name"><a title="lxml.etree._Element.find
1640 lxml.etree._ElementTree.find
1641 lxml.objectify.ObjectPath.find
1642 lxml.objectify.ObjectifiedElement.find" class="py-name" href="#" onclick="return doclink('link-296', 'find', 'link-293');">find</a></tt><tt class="py-op">(</tt><tt class="py-name">tree</tt><tt class="py-op">)</tt> </tt>
1643 <a name="L380"></a><tt class="py-lineno">380</tt> <tt class="py-line"> </tt>
1644 <a name="L381"></a><tt class="py-lineno">381</tt> <tt class="py-line"> <tt class="py-name">check_call</tt><tt class="py-op">.</tt><tt class="py-name">sort</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
1645 <a name="L382"></a><tt class="py-lineno">382</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEquals</tt><tt class="py-op">(</tt><tt class="py-name">check_call</tt><tt class="py-op">,</tt> <tt class="py-op">[</tt><tt class="py-string">"a"</tt><tt class="py-op">,</tt> <tt class="py-string">"b"</tt><tt class="py-op">,</tt> <tt class="py-string">"c"</tt><tt class="py-op">,</tt> <tt class="py-string">"root"</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
1646 </div><a name="L383"></a><tt class="py-lineno">383</tt> <tt class="py-line"> </tt>
1647 <a name="ETreeXPathTestCase.test_xpath_eval_context_propagation"></a><div id="ETreeXPathTestCase.test_xpath_eval_context_propagation-def"><a name="L384"></a><tt class="py-lineno">384</tt> <a class="py-toggle" href="#" id="ETreeXPathTestCase.test_xpath_eval_context_propagation-toggle" onclick="return toggle('ETreeXPathTestCase.test_xpath_eval_context_propagation');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="lxml.tests.test_xpathevaluator.ETreeXPathTestCase-class.html#test_xpath_eval_context_propagation">test_xpath_eval_context_propagation</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
1648 </div><div id="ETreeXPathTestCase.test_xpath_eval_context_propagation-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="ETreeXPathTestCase.test_xpath_eval_context_propagation-expanded"><a name="L385"></a><tt class="py-lineno">385</tt> <tt class="py-line"> <tt class="py-name">tree</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-297" class="py-name"><a title="lxml.cssselect.parse
1649 lxml.etree._ElementTree.parse
1651 lxml.html.ElementSoup.parse
1652 lxml.html.html5parser.parse
1654 lxml.html.soupparser.parse
1655 lxml.objectify.parse
1656 lxml.tests.common_imports.HelperTestCase.parse" class="py-name" href="#" onclick="return doclink('link-297', 'parse', 'link-14');">parse</a></tt><tt class="py-op">(</tt><tt class="py-string">'<root><a/><b><c/></b></root>'</tt><tt class="py-op">)</tt> </tt>
1657 <a name="L386"></a><tt class="py-lineno">386</tt> <tt class="py-line"> </tt>
1658 <a name="L387"></a><tt class="py-lineno">387</tt> <tt class="py-line"> <tt class="py-name">check_call</tt> <tt class="py-op">=</tt> <tt class="py-op">{</tt><tt class="py-op">}</tt> </tt>
1659 <a name="L388"></a><tt class="py-lineno">388</tt> <tt class="py-line"> <tt class="py-keyword">def</tt> <tt class="py-def-name">check_context</tt><tt class="py-op">(</tt><tt class="py-param">ctxt</tt><tt class="py-op">,</tt> <tt class="py-param">nodes</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
1660 <a name="L389"></a><tt class="py-lineno">389</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEquals</tt><tt class="py-op">(</tt><tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">nodes</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-number">1</tt><tt class="py-op">)</tt> </tt>
1661 <a name="L390"></a><tt class="py-lineno">390</tt> <tt class="py-line"> <tt id="link-298" class="py-name"><a title="lxml.etree._Comment.tag
1662 lxml.etree._Element.tag
1663 lxml.etree._Entity.tag
1664 lxml.etree._ProcessingInstruction.tag
1665 lxml.etree._ReadOnlyProxy.tag
1666 lxml.tests.test_xpathevaluator.tag
1667 xml.etree.ElementTree.Element.tag" class="py-name" href="#" onclick="return doclink('link-298', 'tag', 'link-88');">tag</a></tt> <tt class="py-op">=</tt> <tt class="py-name">nodes</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">.</tt><tt id="link-299" class="py-name"><a title="lxml.etree._Comment.tag
1668 lxml.etree._Element.tag
1669 lxml.etree._Entity.tag
1670 lxml.etree._ProcessingInstruction.tag
1671 lxml.etree._ReadOnlyProxy.tag
1672 lxml.tests.test_xpathevaluator.tag
1673 xml.etree.ElementTree.Element.tag" class="py-name" href="#" onclick="return doclink('link-299', 'tag', 'link-88');">tag</a></tt> </tt>
1674 <a name="L391"></a><tt class="py-lineno">391</tt> <tt class="py-line"> <tt class="py-comment"># empty during the "b" call, a "b" during the "c" call</tt> </tt>
1675 <a name="L392"></a><tt class="py-lineno">392</tt> <tt class="py-line"> <tt class="py-name">check_call</tt><tt class="py-op">[</tt><tt id="link-300" class="py-name"><a title="lxml.etree._Comment.tag
1676 lxml.etree._Element.tag
1677 lxml.etree._Entity.tag
1678 lxml.etree._ProcessingInstruction.tag
1679 lxml.etree._ReadOnlyProxy.tag
1680 lxml.tests.test_xpathevaluator.tag
1681 xml.etree.ElementTree.Element.tag" class="py-name" href="#" onclick="return doclink('link-300', 'tag', 'link-88');">tag</a></tt><tt class="py-op">]</tt> <tt class="py-op">=</tt> <tt class="py-name">ctxt</tt><tt class="py-op">.</tt><tt id="link-301" class="py-name" targets="Variable lxml.etree._BaseContext.eval_context=lxml.etree._BaseContext-class.html#eval_context"><a title="lxml.etree._BaseContext.eval_context" class="py-name" href="#" onclick="return doclink('link-301', 'eval_context', 'link-301');">eval_context</a></tt><tt class="py-op">.</tt><tt id="link-302" 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
1682 lxml.etree._Element.get
1683 lxml.etree._IDDict.get
1684 lxml.etree._ProcessingInstruction.get
1685 lxml.etree._ReadOnlyElementProxy.get
1686 lxml.etree.__ContentOnlyElement.get" class="py-name" href="#" onclick="return doclink('link-302', 'get', 'link-302');">get</a></tt><tt class="py-op">(</tt><tt class="py-string">"b"</tt><tt class="py-op">)</tt> </tt>
1687 <a name="L393"></a><tt class="py-lineno">393</tt> <tt class="py-line"> <tt class="py-name">ctxt</tt><tt class="py-op">.</tt><tt id="link-303" class="py-name"><a title="lxml.etree._BaseContext.eval_context" class="py-name" href="#" onclick="return doclink('link-303', 'eval_context', 'link-301');">eval_context</a></tt><tt class="py-op">[</tt><tt id="link-304" class="py-name"><a title="lxml.etree._Comment.tag
1688 lxml.etree._Element.tag
1689 lxml.etree._Entity.tag
1690 lxml.etree._ProcessingInstruction.tag
1691 lxml.etree._ReadOnlyProxy.tag
1692 lxml.tests.test_xpathevaluator.tag
1693 xml.etree.ElementTree.Element.tag" class="py-name" href="#" onclick="return doclink('link-304', 'tag', 'link-88');">tag</a></tt><tt class="py-op">]</tt> <tt class="py-op">=</tt> <tt id="link-305" class="py-name"><a title="lxml.etree._Comment.tag
1694 lxml.etree._Element.tag
1695 lxml.etree._Entity.tag
1696 lxml.etree._ProcessingInstruction.tag
1697 lxml.etree._ReadOnlyProxy.tag
1698 lxml.tests.test_xpathevaluator.tag
1699 xml.etree.ElementTree.Element.tag" class="py-name" href="#" onclick="return doclink('link-305', 'tag', 'link-88');">tag</a></tt> </tt>
1700 <a name="L394"></a><tt class="py-lineno">394</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">True</tt> </tt>
1701 </div><a name="L395"></a><tt class="py-lineno">395</tt> <tt class="py-line"> </tt>
1702 <a name="L396"></a><tt class="py-lineno">396</tt> <tt class="py-line"> <tt id="link-306" class="py-name"><a title="lxml.etree._Element.find
1703 lxml.etree._ElementTree.find
1704 lxml.objectify.ObjectPath.find
1705 lxml.objectify.ObjectifiedElement.find" class="py-name" href="#" onclick="return doclink('link-306', 'find', 'link-293');">find</a></tt> <tt class="py-op">=</tt> <tt id="link-307" class="py-name"><a title="lxml.etree
1706 lxml.sax.ElementTreeContentHandler.etree
1707 lxml.tests.test_elementtree.CElementTreeTestCase.etree
1708 lxml.tests.test_elementtree.ETreeTestCaseBase.etree
1709 lxml.tests.test_io.IOTestCaseBase.etree" class="py-name" href="#" onclick="return doclink('link-307', 'etree', 'link-9');">etree</a></tt><tt class="py-op">.</tt><tt id="link-308" class="py-name"><a title="lxml.etree.XPath" class="py-name" href="#" onclick="return doclink('link-308', 'XPath', 'link-156');">XPath</a></tt><tt class="py-op">(</tt><tt class="py-string">"//b[p:foo(.)]/c[p:foo(.)]"</tt><tt class="py-op">,</tt> </tt>
1710 <a name="L397"></a><tt class="py-lineno">397</tt> <tt class="py-line"> <tt class="py-name">namespaces</tt><tt class="py-op">=</tt><tt class="py-op">{</tt><tt class="py-string">'p'</tt> <tt class="py-op">:</tt> <tt class="py-string">'ns'</tt><tt class="py-op">}</tt><tt class="py-op">,</tt> </tt>
1711 <a name="L398"></a><tt class="py-lineno">398</tt> <tt class="py-line"> <tt class="py-name">extensions</tt><tt class="py-op">=</tt><tt class="py-op">[</tt><tt class="py-op">{</tt><tt class="py-op">(</tt><tt class="py-string">'ns'</tt><tt class="py-op">,</tt> <tt class="py-string">'foo'</tt><tt class="py-op">)</tt> <tt class="py-op">:</tt> <tt class="py-name">check_context</tt><tt class="py-op">}</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
1712 <a name="L399"></a><tt class="py-lineno">399</tt> <tt class="py-line"> <tt class="py-name">result</tt> <tt class="py-op">=</tt> <tt id="link-309" class="py-name"><a title="lxml.etree._Element.find
1713 lxml.etree._ElementTree.find
1714 lxml.objectify.ObjectPath.find
1715 lxml.objectify.ObjectifiedElement.find" class="py-name" href="#" onclick="return doclink('link-309', 'find', 'link-293');">find</a></tt><tt class="py-op">(</tt><tt class="py-name">tree</tt><tt class="py-op">)</tt> </tt>
1716 <a name="L400"></a><tt class="py-lineno">400</tt> <tt class="py-line"> </tt>
1717 <a name="L401"></a><tt class="py-lineno">401</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEquals</tt><tt class="py-op">(</tt><tt class="py-name">result</tt><tt class="py-op">,</tt> <tt class="py-op">[</tt><tt class="py-name">tree</tt><tt class="py-op">.</tt><tt id="link-310" class="py-name"><a title="lxml.etree._ElementTree.getroot" class="py-name" href="#" onclick="return doclink('link-310', 'getroot', 'link-36');">getroot</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
1718 <a name="L402"></a><tt class="py-lineno">402</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEquals</tt><tt class="py-op">(</tt><tt class="py-name">check_call</tt><tt class="py-op">,</tt> <tt class="py-op">{</tt><tt class="py-string">'b'</tt><tt class="py-op">:</tt><tt class="py-name">None</tt><tt class="py-op">,</tt> <tt class="py-string">'c'</tt><tt class="py-op">:</tt><tt class="py-string">'b'</tt><tt class="py-op">}</tt><tt class="py-op">)</tt> </tt>
1719 </div><a name="L403"></a><tt class="py-lineno">403</tt> <tt class="py-line"> </tt>
1720 <a name="ETreeXPathTestCase.test_xpath_eval_context_clear"></a><div id="ETreeXPathTestCase.test_xpath_eval_context_clear-def"><a name="L404"></a><tt class="py-lineno">404</tt> <a class="py-toggle" href="#" id="ETreeXPathTestCase.test_xpath_eval_context_clear-toggle" onclick="return toggle('ETreeXPathTestCase.test_xpath_eval_context_clear');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="lxml.tests.test_xpathevaluator.ETreeXPathTestCase-class.html#test_xpath_eval_context_clear">test_xpath_eval_context_clear</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
1721 </div><div id="ETreeXPathTestCase.test_xpath_eval_context_clear-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="ETreeXPathTestCase.test_xpath_eval_context_clear-expanded"><a name="L405"></a><tt class="py-lineno">405</tt> <tt class="py-line"> <tt class="py-name">tree</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-311" class="py-name"><a title="lxml.cssselect.parse
1722 lxml.etree._ElementTree.parse
1724 lxml.html.ElementSoup.parse
1725 lxml.html.html5parser.parse
1727 lxml.html.soupparser.parse
1728 lxml.objectify.parse
1729 lxml.tests.common_imports.HelperTestCase.parse" class="py-name" href="#" onclick="return doclink('link-311', 'parse', 'link-14');">parse</a></tt><tt class="py-op">(</tt><tt class="py-string">'<root><a/><b><c/></b></root>'</tt><tt class="py-op">)</tt> </tt>
1730 <a name="L406"></a><tt class="py-lineno">406</tt> <tt class="py-line"> </tt>
1731 <a name="L407"></a><tt class="py-lineno">407</tt> <tt class="py-line"> <tt class="py-name">check_call</tt> <tt class="py-op">=</tt> <tt class="py-op">{</tt><tt class="py-op">}</tt> </tt>
1732 <a name="L408"></a><tt class="py-lineno">408</tt> <tt class="py-line"> <tt class="py-keyword">def</tt> <tt class="py-def-name">check_context</tt><tt class="py-op">(</tt><tt class="py-param">ctxt</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
1733 <a name="L409"></a><tt class="py-lineno">409</tt> <tt class="py-line"> <tt class="py-name">check_call</tt><tt class="py-op">[</tt><tt class="py-string">"done"</tt><tt class="py-op">]</tt> <tt class="py-op">=</tt> <tt class="py-name">True</tt> </tt>
1734 <a name="L410"></a><tt class="py-lineno">410</tt> <tt class="py-line"> <tt class="py-comment"># context must be empty for each new evaluation</tt> </tt>
1735 <a name="L411"></a><tt class="py-lineno">411</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEquals</tt><tt class="py-op">(</tt><tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">ctxt</tt><tt class="py-op">.</tt><tt id="link-312" class="py-name"><a title="lxml.etree._BaseContext.eval_context" class="py-name" href="#" onclick="return doclink('link-312', 'eval_context', 'link-301');">eval_context</a></tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-number">0</tt><tt class="py-op">)</tt> </tt>
1736 <a name="L412"></a><tt class="py-lineno">412</tt> <tt class="py-line"> <tt class="py-name">ctxt</tt><tt class="py-op">.</tt><tt id="link-313" class="py-name"><a title="lxml.etree._BaseContext.eval_context" class="py-name" href="#" onclick="return doclink('link-313', 'eval_context', 'link-301');">eval_context</a></tt><tt class="py-op">[</tt><tt class="py-string">"test"</tt><tt class="py-op">]</tt> <tt class="py-op">=</tt> <tt class="py-name">True</tt> </tt>
1737 <a name="L413"></a><tt class="py-lineno">413</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">True</tt> </tt>
1738 </div><a name="L414"></a><tt class="py-lineno">414</tt> <tt class="py-line"> </tt>
1739 <a name="L415"></a><tt class="py-lineno">415</tt> <tt class="py-line"> <tt id="link-314" class="py-name"><a title="lxml.etree._Element.find
1740 lxml.etree._ElementTree.find
1741 lxml.objectify.ObjectPath.find
1742 lxml.objectify.ObjectifiedElement.find" class="py-name" href="#" onclick="return doclink('link-314', 'find', 'link-293');">find</a></tt> <tt class="py-op">=</tt> <tt id="link-315" class="py-name"><a title="lxml.etree
1743 lxml.sax.ElementTreeContentHandler.etree
1744 lxml.tests.test_elementtree.CElementTreeTestCase.etree
1745 lxml.tests.test_elementtree.ETreeTestCaseBase.etree
1746 lxml.tests.test_io.IOTestCaseBase.etree" class="py-name" href="#" onclick="return doclink('link-315', 'etree', 'link-9');">etree</a></tt><tt class="py-op">.</tt><tt id="link-316" class="py-name"><a title="lxml.etree.XPath" class="py-name" href="#" onclick="return doclink('link-316', 'XPath', 'link-156');">XPath</a></tt><tt class="py-op">(</tt><tt class="py-string">"//b[p:foo()]"</tt><tt class="py-op">,</tt> </tt>
1747 <a name="L416"></a><tt class="py-lineno">416</tt> <tt class="py-line"> <tt class="py-name">namespaces</tt><tt class="py-op">=</tt><tt class="py-op">{</tt><tt class="py-string">'p'</tt> <tt class="py-op">:</tt> <tt class="py-string">'ns'</tt><tt class="py-op">}</tt><tt class="py-op">,</tt> </tt>
1748 <a name="L417"></a><tt class="py-lineno">417</tt> <tt class="py-line"> <tt class="py-name">extensions</tt><tt class="py-op">=</tt><tt class="py-op">[</tt><tt class="py-op">{</tt><tt class="py-op">(</tt><tt class="py-string">'ns'</tt><tt class="py-op">,</tt> <tt class="py-string">'foo'</tt><tt class="py-op">)</tt> <tt class="py-op">:</tt> <tt class="py-name">check_context</tt><tt class="py-op">}</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
1749 <a name="L418"></a><tt class="py-lineno">418</tt> <tt class="py-line"> <tt class="py-name">result</tt> <tt class="py-op">=</tt> <tt id="link-317" class="py-name"><a title="lxml.etree._Element.find
1750 lxml.etree._ElementTree.find
1751 lxml.objectify.ObjectPath.find
1752 lxml.objectify.ObjectifiedElement.find" class="py-name" href="#" onclick="return doclink('link-317', 'find', 'link-293');">find</a></tt><tt class="py-op">(</tt><tt class="py-name">tree</tt><tt class="py-op">)</tt> </tt>
1753 <a name="L419"></a><tt class="py-lineno">419</tt> <tt class="py-line"> </tt>
1754 <a name="L420"></a><tt class="py-lineno">420</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEquals</tt><tt class="py-op">(</tt><tt class="py-name">result</tt><tt class="py-op">,</tt> <tt class="py-op">[</tt><tt class="py-name">tree</tt><tt class="py-op">.</tt><tt id="link-318" class="py-name"><a title="lxml.etree._ElementTree.getroot" class="py-name" href="#" onclick="return doclink('link-318', 'getroot', 'link-36');">getroot</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
1755 <a name="L421"></a><tt class="py-lineno">421</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEquals</tt><tt class="py-op">(</tt><tt class="py-name">check_call</tt><tt class="py-op">[</tt><tt class="py-string">"done"</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> <tt class="py-name">True</tt><tt class="py-op">)</tt> </tt>
1756 <a name="L422"></a><tt class="py-lineno">422</tt> <tt class="py-line"> </tt>
1757 <a name="L423"></a><tt class="py-lineno">423</tt> <tt class="py-line"> <tt class="py-name">check_call</tt><tt class="py-op">.</tt><tt id="link-319" class="py-name" targets="Method lxml.etree._Attrib.clear()=lxml.etree._Attrib-class.html#clear,Method lxml.etree._Element.clear()=lxml.etree._Element-class.html#clear,Method lxml.etree._ErrorLog.clear()=lxml.etree._ErrorLog-class.html#clear,Method lxml.etree._NamespaceRegistry.clear()=lxml.etree._NamespaceRegistry-class.html#clear"><a title="lxml.etree._Attrib.clear
1758 lxml.etree._Element.clear
1759 lxml.etree._ErrorLog.clear
1760 lxml.etree._NamespaceRegistry.clear" class="py-name" href="#" onclick="return doclink('link-319', 'clear', 'link-319');">clear</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
1761 <a name="L424"></a><tt class="py-lineno">424</tt> <tt class="py-line"> <tt id="link-320" class="py-name"><a title="lxml.etree._Element.find
1762 lxml.etree._ElementTree.find
1763 lxml.objectify.ObjectPath.find
1764 lxml.objectify.ObjectifiedElement.find" class="py-name" href="#" onclick="return doclink('link-320', 'find', 'link-293');">find</a></tt> <tt class="py-op">=</tt> <tt id="link-321" class="py-name"><a title="lxml.etree
1765 lxml.sax.ElementTreeContentHandler.etree
1766 lxml.tests.test_elementtree.CElementTreeTestCase.etree
1767 lxml.tests.test_elementtree.ETreeTestCaseBase.etree
1768 lxml.tests.test_io.IOTestCaseBase.etree" class="py-name" href="#" onclick="return doclink('link-321', 'etree', 'link-9');">etree</a></tt><tt class="py-op">.</tt><tt id="link-322" class="py-name"><a title="lxml.etree.XPath" class="py-name" href="#" onclick="return doclink('link-322', 'XPath', 'link-156');">XPath</a></tt><tt class="py-op">(</tt><tt class="py-string">"//b[p:foo()]"</tt><tt class="py-op">,</tt> </tt>
1769 <a name="L425"></a><tt class="py-lineno">425</tt> <tt class="py-line"> <tt class="py-name">namespaces</tt><tt class="py-op">=</tt><tt class="py-op">{</tt><tt class="py-string">'p'</tt> <tt class="py-op">:</tt> <tt class="py-string">'ns'</tt><tt class="py-op">}</tt><tt class="py-op">,</tt> </tt>
1770 <a name="L426"></a><tt class="py-lineno">426</tt> <tt class="py-line"> <tt class="py-name">extensions</tt><tt class="py-op">=</tt><tt class="py-op">[</tt><tt class="py-op">{</tt><tt class="py-op">(</tt><tt class="py-string">'ns'</tt><tt class="py-op">,</tt> <tt class="py-string">'foo'</tt><tt class="py-op">)</tt> <tt class="py-op">:</tt> <tt class="py-name">check_context</tt><tt class="py-op">}</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
1771 <a name="L427"></a><tt class="py-lineno">427</tt> <tt class="py-line"> <tt class="py-name">result</tt> <tt class="py-op">=</tt> <tt id="link-323" class="py-name"><a title="lxml.etree._Element.find
1772 lxml.etree._ElementTree.find
1773 lxml.objectify.ObjectPath.find
1774 lxml.objectify.ObjectifiedElement.find" class="py-name" href="#" onclick="return doclink('link-323', 'find', 'link-293');">find</a></tt><tt class="py-op">(</tt><tt class="py-name">tree</tt><tt class="py-op">)</tt> </tt>
1775 <a name="L428"></a><tt class="py-lineno">428</tt> <tt class="py-line"> </tt>
1776 <a name="L429"></a><tt class="py-lineno">429</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEquals</tt><tt class="py-op">(</tt><tt class="py-name">result</tt><tt class="py-op">,</tt> <tt class="py-op">[</tt><tt class="py-name">tree</tt><tt class="py-op">.</tt><tt id="link-324" class="py-name"><a title="lxml.etree._ElementTree.getroot" class="py-name" href="#" onclick="return doclink('link-324', 'getroot', 'link-36');">getroot</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
1777 <a name="L430"></a><tt class="py-lineno">430</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEquals</tt><tt class="py-op">(</tt><tt class="py-name">check_call</tt><tt class="py-op">[</tt><tt class="py-string">"done"</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> <tt class="py-name">True</tt><tt class="py-op">)</tt> </tt>
1778 </div><a name="L431"></a><tt class="py-lineno">431</tt> <tt class="py-line"> </tt>
1779 <a name="ETreeXPathTestCase.test_xpath_variables"></a><div id="ETreeXPathTestCase.test_xpath_variables-def"><a name="L432"></a><tt class="py-lineno">432</tt> <a class="py-toggle" href="#" id="ETreeXPathTestCase.test_xpath_variables-toggle" onclick="return toggle('ETreeXPathTestCase.test_xpath_variables');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="lxml.tests.test_xpathevaluator.ETreeXPathTestCase-class.html#test_xpath_variables">test_xpath_variables</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
1780 </div><div id="ETreeXPathTestCase.test_xpath_variables-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="ETreeXPathTestCase.test_xpath_variables-expanded"><a name="L433"></a><tt class="py-lineno">433</tt> <tt class="py-line"> <tt class="py-name">x</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-325" class="py-name"><a title="lxml.cssselect.parse
1781 lxml.etree._ElementTree.parse
1783 lxml.html.ElementSoup.parse
1784 lxml.html.html5parser.parse
1786 lxml.html.soupparser.parse
1787 lxml.objectify.parse
1788 lxml.tests.common_imports.HelperTestCase.parse" class="py-name" href="#" onclick="return doclink('link-325', 'parse', 'link-14');">parse</a></tt><tt class="py-op">(</tt><tt class="py-string">'<a attr="true"/>'</tt><tt class="py-op">)</tt> </tt>
1789 <a name="L434"></a><tt class="py-lineno">434</tt> <tt class="py-line"> <tt class="py-name">e</tt> <tt class="py-op">=</tt> <tt id="link-326" class="py-name"><a title="lxml.etree
1790 lxml.sax.ElementTreeContentHandler.etree
1791 lxml.tests.test_elementtree.CElementTreeTestCase.etree
1792 lxml.tests.test_elementtree.ETreeTestCaseBase.etree
1793 lxml.tests.test_io.IOTestCaseBase.etree" class="py-name" href="#" onclick="return doclink('link-326', 'etree', 'link-9');">etree</a></tt><tt class="py-op">.</tt><tt id="link-327" class="py-name"><a title="lxml.etree.XPathEvaluator" class="py-name" href="#" onclick="return doclink('link-327', 'XPathEvaluator', 'link-204');">XPathEvaluator</a></tt><tt class="py-op">(</tt><tt class="py-name">x</tt><tt class="py-op">)</tt> </tt>
1794 <a name="L435"></a><tt class="py-lineno">435</tt> <tt class="py-line"> </tt>
1795 <a name="L436"></a><tt class="py-lineno">436</tt> <tt class="py-line"> <tt class="py-name">expr</tt> <tt class="py-op">=</tt> <tt class="py-string">"/a[@attr=$aval]"</tt> </tt>
1796 <a name="L437"></a><tt class="py-lineno">437</tt> <tt class="py-line"> <tt class="py-name">r</tt> <tt class="py-op">=</tt> <tt class="py-name">e</tt><tt class="py-op">(</tt><tt class="py-name">expr</tt><tt class="py-op">,</tt> <tt class="py-name">aval</tt><tt class="py-op">=</tt><tt class="py-number">1</tt><tt class="py-op">)</tt> </tt>
1797 <a name="L438"></a><tt class="py-lineno">438</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEquals</tt><tt class="py-op">(</tt><tt class="py-number">0</tt><tt class="py-op">,</tt> <tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">r</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
1798 <a name="L439"></a><tt class="py-lineno">439</tt> <tt class="py-line"> </tt>
1799 <a name="L440"></a><tt class="py-lineno">440</tt> <tt class="py-line"> <tt class="py-name">r</tt> <tt class="py-op">=</tt> <tt class="py-name">e</tt><tt class="py-op">(</tt><tt class="py-name">expr</tt><tt class="py-op">,</tt> <tt class="py-name">aval</tt><tt class="py-op">=</tt><tt class="py-string">"true"</tt><tt class="py-op">)</tt> </tt>
1800 <a name="L441"></a><tt class="py-lineno">441</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEquals</tt><tt class="py-op">(</tt><tt class="py-number">1</tt><tt class="py-op">,</tt> <tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">r</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
1801 <a name="L442"></a><tt class="py-lineno">442</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEquals</tt><tt class="py-op">(</tt><tt class="py-string">"true"</tt><tt class="py-op">,</tt> <tt class="py-name">r</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">.</tt><tt id="link-328" class="py-name"><a title="lxml.etree._Attrib.get
1802 lxml.etree._Element.get
1803 lxml.etree._IDDict.get
1804 lxml.etree._ProcessingInstruction.get
1805 lxml.etree._ReadOnlyElementProxy.get
1806 lxml.etree.__ContentOnlyElement.get" class="py-name" href="#" onclick="return doclink('link-328', 'get', 'link-302');">get</a></tt><tt class="py-op">(</tt><tt class="py-string">'attr'</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
1807 <a name="L443"></a><tt class="py-lineno">443</tt> <tt class="py-line"> </tt>
1808 <a name="L444"></a><tt class="py-lineno">444</tt> <tt class="py-line"> <tt class="py-name">r</tt> <tt class="py-op">=</tt> <tt class="py-name">e</tt><tt class="py-op">(</tt><tt class="py-name">expr</tt><tt class="py-op">,</tt> <tt class="py-name">aval</tt><tt class="py-op">=</tt><tt class="py-name">True</tt><tt class="py-op">)</tt> </tt>
1809 <a name="L445"></a><tt class="py-lineno">445</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEquals</tt><tt class="py-op">(</tt><tt class="py-number">1</tt><tt class="py-op">,</tt> <tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">r</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
1810 <a name="L446"></a><tt class="py-lineno">446</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEquals</tt><tt class="py-op">(</tt><tt class="py-string">"true"</tt><tt class="py-op">,</tt> <tt class="py-name">r</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">.</tt><tt id="link-329" class="py-name"><a title="lxml.etree._Attrib.get
1811 lxml.etree._Element.get
1812 lxml.etree._IDDict.get
1813 lxml.etree._ProcessingInstruction.get
1814 lxml.etree._ReadOnlyElementProxy.get
1815 lxml.etree.__ContentOnlyElement.get" class="py-name" href="#" onclick="return doclink('link-329', 'get', 'link-302');">get</a></tt><tt class="py-op">(</tt><tt class="py-string">'attr'</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
1816 </div><a name="L447"></a><tt class="py-lineno">447</tt> <tt class="py-line"> </tt>
1817 <a name="ETreeXPathTestCase.test_xpath_variables_nodeset"></a><div id="ETreeXPathTestCase.test_xpath_variables_nodeset-def"><a name="L448"></a><tt class="py-lineno">448</tt> <a class="py-toggle" href="#" id="ETreeXPathTestCase.test_xpath_variables_nodeset-toggle" onclick="return toggle('ETreeXPathTestCase.test_xpath_variables_nodeset');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="lxml.tests.test_xpathevaluator.ETreeXPathTestCase-class.html#test_xpath_variables_nodeset">test_xpath_variables_nodeset</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
1818 </div><div id="ETreeXPathTestCase.test_xpath_variables_nodeset-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="ETreeXPathTestCase.test_xpath_variables_nodeset-expanded"><a name="L449"></a><tt class="py-lineno">449</tt> <tt class="py-line"> <tt class="py-name">x</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-330" class="py-name"><a title="lxml.cssselect.parse
1819 lxml.etree._ElementTree.parse
1821 lxml.html.ElementSoup.parse
1822 lxml.html.html5parser.parse
1824 lxml.html.soupparser.parse
1825 lxml.objectify.parse
1826 lxml.tests.common_imports.HelperTestCase.parse" class="py-name" href="#" onclick="return doclink('link-330', 'parse', 'link-14');">parse</a></tt><tt class="py-op">(</tt><tt class="py-string">'<a attr="true"/>'</tt><tt class="py-op">)</tt> </tt>
1827 <a name="L450"></a><tt class="py-lineno">450</tt> <tt class="py-line"> <tt class="py-name">e</tt> <tt class="py-op">=</tt> <tt id="link-331" class="py-name"><a title="lxml.etree
1828 lxml.sax.ElementTreeContentHandler.etree
1829 lxml.tests.test_elementtree.CElementTreeTestCase.etree
1830 lxml.tests.test_elementtree.ETreeTestCaseBase.etree
1831 lxml.tests.test_io.IOTestCaseBase.etree" class="py-name" href="#" onclick="return doclink('link-331', 'etree', 'link-9');">etree</a></tt><tt class="py-op">.</tt><tt id="link-332" class="py-name"><a title="lxml.etree.XPathEvaluator" class="py-name" href="#" onclick="return doclink('link-332', 'XPathEvaluator', 'link-204');">XPathEvaluator</a></tt><tt class="py-op">(</tt><tt class="py-name">x</tt><tt class="py-op">)</tt> </tt>
1832 <a name="L451"></a><tt class="py-lineno">451</tt> <tt class="py-line"> </tt>
1833 <a name="L452"></a><tt class="py-lineno">452</tt> <tt class="py-line"> <tt class="py-name">element</tt> <tt class="py-op">=</tt> <tt id="link-333" class="py-name"><a title="lxml.etree
1834 lxml.sax.ElementTreeContentHandler.etree
1835 lxml.tests.test_elementtree.CElementTreeTestCase.etree
1836 lxml.tests.test_elementtree.ETreeTestCaseBase.etree
1837 lxml.tests.test_io.IOTestCaseBase.etree" class="py-name" href="#" onclick="return doclink('link-333', 'etree', 'link-9');">etree</a></tt><tt class="py-op">.</tt><tt id="link-334" class="py-name"><a title="lxml.cssselect.Element
1840 lxml.objectify.Element
1841 lxml.tests.test_pyclasslookup.PyClassLookupTestCase.Element
1842 xml.etree.ElementTree.Element" class="py-name" href="#" onclick="return doclink('link-334', 'Element', 'link-173');">Element</a></tt><tt class="py-op">(</tt><tt class="py-string">"test-el"</tt><tt class="py-op">)</tt> </tt>
1843 <a name="L453"></a><tt class="py-lineno">453</tt> <tt class="py-line"> <tt id="link-335" class="py-name"><a title="lxml.etree
1844 lxml.sax.ElementTreeContentHandler.etree
1845 lxml.tests.test_elementtree.CElementTreeTestCase.etree
1846 lxml.tests.test_elementtree.ETreeTestCaseBase.etree
1847 lxml.tests.test_io.IOTestCaseBase.etree" class="py-name" href="#" onclick="return doclink('link-335', 'etree', 'link-9');">etree</a></tt><tt class="py-op">.</tt><tt id="link-336" class="py-name"><a title="lxml.etree.SubElement" class="py-name" href="#" onclick="return doclink('link-336', 'SubElement', 'link-175');">SubElement</a></tt><tt class="py-op">(</tt><tt class="py-name">element</tt><tt class="py-op">,</tt> <tt class="py-string">"test-sub"</tt><tt class="py-op">)</tt> </tt>
1848 <a name="L454"></a><tt class="py-lineno">454</tt> <tt class="py-line"> <tt class="py-name">expr</tt> <tt class="py-op">=</tt> <tt class="py-string">"$value"</tt> </tt>
1849 <a name="L455"></a><tt class="py-lineno">455</tt> <tt class="py-line"> <tt class="py-name">r</tt> <tt class="py-op">=</tt> <tt class="py-name">e</tt><tt class="py-op">(</tt><tt class="py-name">expr</tt><tt class="py-op">,</tt> <tt id="link-337" class="py-name" targets="Variable lxml.html.CheckboxGroup.value=lxml.html.CheckboxGroup-class.html#value,Variable lxml.html.InputElement.value=lxml.html.InputElement-class.html#value,Variable lxml.html.RadioGroup.value=lxml.html.RadioGroup-class.html#value,Variable lxml.html.SelectElement.value=lxml.html.SelectElement-class.html#value,Variable lxml.html.TextareaElement.value=lxml.html.TextareaElement-class.html#value"><a title="lxml.html.CheckboxGroup.value
1850 lxml.html.InputElement.value
1851 lxml.html.RadioGroup.value
1852 lxml.html.SelectElement.value
1853 lxml.html.TextareaElement.value" class="py-name" href="#" onclick="return doclink('link-337', 'value', 'link-337');">value</a></tt><tt class="py-op">=</tt><tt class="py-name">element</tt><tt class="py-op">)</tt> </tt>
1854 <a name="L456"></a><tt class="py-lineno">456</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEquals</tt><tt class="py-op">(</tt><tt class="py-number">1</tt><tt class="py-op">,</tt> <tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">r</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
1855 <a name="L457"></a><tt class="py-lineno">457</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEquals</tt><tt class="py-op">(</tt><tt class="py-name">element</tt><tt class="py-op">.</tt><tt id="link-338" class="py-name"><a title="lxml.etree._Comment.tag
1856 lxml.etree._Element.tag
1857 lxml.etree._Entity.tag
1858 lxml.etree._ProcessingInstruction.tag
1859 lxml.etree._ReadOnlyProxy.tag
1860 lxml.tests.test_xpathevaluator.tag
1861 xml.etree.ElementTree.Element.tag" class="py-name" href="#" onclick="return doclink('link-338', 'tag', 'link-88');">tag</a></tt><tt class="py-op">,</tt> <tt class="py-name">r</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">.</tt><tt id="link-339" class="py-name"><a title="lxml.etree._Comment.tag
1862 lxml.etree._Element.tag
1863 lxml.etree._Entity.tag
1864 lxml.etree._ProcessingInstruction.tag
1865 lxml.etree._ReadOnlyProxy.tag
1866 lxml.tests.test_xpathevaluator.tag
1867 xml.etree.ElementTree.Element.tag" class="py-name" href="#" onclick="return doclink('link-339', 'tag', 'link-88');">tag</a></tt><tt class="py-op">)</tt> </tt>
1868 <a name="L458"></a><tt class="py-lineno">458</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEquals</tt><tt class="py-op">(</tt><tt class="py-name">element</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">.</tt><tt id="link-340" class="py-name"><a title="lxml.etree._Comment.tag
1869 lxml.etree._Element.tag
1870 lxml.etree._Entity.tag
1871 lxml.etree._ProcessingInstruction.tag
1872 lxml.etree._ReadOnlyProxy.tag
1873 lxml.tests.test_xpathevaluator.tag
1874 xml.etree.ElementTree.Element.tag" class="py-name" href="#" onclick="return doclink('link-340', 'tag', 'link-88');">tag</a></tt><tt class="py-op">,</tt> <tt class="py-name">r</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">.</tt><tt id="link-341" class="py-name"><a title="lxml.etree._Comment.tag
1875 lxml.etree._Element.tag
1876 lxml.etree._Entity.tag
1877 lxml.etree._ProcessingInstruction.tag
1878 lxml.etree._ReadOnlyProxy.tag
1879 lxml.tests.test_xpathevaluator.tag
1880 xml.etree.ElementTree.Element.tag" class="py-name" href="#" onclick="return doclink('link-341', 'tag', 'link-88');">tag</a></tt><tt class="py-op">)</tt> </tt>
1881 </div><a name="L459"></a><tt class="py-lineno">459</tt> <tt class="py-line"> </tt>
1882 <a name="ETreeXPathTestCase.test_xpath_extensions_mix"></a><div id="ETreeXPathTestCase.test_xpath_extensions_mix-def"><a name="L460"></a><tt class="py-lineno">460</tt> <a class="py-toggle" href="#" id="ETreeXPathTestCase.test_xpath_extensions_mix-toggle" onclick="return toggle('ETreeXPathTestCase.test_xpath_extensions_mix');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="lxml.tests.test_xpathevaluator.ETreeXPathTestCase-class.html#test_xpath_extensions_mix">test_xpath_extensions_mix</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
1883 </div><div id="ETreeXPathTestCase.test_xpath_extensions_mix-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="ETreeXPathTestCase.test_xpath_extensions_mix-expanded"><a name="L461"></a><tt class="py-lineno">461</tt> <tt class="py-line"> <tt class="py-name">x</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-342" class="py-name"><a title="lxml.cssselect.parse
1884 lxml.etree._ElementTree.parse
1886 lxml.html.ElementSoup.parse
1887 lxml.html.html5parser.parse
1889 lxml.html.soupparser.parse
1890 lxml.objectify.parse
1891 lxml.tests.common_imports.HelperTestCase.parse" class="py-name" href="#" onclick="return doclink('link-342', 'parse', 'link-14');">parse</a></tt><tt class="py-op">(</tt><tt class="py-string">'<a attr="true"><test/></a>'</tt><tt class="py-op">)</tt> </tt>
1892 <a name="L462"></a><tt class="py-lineno">462</tt> <tt class="py-line"> </tt>
1893 <a name="L463"></a><tt class="py-lineno">463</tt> <tt class="py-line"> <tt class="py-keyword">class</tt> <tt class="py-def-name">LocalException</tt><tt class="py-op">(</tt><tt class="py-base-class">Exception</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
1894 <a name="L464"></a><tt class="py-lineno">464</tt> <tt class="py-line"> <tt class="py-keyword">pass</tt> </tt>
1895 </div><a name="L465"></a><tt class="py-lineno">465</tt> <tt class="py-line"> </tt>
1896 <a name="L466"></a><tt class="py-lineno">466</tt> <tt class="py-line"> <tt class="py-keyword">def</tt> <tt class="py-def-name">foo</tt><tt class="py-op">(</tt><tt class="py-param">evaluator</tt><tt class="py-op">,</tt> <tt class="py-param">a</tt><tt class="py-op">,</tt> <tt class="py-param">varval</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
1897 <a name="L467"></a><tt class="py-lineno">467</tt> <tt class="py-line"> <tt id="link-343" class="py-name"><a title="lxml.etree
1898 lxml.sax.ElementTreeContentHandler.etree
1899 lxml.tests.test_elementtree.CElementTreeTestCase.etree
1900 lxml.tests.test_elementtree.ETreeTestCaseBase.etree
1901 lxml.tests.test_io.IOTestCaseBase.etree" class="py-name" href="#" onclick="return doclink('link-343', 'etree', 'link-9');">etree</a></tt><tt class="py-op">.</tt><tt id="link-344" class="py-name"><a title="lxml.cssselect.Element
1904 lxml.objectify.Element
1905 lxml.tests.test_pyclasslookup.PyClassLookupTestCase.Element
1906 xml.etree.ElementTree.Element" class="py-name" href="#" onclick="return doclink('link-344', 'Element', 'link-173');">Element</a></tt><tt class="py-op">(</tt><tt class="py-string">"DUMMY"</tt><tt class="py-op">)</tt> </tt>
1907 <a name="L468"></a><tt class="py-lineno">468</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">varval</tt> <tt class="py-op">==</tt> <tt class="py-number">0</tt><tt class="py-op">:</tt> </tt>
1908 <a name="L469"></a><tt class="py-lineno">469</tt> <tt class="py-line"> <tt class="py-keyword">raise</tt> <tt class="py-name">LocalException</tt> </tt>
1909 <a name="L470"></a><tt class="py-lineno">470</tt> <tt class="py-line"> <tt class="py-keyword">elif</tt> <tt class="py-name">varval</tt> <tt class="py-op">==</tt> <tt class="py-number">1</tt><tt class="py-op">:</tt> </tt>
1910 <a name="L471"></a><tt class="py-lineno">471</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
1911 <a name="L472"></a><tt class="py-lineno">472</tt> <tt class="py-line"> <tt class="py-keyword">elif</tt> <tt class="py-name">varval</tt> <tt class="py-op">==</tt> <tt class="py-number">2</tt><tt class="py-op">:</tt> </tt>
1912 <a name="L473"></a><tt class="py-lineno">473</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">None</tt> </tt>
1913 <a name="L474"></a><tt class="py-lineno">474</tt> <tt class="py-line"> <tt class="py-keyword">elif</tt> <tt class="py-name">varval</tt> <tt class="py-op">==</tt> <tt class="py-number">3</tt><tt class="py-op">:</tt> </tt>
1914 <a name="L475"></a><tt class="py-lineno">475</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">a</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt> </tt>
1915 <a name="L476"></a><tt class="py-lineno">476</tt> <tt class="py-line"> <tt class="py-name">a</tt> <tt class="py-op">=</tt> <tt class="py-name">a</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt> </tt>
1916 <a name="L477"></a><tt class="py-lineno">477</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">a</tt><tt class="py-op">.</tt><tt id="link-345" class="py-name"><a title="lxml.etree._Attrib.get
1917 lxml.etree._Element.get
1918 lxml.etree._IDDict.get
1919 lxml.etree._ProcessingInstruction.get
1920 lxml.etree._ReadOnlyElementProxy.get
1921 lxml.etree.__ContentOnlyElement.get" class="py-name" href="#" onclick="return doclink('link-345', 'get', 'link-302');">get</a></tt><tt class="py-op">(</tt><tt class="py-string">"attr"</tt><tt class="py-op">)</tt> <tt class="py-op">==</tt> <tt class="py-name">str</tt><tt class="py-op">(</tt><tt class="py-name">varval</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
1922 <a name="L478"></a><tt class="py-lineno">478</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">a</tt> </tt>
1923 <a name="L479"></a><tt class="py-lineno">479</tt> <tt class="py-line"> <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
1924 <a name="L480"></a><tt class="py-lineno">480</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt id="link-346" class="py-name"><a title="lxml.etree
1925 lxml.sax.ElementTreeContentHandler.etree
1926 lxml.tests.test_elementtree.CElementTreeTestCase.etree
1927 lxml.tests.test_elementtree.ETreeTestCaseBase.etree
1928 lxml.tests.test_io.IOTestCaseBase.etree" class="py-name" href="#" onclick="return doclink('link-346', 'etree', 'link-9');">etree</a></tt><tt class="py-op">.</tt><tt id="link-347" class="py-name"><a title="lxml.cssselect.Element
1931 lxml.objectify.Element
1932 lxml.tests.test_pyclasslookup.PyClassLookupTestCase.Element
1933 xml.etree.ElementTree.Element" class="py-name" href="#" onclick="return doclink('link-347', 'Element', 'link-173');">Element</a></tt><tt class="py-op">(</tt><tt class="py-string">"NODE"</tt><tt class="py-op">)</tt> </tt>
1934 </div><a name="L481"></a><tt class="py-lineno">481</tt> <tt class="py-line"> </tt>
1935 <a name="L482"></a><tt class="py-lineno">482</tt> <tt class="py-line"> <tt id="link-348" class="py-name"><a title="lxml.tests.test_xpathevaluator.extension" class="py-name" href="#" onclick="return doclink('link-348', 'extension', 'link-233');">extension</a></tt> <tt class="py-op">=</tt> <tt class="py-op">{</tt><tt class="py-op">(</tt><tt class="py-name">None</tt><tt class="py-op">,</tt> <tt class="py-string">'foo'</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> <tt class="py-name">foo</tt><tt class="py-op">}</tt> </tt>
1936 <a name="L483"></a><tt class="py-lineno">483</tt> <tt class="py-line"> <tt class="py-name">e</tt> <tt class="py-op">=</tt> <tt id="link-349" class="py-name"><a title="lxml.etree
1937 lxml.sax.ElementTreeContentHandler.etree
1938 lxml.tests.test_elementtree.CElementTreeTestCase.etree
1939 lxml.tests.test_elementtree.ETreeTestCaseBase.etree
1940 lxml.tests.test_io.IOTestCaseBase.etree" class="py-name" href="#" onclick="return doclink('link-349', 'etree', 'link-9');">etree</a></tt><tt class="py-op">.</tt><tt id="link-350" class="py-name"><a title="lxml.etree.XPathEvaluator" class="py-name" href="#" onclick="return doclink('link-350', 'XPathEvaluator', 'link-204');">XPathEvaluator</a></tt><tt class="py-op">(</tt><tt class="py-name">x</tt><tt class="py-op">,</tt> <tt class="py-name">extensions</tt><tt class="py-op">=</tt><tt class="py-op">[</tt><tt id="link-351" class="py-name"><a title="lxml.tests.test_xpathevaluator.extension" class="py-name" href="#" onclick="return doclink('link-351', 'extension', 'link-233');">extension</a></tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
1941 <a name="L484"></a><tt class="py-lineno">484</tt> <tt class="py-line"> <tt class="py-keyword">del</tt> <tt class="py-name">x</tt> </tt>
1942 <a name="L485"></a><tt class="py-lineno">485</tt> <tt class="py-line"> </tt>
1943 <a name="L486"></a><tt class="py-lineno">486</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertRaises</tt><tt class="py-op">(</tt><tt class="py-name">LocalException</tt><tt class="py-op">,</tt> <tt class="py-name">e</tt><tt class="py-op">,</tt> <tt class="py-string">"foo(., 0)"</tt><tt class="py-op">)</tt> </tt>
1944 <a name="L487"></a><tt class="py-lineno">487</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertRaises</tt><tt class="py-op">(</tt><tt class="py-name">LocalException</tt><tt class="py-op">,</tt> <tt class="py-name">e</tt><tt class="py-op">,</tt> <tt class="py-string">"foo(., $value)"</tt><tt class="py-op">,</tt> <tt id="link-352" class="py-name"><a title="lxml.html.CheckboxGroup.value
1945 lxml.html.InputElement.value
1946 lxml.html.RadioGroup.value
1947 lxml.html.SelectElement.value
1948 lxml.html.TextareaElement.value" class="py-name" href="#" onclick="return doclink('link-352', 'value', 'link-337');">value</a></tt><tt class="py-op">=</tt><tt class="py-number">0</tt><tt class="py-op">)</tt> </tt>
1949 <a name="L488"></a><tt class="py-lineno">488</tt> <tt class="py-line"> </tt>
1950 <a name="L489"></a><tt class="py-lineno">489</tt> <tt class="py-line"> <tt class="py-name">r</tt> <tt class="py-op">=</tt> <tt class="py-name">e</tt><tt class="py-op">(</tt><tt class="py-string">"foo(., $value)"</tt><tt class="py-op">,</tt> <tt id="link-353" class="py-name"><a title="lxml.html.CheckboxGroup.value
1951 lxml.html.InputElement.value
1952 lxml.html.RadioGroup.value
1953 lxml.html.SelectElement.value
1954 lxml.html.TextareaElement.value" class="py-name" href="#" onclick="return doclink('link-353', 'value', 'link-337');">value</a></tt><tt class="py-op">=</tt><tt class="py-number">1</tt><tt class="py-op">)</tt> </tt>
1955 <a name="L490"></a><tt class="py-lineno">490</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEqual</tt><tt class="py-op">(</tt><tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">r</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-number">0</tt><tt class="py-op">)</tt> </tt>
1956 <a name="L491"></a><tt class="py-lineno">491</tt> <tt class="py-line"> </tt>
1957 <a name="L492"></a><tt class="py-lineno">492</tt> <tt class="py-line"> <tt class="py-name">r</tt> <tt class="py-op">=</tt> <tt class="py-name">e</tt><tt class="py-op">(</tt><tt class="py-string">"foo(., 1)"</tt><tt class="py-op">)</tt> </tt>
1958 <a name="L493"></a><tt class="py-lineno">493</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEqual</tt><tt class="py-op">(</tt><tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">r</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-number">0</tt><tt class="py-op">)</tt> </tt>
1959 <a name="L494"></a><tt class="py-lineno">494</tt> <tt class="py-line"> </tt>
1960 <a name="L495"></a><tt class="py-lineno">495</tt> <tt class="py-line"> <tt class="py-name">r</tt> <tt class="py-op">=</tt> <tt class="py-name">e</tt><tt class="py-op">(</tt><tt class="py-string">"foo(., $value)"</tt><tt class="py-op">,</tt> <tt id="link-354" class="py-name"><a title="lxml.html.CheckboxGroup.value
1961 lxml.html.InputElement.value
1962 lxml.html.RadioGroup.value
1963 lxml.html.SelectElement.value
1964 lxml.html.TextareaElement.value" class="py-name" href="#" onclick="return doclink('link-354', 'value', 'link-337');">value</a></tt><tt class="py-op">=</tt><tt class="py-number">2</tt><tt class="py-op">)</tt> </tt>
1965 <a name="L496"></a><tt class="py-lineno">496</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEqual</tt><tt class="py-op">(</tt><tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">r</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-number">0</tt><tt class="py-op">)</tt> </tt>
1966 <a name="L497"></a><tt class="py-lineno">497</tt> <tt class="py-line"> </tt>
1967 <a name="L498"></a><tt class="py-lineno">498</tt> <tt class="py-line"> <tt class="py-name">r</tt> <tt class="py-op">=</tt> <tt class="py-name">e</tt><tt class="py-op">(</tt><tt class="py-string">"foo(., $value)"</tt><tt class="py-op">,</tt> <tt id="link-355" class="py-name"><a title="lxml.html.CheckboxGroup.value
1968 lxml.html.InputElement.value
1969 lxml.html.RadioGroup.value
1970 lxml.html.SelectElement.value
1971 lxml.html.TextareaElement.value" class="py-name" href="#" onclick="return doclink('link-355', 'value', 'link-337');">value</a></tt><tt class="py-op">=</tt><tt class="py-number">3</tt><tt class="py-op">)</tt> </tt>
1972 <a name="L499"></a><tt class="py-lineno">499</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEqual</tt><tt class="py-op">(</tt><tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">r</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-number">1</tt><tt class="py-op">)</tt> </tt>
1973 <a name="L500"></a><tt class="py-lineno">500</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEqual</tt><tt class="py-op">(</tt><tt class="py-name">r</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">.</tt><tt id="link-356" class="py-name"><a title="lxml.etree._Comment.tag
1974 lxml.etree._Element.tag
1975 lxml.etree._Entity.tag
1976 lxml.etree._ProcessingInstruction.tag
1977 lxml.etree._ReadOnlyProxy.tag
1978 lxml.tests.test_xpathevaluator.tag
1979 xml.etree.ElementTree.Element.tag" class="py-name" href="#" onclick="return doclink('link-356', 'tag', 'link-88');">tag</a></tt><tt class="py-op">,</tt> <tt class="py-string">"test"</tt><tt class="py-op">)</tt> </tt>
1980 <a name="L501"></a><tt class="py-lineno">501</tt> <tt class="py-line"> </tt>
1981 <a name="L502"></a><tt class="py-lineno">502</tt> <tt class="py-line"> <tt class="py-name">r</tt> <tt class="py-op">=</tt> <tt class="py-name">e</tt><tt class="py-op">(</tt><tt class="py-string">"foo(., $value)"</tt><tt class="py-op">,</tt> <tt id="link-357" class="py-name"><a title="lxml.html.CheckboxGroup.value
1982 lxml.html.InputElement.value
1983 lxml.html.RadioGroup.value
1984 lxml.html.SelectElement.value
1985 lxml.html.TextareaElement.value" class="py-name" href="#" onclick="return doclink('link-357', 'value', 'link-337');">value</a></tt><tt class="py-op">=</tt><tt class="py-string">"false"</tt><tt class="py-op">)</tt> </tt>
1986 <a name="L503"></a><tt class="py-lineno">503</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEqual</tt><tt class="py-op">(</tt><tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">r</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-number">1</tt><tt class="py-op">)</tt> </tt>
1987 <a name="L504"></a><tt class="py-lineno">504</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEqual</tt><tt class="py-op">(</tt><tt class="py-name">r</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">.</tt><tt id="link-358" class="py-name"><a title="lxml.etree._Comment.tag
1988 lxml.etree._Element.tag
1989 lxml.etree._Entity.tag
1990 lxml.etree._ProcessingInstruction.tag
1991 lxml.etree._ReadOnlyProxy.tag
1992 lxml.tests.test_xpathevaluator.tag
1993 xml.etree.ElementTree.Element.tag" class="py-name" href="#" onclick="return doclink('link-358', 'tag', 'link-88');">tag</a></tt><tt class="py-op">,</tt> <tt class="py-string">"NODE"</tt><tt class="py-op">)</tt> </tt>
1994 <a name="L505"></a><tt class="py-lineno">505</tt> <tt class="py-line"> </tt>
1995 <a name="L506"></a><tt class="py-lineno">506</tt> <tt class="py-line"> <tt class="py-name">r</tt> <tt class="py-op">=</tt> <tt class="py-name">e</tt><tt class="py-op">(</tt><tt class="py-string">"foo(., 'false')"</tt><tt class="py-op">)</tt> </tt>
1996 <a name="L507"></a><tt class="py-lineno">507</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEqual</tt><tt class="py-op">(</tt><tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">r</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-number">1</tt><tt class="py-op">)</tt> </tt>
1997 <a name="L508"></a><tt class="py-lineno">508</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEqual</tt><tt class="py-op">(</tt><tt class="py-name">r</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">.</tt><tt id="link-359" class="py-name"><a title="lxml.etree._Comment.tag
1998 lxml.etree._Element.tag
1999 lxml.etree._Entity.tag
2000 lxml.etree._ProcessingInstruction.tag
2001 lxml.etree._ReadOnlyProxy.tag
2002 lxml.tests.test_xpathevaluator.tag
2003 xml.etree.ElementTree.Element.tag" class="py-name" href="#" onclick="return doclink('link-359', 'tag', 'link-88');">tag</a></tt><tt class="py-op">,</tt> <tt class="py-string">"NODE"</tt><tt class="py-op">)</tt> </tt>
2004 <a name="L509"></a><tt class="py-lineno">509</tt> <tt class="py-line"> </tt>
2005 <a name="L510"></a><tt class="py-lineno">510</tt> <tt class="py-line"> <tt class="py-name">r</tt> <tt class="py-op">=</tt> <tt class="py-name">e</tt><tt class="py-op">(</tt><tt class="py-string">"foo(., 'true')"</tt><tt class="py-op">)</tt> </tt>
2006 <a name="L511"></a><tt class="py-lineno">511</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEqual</tt><tt class="py-op">(</tt><tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">r</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-number">1</tt><tt class="py-op">)</tt> </tt>
2007 <a name="L512"></a><tt class="py-lineno">512</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEqual</tt><tt class="py-op">(</tt><tt class="py-name">r</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">.</tt><tt id="link-360" class="py-name"><a title="lxml.etree._Comment.tag
2008 lxml.etree._Element.tag
2009 lxml.etree._Entity.tag
2010 lxml.etree._ProcessingInstruction.tag
2011 lxml.etree._ReadOnlyProxy.tag
2012 lxml.tests.test_xpathevaluator.tag
2013 xml.etree.ElementTree.Element.tag" class="py-name" href="#" onclick="return doclink('link-360', 'tag', 'link-88');">tag</a></tt><tt class="py-op">,</tt> <tt class="py-string">"a"</tt><tt class="py-op">)</tt> </tt>
2014 <a name="L513"></a><tt class="py-lineno">513</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEqual</tt><tt class="py-op">(</tt><tt class="py-name">r</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">.</tt><tt id="link-361" class="py-name"><a title="lxml.etree._Comment.tag
2015 lxml.etree._Element.tag
2016 lxml.etree._Entity.tag
2017 lxml.etree._ProcessingInstruction.tag
2018 lxml.etree._ReadOnlyProxy.tag
2019 lxml.tests.test_xpathevaluator.tag
2020 xml.etree.ElementTree.Element.tag" class="py-name" href="#" onclick="return doclink('link-361', 'tag', 'link-88');">tag</a></tt><tt class="py-op">,</tt> <tt class="py-string">"test"</tt><tt class="py-op">)</tt> </tt>
2021 <a name="L514"></a><tt class="py-lineno">514</tt> <tt class="py-line"> </tt>
2022 <a name="L515"></a><tt class="py-lineno">515</tt> <tt class="py-line"> <tt class="py-name">r</tt> <tt class="py-op">=</tt> <tt class="py-name">e</tt><tt class="py-op">(</tt><tt class="py-string">"foo(., $value)"</tt><tt class="py-op">,</tt> <tt id="link-362" class="py-name"><a title="lxml.html.CheckboxGroup.value
2023 lxml.html.InputElement.value
2024 lxml.html.RadioGroup.value
2025 lxml.html.SelectElement.value
2026 lxml.html.TextareaElement.value" class="py-name" href="#" onclick="return doclink('link-362', 'value', 'link-337');">value</a></tt><tt class="py-op">=</tt><tt class="py-string">"true"</tt><tt class="py-op">)</tt> </tt>
2027 <a name="L516"></a><tt class="py-lineno">516</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEqual</tt><tt class="py-op">(</tt><tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">r</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-number">1</tt><tt class="py-op">)</tt> </tt>
2028 <a name="L517"></a><tt class="py-lineno">517</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEqual</tt><tt class="py-op">(</tt><tt class="py-name">r</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">.</tt><tt id="link-363" class="py-name"><a title="lxml.etree._Comment.tag
2029 lxml.etree._Element.tag
2030 lxml.etree._Entity.tag
2031 lxml.etree._ProcessingInstruction.tag
2032 lxml.etree._ReadOnlyProxy.tag
2033 lxml.tests.test_xpathevaluator.tag
2034 xml.etree.ElementTree.Element.tag" class="py-name" href="#" onclick="return doclink('link-363', 'tag', 'link-88');">tag</a></tt><tt class="py-op">,</tt> <tt class="py-string">"a"</tt><tt class="py-op">)</tt> </tt>
2035 <a name="L518"></a><tt class="py-lineno">518</tt> <tt class="py-line"> </tt>
2036 <a name="L519"></a><tt class="py-lineno">519</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertRaises</tt><tt class="py-op">(</tt><tt class="py-name">LocalException</tt><tt class="py-op">,</tt> <tt class="py-name">e</tt><tt class="py-op">,</tt> <tt class="py-string">"foo(., 0)"</tt><tt class="py-op">)</tt> </tt>
2037 <a name="L520"></a><tt class="py-lineno">520</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertRaises</tt><tt class="py-op">(</tt><tt class="py-name">LocalException</tt><tt class="py-op">,</tt> <tt class="py-name">e</tt><tt class="py-op">,</tt> <tt class="py-string">"foo(., $value)"</tt><tt class="py-op">,</tt> <tt id="link-364" class="py-name"><a title="lxml.html.CheckboxGroup.value
2038 lxml.html.InputElement.value
2039 lxml.html.RadioGroup.value
2040 lxml.html.SelectElement.value
2041 lxml.html.TextareaElement.value" class="py-name" href="#" onclick="return doclink('link-364', 'value', 'link-337');">value</a></tt><tt class="py-op">=</tt><tt class="py-number">0</tt><tt class="py-op">)</tt> </tt>
2042 </div></div><a name="L521"></a><tt class="py-lineno">521</tt> <tt class="py-line"> </tt>
2043 <a name="L522"></a><tt class="py-lineno">522</tt> <tt class="py-line"> </tt>
2044 <a name="ETreeXPathClassTestCase"></a><div id="ETreeXPathClassTestCase-def"><a name="L523"></a><tt class="py-lineno">523</tt> <a class="py-toggle" href="#" id="ETreeXPathClassTestCase-toggle" onclick="return toggle('ETreeXPathClassTestCase');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="lxml.tests.test_xpathevaluator.ETreeXPathClassTestCase-class.html">ETreeXPathClassTestCase</a><tt class="py-op">(</tt><tt class="py-base-class">HelperTestCase</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
2045 </div><div id="ETreeXPathClassTestCase-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="ETreeXPathClassTestCase-expanded"><a name="L524"></a><tt class="py-lineno">524</tt> <tt class="py-line"> <tt class="py-docstring">"Tests for the XPath class"</tt> </tt>
2046 <a name="ETreeXPathClassTestCase.test_xpath_compile_doc"></a><div id="ETreeXPathClassTestCase.test_xpath_compile_doc-def"><a name="L525"></a><tt class="py-lineno">525</tt> <a class="py-toggle" href="#" id="ETreeXPathClassTestCase.test_xpath_compile_doc-toggle" onclick="return toggle('ETreeXPathClassTestCase.test_xpath_compile_doc');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="lxml.tests.test_xpathevaluator.ETreeXPathClassTestCase-class.html#test_xpath_compile_doc">test_xpath_compile_doc</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
2047 </div><div id="ETreeXPathClassTestCase.test_xpath_compile_doc-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="ETreeXPathClassTestCase.test_xpath_compile_doc-expanded"><a name="L526"></a><tt class="py-lineno">526</tt> <tt class="py-line"> <tt class="py-name">x</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-365" class="py-name"><a title="lxml.cssselect.parse
2048 lxml.etree._ElementTree.parse
2050 lxml.html.ElementSoup.parse
2051 lxml.html.html5parser.parse
2053 lxml.html.soupparser.parse
2054 lxml.objectify.parse
2055 lxml.tests.common_imports.HelperTestCase.parse" class="py-name" href="#" onclick="return doclink('link-365', 'parse', 'link-14');">parse</a></tt><tt class="py-op">(</tt><tt class="py-string">'<a attr="true"/>'</tt><tt class="py-op">)</tt> </tt>
2056 <a name="L527"></a><tt class="py-lineno">527</tt> <tt class="py-line"> </tt>
2057 <a name="L528"></a><tt class="py-lineno">528</tt> <tt class="py-line"> <tt class="py-name">expr</tt> <tt class="py-op">=</tt> <tt id="link-366" class="py-name"><a title="lxml.etree
2058 lxml.sax.ElementTreeContentHandler.etree
2059 lxml.tests.test_elementtree.CElementTreeTestCase.etree
2060 lxml.tests.test_elementtree.ETreeTestCaseBase.etree
2061 lxml.tests.test_io.IOTestCaseBase.etree" class="py-name" href="#" onclick="return doclink('link-366', 'etree', 'link-9');">etree</a></tt><tt class="py-op">.</tt><tt id="link-367" class="py-name"><a title="lxml.etree.XPath" class="py-name" href="#" onclick="return doclink('link-367', 'XPath', 'link-156');">XPath</a></tt><tt class="py-op">(</tt><tt class="py-string">"/a[@attr != 'true']"</tt><tt class="py-op">)</tt> </tt>
2062 <a name="L529"></a><tt class="py-lineno">529</tt> <tt class="py-line"> <tt class="py-name">r</tt> <tt class="py-op">=</tt> <tt class="py-name">expr</tt><tt class="py-op">(</tt><tt class="py-name">x</tt><tt class="py-op">)</tt> </tt>
2063 <a name="L530"></a><tt class="py-lineno">530</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEquals</tt><tt class="py-op">(</tt><tt class="py-number">0</tt><tt class="py-op">,</tt> <tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">r</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
2064 <a name="L531"></a><tt class="py-lineno">531</tt> <tt class="py-line"> </tt>
2065 <a name="L532"></a><tt class="py-lineno">532</tt> <tt class="py-line"> <tt class="py-name">expr</tt> <tt class="py-op">=</tt> <tt id="link-368" class="py-name"><a title="lxml.etree
2066 lxml.sax.ElementTreeContentHandler.etree
2067 lxml.tests.test_elementtree.CElementTreeTestCase.etree
2068 lxml.tests.test_elementtree.ETreeTestCaseBase.etree
2069 lxml.tests.test_io.IOTestCaseBase.etree" class="py-name" href="#" onclick="return doclink('link-368', 'etree', 'link-9');">etree</a></tt><tt class="py-op">.</tt><tt id="link-369" class="py-name"><a title="lxml.etree.XPath" class="py-name" href="#" onclick="return doclink('link-369', 'XPath', 'link-156');">XPath</a></tt><tt class="py-op">(</tt><tt class="py-string">"/a[@attr = 'true']"</tt><tt class="py-op">)</tt> </tt>
2070 <a name="L533"></a><tt class="py-lineno">533</tt> <tt class="py-line"> <tt class="py-name">r</tt> <tt class="py-op">=</tt> <tt class="py-name">expr</tt><tt class="py-op">(</tt><tt class="py-name">x</tt><tt class="py-op">)</tt> </tt>
2071 <a name="L534"></a><tt class="py-lineno">534</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEquals</tt><tt class="py-op">(</tt><tt class="py-number">1</tt><tt class="py-op">,</tt> <tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">r</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
2072 <a name="L535"></a><tt class="py-lineno">535</tt> <tt class="py-line"> </tt>
2073 <a name="L536"></a><tt class="py-lineno">536</tt> <tt class="py-line"> <tt class="py-name">expr</tt> <tt class="py-op">=</tt> <tt id="link-370" class="py-name"><a title="lxml.etree
2074 lxml.sax.ElementTreeContentHandler.etree
2075 lxml.tests.test_elementtree.CElementTreeTestCase.etree
2076 lxml.tests.test_elementtree.ETreeTestCaseBase.etree
2077 lxml.tests.test_io.IOTestCaseBase.etree" class="py-name" href="#" onclick="return doclink('link-370', 'etree', 'link-9');">etree</a></tt><tt class="py-op">.</tt><tt id="link-371" class="py-name"><a title="lxml.etree.XPath" class="py-name" href="#" onclick="return doclink('link-371', 'XPath', 'link-156');">XPath</a></tt><tt class="py-op">(</tt> <tt class="py-name">expr</tt><tt class="py-op">.</tt><tt id="link-372" class="py-name"><a title="lxml.etree.XPath.path" class="py-name" href="#" onclick="return doclink('link-372', 'path', 'link-0');">path</a></tt> <tt class="py-op">)</tt> </tt>
2078 <a name="L537"></a><tt class="py-lineno">537</tt> <tt class="py-line"> <tt class="py-name">r</tt> <tt class="py-op">=</tt> <tt class="py-name">expr</tt><tt class="py-op">(</tt><tt class="py-name">x</tt><tt class="py-op">)</tt> </tt>
2079 <a name="L538"></a><tt class="py-lineno">538</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEquals</tt><tt class="py-op">(</tt><tt class="py-number">1</tt><tt class="py-op">,</tt> <tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">r</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
2080 </div><a name="L539"></a><tt class="py-lineno">539</tt> <tt class="py-line"> </tt>
2081 <a name="ETreeXPathClassTestCase.test_xpath_compile_element"></a><div id="ETreeXPathClassTestCase.test_xpath_compile_element-def"><a name="L540"></a><tt class="py-lineno">540</tt> <a class="py-toggle" href="#" id="ETreeXPathClassTestCase.test_xpath_compile_element-toggle" onclick="return toggle('ETreeXPathClassTestCase.test_xpath_compile_element');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="lxml.tests.test_xpathevaluator.ETreeXPathClassTestCase-class.html#test_xpath_compile_element">test_xpath_compile_element</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
2082 </div><div id="ETreeXPathClassTestCase.test_xpath_compile_element-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="ETreeXPathClassTestCase.test_xpath_compile_element-expanded"><a name="L541"></a><tt class="py-lineno">541</tt> <tt class="py-line"> <tt class="py-name">x</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-373" class="py-name"><a title="lxml.cssselect.parse
2083 lxml.etree._ElementTree.parse
2085 lxml.html.ElementSoup.parse
2086 lxml.html.html5parser.parse
2088 lxml.html.soupparser.parse
2089 lxml.objectify.parse
2090 lxml.tests.common_imports.HelperTestCase.parse" class="py-name" href="#" onclick="return doclink('link-373', 'parse', 'link-14');">parse</a></tt><tt class="py-op">(</tt><tt class="py-string">'<a><b/><c/></a>'</tt><tt class="py-op">)</tt> </tt>
2091 <a name="L542"></a><tt class="py-lineno">542</tt> <tt class="py-line"> <tt id="link-374" class="py-name"><a title="lxml.etree.iterparse.root" class="py-name" href="#" onclick="return doclink('link-374', 'root', 'link-35');">root</a></tt> <tt class="py-op">=</tt> <tt class="py-name">x</tt><tt class="py-op">.</tt><tt id="link-375" class="py-name"><a title="lxml.etree._ElementTree.getroot" class="py-name" href="#" onclick="return doclink('link-375', 'getroot', 'link-36');">getroot</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
2092 <a name="L543"></a><tt class="py-lineno">543</tt> <tt class="py-line"> </tt>
2093 <a name="L544"></a><tt class="py-lineno">544</tt> <tt class="py-line"> <tt class="py-name">expr</tt> <tt class="py-op">=</tt> <tt id="link-376" class="py-name"><a title="lxml.etree
2094 lxml.sax.ElementTreeContentHandler.etree
2095 lxml.tests.test_elementtree.CElementTreeTestCase.etree
2096 lxml.tests.test_elementtree.ETreeTestCaseBase.etree
2097 lxml.tests.test_io.IOTestCaseBase.etree" class="py-name" href="#" onclick="return doclink('link-376', 'etree', 'link-9');">etree</a></tt><tt class="py-op">.</tt><tt id="link-377" class="py-name"><a title="lxml.etree.XPath" class="py-name" href="#" onclick="return doclink('link-377', 'XPath', 'link-156');">XPath</a></tt><tt class="py-op">(</tt><tt class="py-string">"./b"</tt><tt class="py-op">)</tt> </tt>
2098 <a name="L545"></a><tt class="py-lineno">545</tt> <tt class="py-line"> <tt class="py-name">r</tt> <tt class="py-op">=</tt> <tt class="py-name">expr</tt><tt class="py-op">(</tt><tt id="link-378" class="py-name"><a title="lxml.etree.iterparse.root" class="py-name" href="#" onclick="return doclink('link-378', 'root', 'link-35');">root</a></tt><tt class="py-op">)</tt> </tt>
2099 <a name="L546"></a><tt class="py-lineno">546</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEquals</tt><tt class="py-op">(</tt><tt class="py-number">1</tt><tt class="py-op">,</tt> <tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">r</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
2100 <a name="L547"></a><tt class="py-lineno">547</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEquals</tt><tt class="py-op">(</tt><tt class="py-string">'b'</tt><tt class="py-op">,</tt> <tt class="py-name">r</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">.</tt><tt id="link-379" class="py-name"><a title="lxml.etree._Comment.tag
2101 lxml.etree._Element.tag
2102 lxml.etree._Entity.tag
2103 lxml.etree._ProcessingInstruction.tag
2104 lxml.etree._ReadOnlyProxy.tag
2105 lxml.tests.test_xpathevaluator.tag
2106 xml.etree.ElementTree.Element.tag" class="py-name" href="#" onclick="return doclink('link-379', 'tag', 'link-88');">tag</a></tt><tt class="py-op">)</tt> </tt>
2107 <a name="L548"></a><tt class="py-lineno">548</tt> <tt class="py-line"> </tt>
2108 <a name="L549"></a><tt class="py-lineno">549</tt> <tt class="py-line"> <tt class="py-name">expr</tt> <tt class="py-op">=</tt> <tt id="link-380" class="py-name"><a title="lxml.etree
2109 lxml.sax.ElementTreeContentHandler.etree
2110 lxml.tests.test_elementtree.CElementTreeTestCase.etree
2111 lxml.tests.test_elementtree.ETreeTestCaseBase.etree
2112 lxml.tests.test_io.IOTestCaseBase.etree" class="py-name" href="#" onclick="return doclink('link-380', 'etree', 'link-9');">etree</a></tt><tt class="py-op">.</tt><tt id="link-381" class="py-name"><a title="lxml.etree.XPath" class="py-name" href="#" onclick="return doclink('link-381', 'XPath', 'link-156');">XPath</a></tt><tt class="py-op">(</tt><tt class="py-string">"./*"</tt><tt class="py-op">)</tt> </tt>
2113 <a name="L550"></a><tt class="py-lineno">550</tt> <tt class="py-line"> <tt class="py-name">r</tt> <tt class="py-op">=</tt> <tt class="py-name">expr</tt><tt class="py-op">(</tt><tt id="link-382" class="py-name"><a title="lxml.etree.iterparse.root" class="py-name" href="#" onclick="return doclink('link-382', 'root', 'link-35');">root</a></tt><tt class="py-op">)</tt> </tt>
2114 <a name="L551"></a><tt class="py-lineno">551</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEquals</tt><tt class="py-op">(</tt><tt class="py-number">2</tt><tt class="py-op">,</tt> <tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">r</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
2115 </div><a name="L552"></a><tt class="py-lineno">552</tt> <tt class="py-line"> </tt>
2116 <a name="ETreeXPathClassTestCase.test_xpath_compile_vars"></a><div id="ETreeXPathClassTestCase.test_xpath_compile_vars-def"><a name="L553"></a><tt class="py-lineno">553</tt> <a class="py-toggle" href="#" id="ETreeXPathClassTestCase.test_xpath_compile_vars-toggle" onclick="return toggle('ETreeXPathClassTestCase.test_xpath_compile_vars');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="lxml.tests.test_xpathevaluator.ETreeXPathClassTestCase-class.html#test_xpath_compile_vars">test_xpath_compile_vars</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
2117 </div><div id="ETreeXPathClassTestCase.test_xpath_compile_vars-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="ETreeXPathClassTestCase.test_xpath_compile_vars-expanded"><a name="L554"></a><tt class="py-lineno">554</tt> <tt class="py-line"> <tt class="py-name">x</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-383" class="py-name"><a title="lxml.cssselect.parse
2118 lxml.etree._ElementTree.parse
2120 lxml.html.ElementSoup.parse
2121 lxml.html.html5parser.parse
2123 lxml.html.soupparser.parse
2124 lxml.objectify.parse
2125 lxml.tests.common_imports.HelperTestCase.parse" class="py-name" href="#" onclick="return doclink('link-383', 'parse', 'link-14');">parse</a></tt><tt class="py-op">(</tt><tt class="py-string">'<a attr="true"/>'</tt><tt class="py-op">)</tt> </tt>
2126 <a name="L555"></a><tt class="py-lineno">555</tt> <tt class="py-line"> </tt>
2127 <a name="L556"></a><tt class="py-lineno">556</tt> <tt class="py-line"> <tt class="py-name">expr</tt> <tt class="py-op">=</tt> <tt id="link-384" class="py-name"><a title="lxml.etree
2128 lxml.sax.ElementTreeContentHandler.etree
2129 lxml.tests.test_elementtree.CElementTreeTestCase.etree
2130 lxml.tests.test_elementtree.ETreeTestCaseBase.etree
2131 lxml.tests.test_io.IOTestCaseBase.etree" class="py-name" href="#" onclick="return doclink('link-384', 'etree', 'link-9');">etree</a></tt><tt class="py-op">.</tt><tt id="link-385" class="py-name"><a title="lxml.etree.XPath" class="py-name" href="#" onclick="return doclink('link-385', 'XPath', 'link-156');">XPath</a></tt><tt class="py-op">(</tt><tt class="py-string">"/a[@attr=$aval]"</tt><tt class="py-op">)</tt> </tt>
2132 <a name="L557"></a><tt class="py-lineno">557</tt> <tt class="py-line"> <tt class="py-name">r</tt> <tt class="py-op">=</tt> <tt class="py-name">expr</tt><tt class="py-op">(</tt><tt class="py-name">x</tt><tt class="py-op">,</tt> <tt class="py-name">aval</tt><tt class="py-op">=</tt><tt class="py-name">False</tt><tt class="py-op">)</tt> </tt>
2133 <a name="L558"></a><tt class="py-lineno">558</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEquals</tt><tt class="py-op">(</tt><tt class="py-number">0</tt><tt class="py-op">,</tt> <tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">r</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
2134 <a name="L559"></a><tt class="py-lineno">559</tt> <tt class="py-line"> </tt>
2135 <a name="L560"></a><tt class="py-lineno">560</tt> <tt class="py-line"> <tt class="py-name">r</tt> <tt class="py-op">=</tt> <tt class="py-name">expr</tt><tt class="py-op">(</tt><tt class="py-name">x</tt><tt class="py-op">,</tt> <tt class="py-name">aval</tt><tt class="py-op">=</tt><tt class="py-name">True</tt><tt class="py-op">)</tt> </tt>
2136 <a name="L561"></a><tt class="py-lineno">561</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEquals</tt><tt class="py-op">(</tt><tt class="py-number">1</tt><tt class="py-op">,</tt> <tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">r</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
2137 </div><a name="L562"></a><tt class="py-lineno">562</tt> <tt class="py-line"> </tt>
2138 <a name="ETreeXPathClassTestCase.test_xpath_compile_error"></a><div id="ETreeXPathClassTestCase.test_xpath_compile_error-def"><a name="L563"></a><tt class="py-lineno">563</tt> <a class="py-toggle" href="#" id="ETreeXPathClassTestCase.test_xpath_compile_error-toggle" onclick="return toggle('ETreeXPathClassTestCase.test_xpath_compile_error');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="lxml.tests.test_xpathevaluator.ETreeXPathClassTestCase-class.html#test_xpath_compile_error">test_xpath_compile_error</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
2139 </div><div id="ETreeXPathClassTestCase.test_xpath_compile_error-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="ETreeXPathClassTestCase.test_xpath_compile_error-expanded"><a name="L564"></a><tt class="py-lineno">564</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertRaises</tt><tt class="py-op">(</tt><tt class="py-name">SyntaxError</tt><tt class="py-op">,</tt> <tt id="link-386" class="py-name"><a title="lxml.etree
2140 lxml.sax.ElementTreeContentHandler.etree
2141 lxml.tests.test_elementtree.CElementTreeTestCase.etree
2142 lxml.tests.test_elementtree.ETreeTestCaseBase.etree
2143 lxml.tests.test_io.IOTestCaseBase.etree" class="py-name" href="#" onclick="return doclink('link-386', 'etree', 'link-9');">etree</a></tt><tt class="py-op">.</tt><tt id="link-387" class="py-name"><a title="lxml.etree.XPath" class="py-name" href="#" onclick="return doclink('link-387', 'XPath', 'link-156');">XPath</a></tt><tt class="py-op">,</tt> <tt class="py-string">'\\fad'</tt><tt class="py-op">)</tt> </tt>
2144 </div><a name="L565"></a><tt class="py-lineno">565</tt> <tt class="py-line"> </tt>
2145 <a name="ETreeXPathClassTestCase.test_xpath_elementtree_error"></a><div id="ETreeXPathClassTestCase.test_xpath_elementtree_error-def"><a name="L566"></a><tt class="py-lineno">566</tt> <a class="py-toggle" href="#" id="ETreeXPathClassTestCase.test_xpath_elementtree_error-toggle" onclick="return toggle('ETreeXPathClassTestCase.test_xpath_elementtree_error');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="lxml.tests.test_xpathevaluator.ETreeXPathClassTestCase-class.html#test_xpath_elementtree_error">test_xpath_elementtree_error</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
2146 </div><div id="ETreeXPathClassTestCase.test_xpath_elementtree_error-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="ETreeXPathClassTestCase.test_xpath_elementtree_error-expanded"><a name="L567"></a><tt class="py-lineno">567</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertRaises</tt><tt class="py-op">(</tt><tt class="py-name">ValueError</tt><tt class="py-op">,</tt> <tt id="link-388" class="py-name"><a title="lxml.etree
2147 lxml.sax.ElementTreeContentHandler.etree
2148 lxml.tests.test_elementtree.CElementTreeTestCase.etree
2149 lxml.tests.test_elementtree.ETreeTestCaseBase.etree
2150 lxml.tests.test_io.IOTestCaseBase.etree" class="py-name" href="#" onclick="return doclink('link-388', 'etree', 'link-9');">etree</a></tt><tt class="py-op">.</tt><tt id="link-389" class="py-name"><a title="lxml.etree.XPath" class="py-name" href="#" onclick="return doclink('link-389', 'XPath', 'link-156');">XPath</a></tt><tt class="py-op">(</tt><tt class="py-string">'*'</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt id="link-390" class="py-name"><a title="lxml.etree
2151 lxml.sax.ElementTreeContentHandler.etree
2152 lxml.tests.test_elementtree.CElementTreeTestCase.etree
2153 lxml.tests.test_elementtree.ETreeTestCaseBase.etree
2154 lxml.tests.test_io.IOTestCaseBase.etree" class="py-name" href="#" onclick="return doclink('link-390', 'etree', 'link-9');">etree</a></tt><tt class="py-op">.</tt><tt id="link-391" class="py-name"><a title="lxml.etree.ElementTree
2155 xml.etree.ElementTree
2156 xml.etree.ElementTree.ElementTree" class="py-name" href="#" onclick="return doclink('link-391', 'ElementTree', 'link-183');">ElementTree</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
2157 </div></div><a name="L568"></a><tt class="py-lineno">568</tt> <tt class="py-line"> </tt>
2158 <a name="L569"></a><tt class="py-lineno">569</tt> <tt class="py-line"> </tt>
2159 <a name="ETreeXPathExsltTestCase"></a><div id="ETreeXPathExsltTestCase-def"><a name="L570"></a><tt class="py-lineno">570</tt> <a class="py-toggle" href="#" id="ETreeXPathExsltTestCase-toggle" onclick="return toggle('ETreeXPathExsltTestCase');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="lxml.tests.test_xpathevaluator.ETreeXPathExsltTestCase-class.html">ETreeXPathExsltTestCase</a><tt class="py-op">(</tt><tt class="py-base-class">HelperTestCase</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
2160 </div><div id="ETreeXPathExsltTestCase-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="ETreeXPathExsltTestCase-expanded"><a name="L571"></a><tt class="py-lineno">571</tt> <tt class="py-line"> <tt class="py-docstring">"Tests for the EXSLT support in XPath (requires libxslt 1.1.25+)"</tt> </tt>
2161 <a name="L572"></a><tt class="py-lineno">572</tt> <tt class="py-line"> </tt>
2162 <a name="L573"></a><tt class="py-lineno">573</tt> <tt class="py-line"> <tt id="link-392" class="py-name" targets="Variable lxml.tests.test_xpathevaluator.ETreeXPathExsltTestCase.NSMAP=lxml.tests.test_xpathevaluator.ETreeXPathExsltTestCase-class.html#NSMAP"><a title="lxml.tests.test_xpathevaluator.ETreeXPathExsltTestCase.NSMAP" class="py-name" href="#" onclick="return doclink('link-392', 'NSMAP', 'link-392');">NSMAP</a></tt> <tt class="py-op">=</tt> <tt class="py-name">dict</tt><tt class="py-op">(</tt> </tt>
2163 <a name="L574"></a><tt class="py-lineno">574</tt> <tt class="py-line"> <tt class="py-name">date</tt> <tt class="py-op">=</tt> <tt class="py-string">"http://exslt.org/dates-and-times"</tt><tt class="py-op">,</tt> </tt>
2164 <a name="L575"></a><tt class="py-lineno">575</tt> <tt class="py-line"> <tt class="py-name">math</tt> <tt class="py-op">=</tt> <tt class="py-string">"http://exslt.org/math"</tt><tt class="py-op">,</tt> </tt>
2165 <a name="L576"></a><tt class="py-lineno">576</tt> <tt class="py-line"> <tt id="link-393" 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
2166 lxml.etree._XSLTProcessingInstruction.set
2167 lxml.etree.__ContentOnlyElement.set" class="py-name" href="#" onclick="return doclink('link-393', 'set', 'link-393');">set</a></tt> <tt class="py-op">=</tt> <tt class="py-string">"http://exslt.org/sets"</tt><tt class="py-op">,</tt> </tt>
2168 <a name="L577"></a><tt class="py-lineno">577</tt> <tt class="py-line"> <tt class="py-name">str</tt> <tt class="py-op">=</tt> <tt class="py-string">"http://exslt.org/strings"</tt><tt class="py-op">,</tt> </tt>
2169 <a name="L578"></a><tt class="py-lineno">578</tt> <tt class="py-line"> <tt class="py-op">)</tt> </tt>
2170 <a name="L579"></a><tt class="py-lineno">579</tt> <tt class="py-line"> </tt>
2171 <a name="ETreeXPathExsltTestCase.test_xpath_exslt_functions_date"></a><div id="ETreeXPathExsltTestCase.test_xpath_exslt_functions_date-def"><a name="L580"></a><tt class="py-lineno">580</tt> <a class="py-toggle" href="#" id="ETreeXPathExsltTestCase.test_xpath_exslt_functions_date-toggle" onclick="return toggle('ETreeXPathExsltTestCase.test_xpath_exslt_functions_date');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="lxml.tests.test_xpathevaluator.ETreeXPathExsltTestCase-class.html#test_xpath_exslt_functions_date">test_xpath_exslt_functions_date</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
2172 </div><div id="ETreeXPathExsltTestCase.test_xpath_exslt_functions_date-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="ETreeXPathExsltTestCase.test_xpath_exslt_functions_date-expanded"><a name="L581"></a><tt class="py-lineno">581</tt> <tt class="py-line"> <tt class="py-name">tree</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-394" class="py-name"><a title="lxml.cssselect.parse
2173 lxml.etree._ElementTree.parse
2175 lxml.html.ElementSoup.parse
2176 lxml.html.html5parser.parse
2178 lxml.html.soupparser.parse
2179 lxml.objectify.parse
2180 lxml.tests.common_imports.HelperTestCase.parse" class="py-name" href="#" onclick="return doclink('link-394', 'parse', 'link-14');">parse</a></tt><tt class="py-op">(</tt><tt class="py-string">'<a><b>2009-11-12</b><b>2008-12-11</b></a>'</tt><tt class="py-op">)</tt> </tt>
2181 <a name="L582"></a><tt class="py-lineno">582</tt> <tt class="py-line"> </tt>
2182 <a name="L583"></a><tt class="py-lineno">583</tt> <tt class="py-line"> <tt class="py-name">match_dates</tt> <tt class="py-op">=</tt> <tt class="py-name">tree</tt><tt class="py-op">.</tt><tt id="link-395" class="py-name"><a title="lxml.cssselect.Attrib.xpath
2183 lxml.cssselect.Class.xpath
2184 lxml.cssselect.CombinedSelector.xpath
2185 lxml.cssselect.Element.xpath
2186 lxml.cssselect.Function.xpath
2187 lxml.cssselect.Hash.xpath
2188 lxml.cssselect.Or.xpath
2189 lxml.cssselect.Pseudo.xpath
2190 lxml.etree._Element.xpath
2191 lxml.etree._ElementTree.xpath
2192 lxml.tests.test_xpathevaluator.xpath" class="py-name" href="#" onclick="return doclink('link-395', 'xpath', 'link-16');">xpath</a></tt><tt class="py-op">(</tt><tt class="py-string">'//b[date:year(string()) = 2009]'</tt><tt class="py-op">,</tt> </tt>
2193 <a name="L584"></a><tt class="py-lineno">584</tt> <tt class="py-line"> <tt class="py-name">namespaces</tt><tt class="py-op">=</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-396" class="py-name"><a title="lxml.tests.test_xpathevaluator.ETreeXPathExsltTestCase.NSMAP" class="py-name" href="#" onclick="return doclink('link-396', 'NSMAP', 'link-392');">NSMAP</a></tt><tt class="py-op">)</tt> </tt>
2194 <a name="L585"></a><tt class="py-lineno">585</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertTrue</tt><tt class="py-op">(</tt><tt class="py-name">match_dates</tt><tt class="py-op">,</tt> <tt class="py-name">str</tt><tt class="py-op">(</tt><tt class="py-name">match_dates</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
2195 <a name="L586"></a><tt class="py-lineno">586</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEquals</tt><tt class="py-op">(</tt><tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">match_dates</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-number">1</tt><tt class="py-op">,</tt> <tt class="py-name">str</tt><tt class="py-op">(</tt><tt class="py-name">match_dates</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
2196 <a name="L587"></a><tt class="py-lineno">587</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEquals</tt><tt class="py-op">(</tt><tt class="py-name">match_dates</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">.</tt><tt id="link-397" class="py-name"><a title="lxml.etree.QName.text
2197 lxml.etree._AppendOnlyElementProxy.text
2198 lxml.etree._Element.text
2199 lxml.etree._Entity.text
2200 lxml.etree._ModifyContentOnlyProxy.text
2201 lxml.etree._ReadOnlyEntityProxy.text
2202 lxml.etree._ReadOnlyProxy.text
2203 lxml.etree.__ContentOnlyElement.text
2204 lxml.objectify.ObjectifiedElement.text
2205 xml.etree.ElementTree.Element.text" class="py-name" href="#" onclick="return doclink('link-397', 'text', 'link-252');">text</a></tt><tt class="py-op">,</tt> <tt class="py-string">'2009-11-12'</tt><tt class="py-op">)</tt> </tt>
2206 </div><a name="L588"></a><tt class="py-lineno">588</tt> <tt class="py-line"> </tt>
2207 <a name="ETreeXPathExsltTestCase.test_xpath_exslt_functions_strings"></a><div id="ETreeXPathExsltTestCase.test_xpath_exslt_functions_strings-def"><a name="L589"></a><tt class="py-lineno">589</tt> <a class="py-toggle" href="#" id="ETreeXPathExsltTestCase.test_xpath_exslt_functions_strings-toggle" onclick="return toggle('ETreeXPathExsltTestCase.test_xpath_exslt_functions_strings');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="lxml.tests.test_xpathevaluator.ETreeXPathExsltTestCase-class.html#test_xpath_exslt_functions_strings">test_xpath_exslt_functions_strings</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
2208 </div><div id="ETreeXPathExsltTestCase.test_xpath_exslt_functions_strings-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="ETreeXPathExsltTestCase.test_xpath_exslt_functions_strings-expanded"><a name="L590"></a><tt class="py-lineno">590</tt> <tt class="py-line"> <tt class="py-name">tree</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-398" class="py-name"><a title="lxml.cssselect.parse
2209 lxml.etree._ElementTree.parse
2211 lxml.html.ElementSoup.parse
2212 lxml.html.html5parser.parse
2214 lxml.html.soupparser.parse
2215 lxml.objectify.parse
2216 lxml.tests.common_imports.HelperTestCase.parse" class="py-name" href="#" onclick="return doclink('link-398', 'parse', 'link-14');">parse</a></tt><tt class="py-op">(</tt><tt class="py-string">'<a><b>2009-11-12</b><b>2008-12-11</b></a>'</tt><tt class="py-op">)</tt> </tt>
2217 <a name="L591"></a><tt class="py-lineno">591</tt> <tt class="py-line"> </tt>
2218 <a name="L592"></a><tt class="py-lineno">592</tt> <tt class="py-line"> <tt class="py-name">match_date</tt> <tt class="py-op">=</tt> <tt class="py-name">tree</tt><tt class="py-op">.</tt><tt id="link-399" class="py-name"><a title="lxml.cssselect.Attrib.xpath
2219 lxml.cssselect.Class.xpath
2220 lxml.cssselect.CombinedSelector.xpath
2221 lxml.cssselect.Element.xpath
2222 lxml.cssselect.Function.xpath
2223 lxml.cssselect.Hash.xpath
2224 lxml.cssselect.Or.xpath
2225 lxml.cssselect.Pseudo.xpath
2226 lxml.etree._Element.xpath
2227 lxml.etree._ElementTree.xpath
2228 lxml.tests.test_xpathevaluator.xpath" class="py-name" href="#" onclick="return doclink('link-399', 'xpath', 'link-16');">xpath</a></tt><tt class="py-op">(</tt><tt class="py-string">'str:replace(//b[1], "-", "*")'</tt><tt class="py-op">,</tt> </tt>
2229 <a name="L593"></a><tt class="py-lineno">593</tt> <tt class="py-line"> <tt class="py-name">namespaces</tt><tt class="py-op">=</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-400" class="py-name"><a title="lxml.tests.test_xpathevaluator.ETreeXPathExsltTestCase.NSMAP" class="py-name" href="#" onclick="return doclink('link-400', 'NSMAP', 'link-392');">NSMAP</a></tt><tt class="py-op">)</tt> </tt>
2230 <a name="L594"></a><tt class="py-lineno">594</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertTrue</tt><tt class="py-op">(</tt><tt class="py-name">match_date</tt><tt class="py-op">,</tt> <tt class="py-name">str</tt><tt class="py-op">(</tt><tt class="py-name">match_date</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
2231 <a name="L595"></a><tt class="py-lineno">595</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEquals</tt><tt class="py-op">(</tt><tt class="py-name">match_date</tt><tt class="py-op">,</tt> <tt class="py-string">'2009*11*12'</tt><tt class="py-op">)</tt> </tt>
2232 </div></div><a name="L596"></a><tt class="py-lineno">596</tt> <tt class="py-line"> </tt>
2233 <a name="L597"></a><tt class="py-lineno">597</tt> <tt class="py-line"> </tt>
2234 <a name="ETreeETXPathClassTestCase"></a><div id="ETreeETXPathClassTestCase-def"><a name="L598"></a><tt class="py-lineno">598</tt> <a class="py-toggle" href="#" id="ETreeETXPathClassTestCase-toggle" onclick="return toggle('ETreeETXPathClassTestCase');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="lxml.tests.test_xpathevaluator.ETreeETXPathClassTestCase-class.html">ETreeETXPathClassTestCase</a><tt class="py-op">(</tt><tt class="py-base-class">HelperTestCase</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
2235 </div><div id="ETreeETXPathClassTestCase-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="ETreeETXPathClassTestCase-expanded"><a name="L599"></a><tt class="py-lineno">599</tt> <tt class="py-line"> <tt class="py-docstring">"Tests for the ETXPath class"</tt> </tt>
2236 <a name="ETreeETXPathClassTestCase.test_xpath_compile_ns"></a><div id="ETreeETXPathClassTestCase.test_xpath_compile_ns-def"><a name="L600"></a><tt class="py-lineno">600</tt> <a class="py-toggle" href="#" id="ETreeETXPathClassTestCase.test_xpath_compile_ns-toggle" onclick="return toggle('ETreeETXPathClassTestCase.test_xpath_compile_ns');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="lxml.tests.test_xpathevaluator.ETreeETXPathClassTestCase-class.html#test_xpath_compile_ns">test_xpath_compile_ns</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
2237 </div><div id="ETreeETXPathClassTestCase.test_xpath_compile_ns-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="ETreeETXPathClassTestCase.test_xpath_compile_ns-expanded"><a name="L601"></a><tt class="py-lineno">601</tt> <tt class="py-line"> <tt class="py-name">x</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-401" class="py-name"><a title="lxml.cssselect.parse
2238 lxml.etree._ElementTree.parse
2240 lxml.html.ElementSoup.parse
2241 lxml.html.html5parser.parse
2243 lxml.html.soupparser.parse
2244 lxml.objectify.parse
2245 lxml.tests.common_imports.HelperTestCase.parse" class="py-name" href="#" onclick="return doclink('link-401', 'parse', 'link-14');">parse</a></tt><tt class="py-op">(</tt><tt class="py-string">'<a><b xmlns="nsa"/><b xmlns="nsb"/></a>'</tt><tt class="py-op">)</tt> </tt>
2246 <a name="L602"></a><tt class="py-lineno">602</tt> <tt class="py-line"> </tt>
2247 <a name="L603"></a><tt class="py-lineno">603</tt> <tt class="py-line"> <tt class="py-name">expr</tt> <tt class="py-op">=</tt> <tt id="link-402" class="py-name"><a title="lxml.etree
2248 lxml.sax.ElementTreeContentHandler.etree
2249 lxml.tests.test_elementtree.CElementTreeTestCase.etree
2250 lxml.tests.test_elementtree.ETreeTestCaseBase.etree
2251 lxml.tests.test_io.IOTestCaseBase.etree" class="py-name" href="#" onclick="return doclink('link-402', 'etree', 'link-9');">etree</a></tt><tt class="py-op">.</tt><tt id="link-403" class="py-name" targets="Class lxml.etree.ETXPath=lxml.etree.ETXPath-class.html"><a title="lxml.etree.ETXPath" class="py-name" href="#" onclick="return doclink('link-403', 'ETXPath', 'link-403');">ETXPath</a></tt><tt class="py-op">(</tt><tt class="py-string">"/a/{nsa}b"</tt><tt class="py-op">)</tt> </tt>
2252 <a name="L604"></a><tt class="py-lineno">604</tt> <tt class="py-line"> <tt class="py-name">r</tt> <tt class="py-op">=</tt> <tt class="py-name">expr</tt><tt class="py-op">(</tt><tt class="py-name">x</tt><tt class="py-op">)</tt> </tt>
2253 <a name="L605"></a><tt class="py-lineno">605</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEquals</tt><tt class="py-op">(</tt><tt class="py-number">1</tt><tt class="py-op">,</tt> <tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">r</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
2254 <a name="L606"></a><tt class="py-lineno">606</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEquals</tt><tt class="py-op">(</tt><tt class="py-string">'{nsa}b'</tt><tt class="py-op">,</tt> <tt class="py-name">r</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">.</tt><tt id="link-404" class="py-name"><a title="lxml.etree._Comment.tag
2255 lxml.etree._Element.tag
2256 lxml.etree._Entity.tag
2257 lxml.etree._ProcessingInstruction.tag
2258 lxml.etree._ReadOnlyProxy.tag
2259 lxml.tests.test_xpathevaluator.tag
2260 xml.etree.ElementTree.Element.tag" class="py-name" href="#" onclick="return doclink('link-404', 'tag', 'link-88');">tag</a></tt><tt class="py-op">)</tt> </tt>
2261 <a name="L607"></a><tt class="py-lineno">607</tt> <tt class="py-line"> </tt>
2262 <a name="L608"></a><tt class="py-lineno">608</tt> <tt class="py-line"> <tt class="py-name">expr</tt> <tt class="py-op">=</tt> <tt id="link-405" class="py-name"><a title="lxml.etree
2263 lxml.sax.ElementTreeContentHandler.etree
2264 lxml.tests.test_elementtree.CElementTreeTestCase.etree
2265 lxml.tests.test_elementtree.ETreeTestCaseBase.etree
2266 lxml.tests.test_io.IOTestCaseBase.etree" class="py-name" href="#" onclick="return doclink('link-405', 'etree', 'link-9');">etree</a></tt><tt class="py-op">.</tt><tt id="link-406" class="py-name"><a title="lxml.etree.ETXPath" class="py-name" href="#" onclick="return doclink('link-406', 'ETXPath', 'link-403');">ETXPath</a></tt><tt class="py-op">(</tt><tt class="py-string">"/a/{nsb}b"</tt><tt class="py-op">)</tt> </tt>
2267 <a name="L609"></a><tt class="py-lineno">609</tt> <tt class="py-line"> <tt class="py-name">r</tt> <tt class="py-op">=</tt> <tt class="py-name">expr</tt><tt class="py-op">(</tt><tt class="py-name">x</tt><tt class="py-op">)</tt> </tt>
2268 <a name="L610"></a><tt class="py-lineno">610</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEquals</tt><tt class="py-op">(</tt><tt class="py-number">1</tt><tt class="py-op">,</tt> <tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">r</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
2269 <a name="L611"></a><tt class="py-lineno">611</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEquals</tt><tt class="py-op">(</tt><tt class="py-string">'{nsb}b'</tt><tt class="py-op">,</tt> <tt class="py-name">r</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">.</tt><tt id="link-407" class="py-name"><a title="lxml.etree._Comment.tag
2270 lxml.etree._Element.tag
2271 lxml.etree._Entity.tag
2272 lxml.etree._ProcessingInstruction.tag
2273 lxml.etree._ReadOnlyProxy.tag
2274 lxml.tests.test_xpathevaluator.tag
2275 xml.etree.ElementTree.Element.tag" class="py-name" href="#" onclick="return doclink('link-407', 'tag', 'link-88');">tag</a></tt><tt class="py-op">)</tt> </tt>
2276 </div><a name="L612"></a><tt class="py-lineno">612</tt> <tt class="py-line"> </tt>
2277 <a name="L613"></a><tt class="py-lineno">613</tt> <tt class="py-line"> <tt class="py-comment"># disabled this test as non-ASCII characters in namespace URIs are</tt> </tt>
2278 <a name="L614"></a><tt class="py-lineno">614</tt> <tt class="py-line"> <tt class="py-comment"># not acceptable</tt> </tt>
2279 <a name="ETreeETXPathClassTestCase._test_xpath_compile_unicode"></a><div id="ETreeETXPathClassTestCase._test_xpath_compile_unicode-def"><a name="L615"></a><tt class="py-lineno">615</tt> <a class="py-toggle" href="#" id="ETreeETXPathClassTestCase._test_xpath_compile_unicode-toggle" onclick="return toggle('ETreeETXPathClassTestCase._test_xpath_compile_unicode');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="lxml.tests.test_xpathevaluator.ETreeETXPathClassTestCase-class.html#_test_xpath_compile_unicode">_test_xpath_compile_unicode</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
2280 </div><div id="ETreeETXPathClassTestCase._test_xpath_compile_unicode-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="ETreeETXPathClassTestCase._test_xpath_compile_unicode-expanded"><a name="L616"></a><tt class="py-lineno">616</tt> <tt class="py-line"> <tt class="py-name">x</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-408" class="py-name"><a title="lxml.cssselect.parse
2281 lxml.etree._ElementTree.parse
2283 lxml.html.ElementSoup.parse
2284 lxml.html.html5parser.parse
2286 lxml.html.soupparser.parse
2287 lxml.objectify.parse
2288 lxml.tests.common_imports.HelperTestCase.parse" class="py-name" href="#" onclick="return doclink('link-408', 'parse', 'link-14');">parse</a></tt><tt class="py-op">(</tt><tt id="link-409" class="py-name"><a title="lxml.tests.common_imports._bytes" class="py-name" href="#" onclick="return doclink('link-409', '_bytes', 'link-11');">_bytes</a></tt><tt class="py-op">(</tt><tt class="py-string">'<a><b xmlns="http://nsa/\\uf8d2"/><b xmlns="http://nsb/\\uf8d1"/></a>'</tt> </tt>
2289 <a name="L617"></a><tt class="py-lineno">617</tt> <tt class="py-line"> <tt class="py-op">)</tt><tt class="py-op">.</tt><tt class="py-name">decode</tt><tt class="py-op">(</tt><tt class="py-string">"unicode_escape"</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
2290 <a name="L618"></a><tt class="py-lineno">618</tt> <tt class="py-line"> </tt>
2291 <a name="L619"></a><tt class="py-lineno">619</tt> <tt class="py-line"> <tt class="py-name">expr</tt> <tt class="py-op">=</tt> <tt id="link-410" class="py-name"><a title="lxml.etree
2292 lxml.sax.ElementTreeContentHandler.etree
2293 lxml.tests.test_elementtree.CElementTreeTestCase.etree
2294 lxml.tests.test_elementtree.ETreeTestCaseBase.etree
2295 lxml.tests.test_io.IOTestCaseBase.etree" class="py-name" href="#" onclick="return doclink('link-410', 'etree', 'link-9');">etree</a></tt><tt class="py-op">.</tt><tt id="link-411" class="py-name"><a title="lxml.etree.ETXPath" class="py-name" href="#" onclick="return doclink('link-411', 'ETXPath', 'link-403');">ETXPath</a></tt><tt class="py-op">(</tt><tt id="link-412" class="py-name"><a title="lxml.tests.common_imports._bytes" class="py-name" href="#" onclick="return doclink('link-412', '_bytes', 'link-11');">_bytes</a></tt><tt class="py-op">(</tt><tt class="py-string">"/a/{http://nsa/\\uf8d2}b"</tt><tt class="py-op">)</tt><tt class="py-op">.</tt><tt class="py-name">decode</tt><tt class="py-op">(</tt><tt class="py-string">"unicode_escape"</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
2296 <a name="L620"></a><tt class="py-lineno">620</tt> <tt class="py-line"> <tt class="py-name">r</tt> <tt class="py-op">=</tt> <tt class="py-name">expr</tt><tt class="py-op">(</tt><tt class="py-name">x</tt><tt class="py-op">)</tt> </tt>
2297 <a name="L621"></a><tt class="py-lineno">621</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEquals</tt><tt class="py-op">(</tt><tt class="py-number">1</tt><tt class="py-op">,</tt> <tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">r</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
2298 <a name="L622"></a><tt class="py-lineno">622</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEquals</tt><tt class="py-op">(</tt><tt id="link-413" class="py-name"><a title="lxml.tests.common_imports._bytes" class="py-name" href="#" onclick="return doclink('link-413', '_bytes', 'link-11');">_bytes</a></tt><tt class="py-op">(</tt><tt class="py-string">'{http://nsa/\\uf8d2}b'</tt><tt class="py-op">)</tt><tt class="py-op">.</tt><tt class="py-name">decode</tt><tt class="py-op">(</tt><tt class="py-string">"unicode_escape"</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-name">r</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">.</tt><tt id="link-414" class="py-name"><a title="lxml.etree._Comment.tag
2299 lxml.etree._Element.tag
2300 lxml.etree._Entity.tag
2301 lxml.etree._ProcessingInstruction.tag
2302 lxml.etree._ReadOnlyProxy.tag
2303 lxml.tests.test_xpathevaluator.tag
2304 xml.etree.ElementTree.Element.tag" class="py-name" href="#" onclick="return doclink('link-414', 'tag', 'link-88');">tag</a></tt><tt class="py-op">)</tt> </tt>
2305 <a name="L623"></a><tt class="py-lineno">623</tt> <tt class="py-line"> </tt>
2306 <a name="L624"></a><tt class="py-lineno">624</tt> <tt class="py-line"> <tt class="py-name">expr</tt> <tt class="py-op">=</tt> <tt id="link-415" class="py-name"><a title="lxml.etree
2307 lxml.sax.ElementTreeContentHandler.etree
2308 lxml.tests.test_elementtree.CElementTreeTestCase.etree
2309 lxml.tests.test_elementtree.ETreeTestCaseBase.etree
2310 lxml.tests.test_io.IOTestCaseBase.etree" class="py-name" href="#" onclick="return doclink('link-415', 'etree', 'link-9');">etree</a></tt><tt class="py-op">.</tt><tt id="link-416" class="py-name"><a title="lxml.etree.ETXPath" class="py-name" href="#" onclick="return doclink('link-416', 'ETXPath', 'link-403');">ETXPath</a></tt><tt class="py-op">(</tt><tt id="link-417" class="py-name"><a title="lxml.tests.common_imports._bytes" class="py-name" href="#" onclick="return doclink('link-417', '_bytes', 'link-11');">_bytes</a></tt><tt class="py-op">(</tt><tt class="py-string">"/a/{http://nsb/\\uf8d1}b"</tt><tt class="py-op">)</tt><tt class="py-op">.</tt><tt class="py-name">decode</tt><tt class="py-op">(</tt><tt class="py-string">"unicode_escape"</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
2311 <a name="L625"></a><tt class="py-lineno">625</tt> <tt class="py-line"> <tt class="py-name">r</tt> <tt class="py-op">=</tt> <tt class="py-name">expr</tt><tt class="py-op">(</tt><tt class="py-name">x</tt><tt class="py-op">)</tt> </tt>
2312 <a name="L626"></a><tt class="py-lineno">626</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEquals</tt><tt class="py-op">(</tt><tt class="py-number">1</tt><tt class="py-op">,</tt> <tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">r</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
2313 <a name="L627"></a><tt class="py-lineno">627</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEquals</tt><tt class="py-op">(</tt><tt id="link-418" class="py-name"><a title="lxml.tests.common_imports._bytes" class="py-name" href="#" onclick="return doclink('link-418', '_bytes', 'link-11');">_bytes</a></tt><tt class="py-op">(</tt><tt class="py-string">'{http://nsb/\\uf8d1}b'</tt><tt class="py-op">)</tt><tt class="py-op">.</tt><tt class="py-name">decode</tt><tt class="py-op">(</tt><tt class="py-string">"unicode_escape"</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-name">r</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">.</tt><tt id="link-419" class="py-name"><a title="lxml.etree._Comment.tag
2314 lxml.etree._Element.tag
2315 lxml.etree._Entity.tag
2316 lxml.etree._ProcessingInstruction.tag
2317 lxml.etree._ReadOnlyProxy.tag
2318 lxml.tests.test_xpathevaluator.tag
2319 xml.etree.ElementTree.Element.tag" class="py-name" href="#" onclick="return doclink('link-419', 'tag', 'link-88');">tag</a></tt><tt class="py-op">)</tt> </tt>
2320 </div></div><a name="L628"></a><tt class="py-lineno">628</tt> <tt class="py-line"> </tt>
2321 <a name="L629"></a><tt class="py-lineno">629</tt> <tt class="py-line"><tt id="link-420" class="py-name" targets="Variable lxml.tests.test_xpathevaluator.SAMPLE_XML=lxml.tests.test_xpathevaluator-module.html#SAMPLE_XML"><a title="lxml.tests.test_xpathevaluator.SAMPLE_XML" class="py-name" href="#" onclick="return doclink('link-420', 'SAMPLE_XML', 'link-420');">SAMPLE_XML</a></tt> <tt class="py-op">=</tt> <tt id="link-421" class="py-name"><a title="lxml.etree
2322 lxml.sax.ElementTreeContentHandler.etree
2323 lxml.tests.test_elementtree.CElementTreeTestCase.etree
2324 lxml.tests.test_elementtree.ETreeTestCaseBase.etree
2325 lxml.tests.test_io.IOTestCaseBase.etree" class="py-name" href="#" onclick="return doclink('link-421', 'etree', 'link-9');">etree</a></tt><tt class="py-op">.</tt><tt id="link-422" class="py-name"><a title="lxml.cssselect.parse
2326 lxml.etree._ElementTree.parse
2328 lxml.html.ElementSoup.parse
2329 lxml.html.html5parser.parse
2331 lxml.html.soupparser.parse
2332 lxml.objectify.parse
2333 lxml.tests.common_imports.HelperTestCase.parse" class="py-name" href="#" onclick="return doclink('link-422', 'parse', 'link-14');">parse</a></tt><tt class="py-op">(</tt><tt class="py-name">BytesIO</tt><tt class="py-op">(</tt><tt class="py-string">"""</tt> </tt>
2334 <a name="L630"></a><tt class="py-lineno">630</tt> <tt class="py-line"><tt class="py-string"><body></tt> </tt>
2335 <a name="L631"></a><tt class="py-lineno">631</tt> <tt class="py-line"><tt class="py-string"> <tag>text</tag></tt> </tt>
2336 <a name="L632"></a><tt class="py-lineno">632</tt> <tt class="py-line"><tt class="py-string"> <section></tt> </tt>
2337 <a name="L633"></a><tt class="py-lineno">633</tt> <tt class="py-line"><tt class="py-string"> <tag>subtext</tag></tt> </tt>
2338 <a name="L634"></a><tt class="py-lineno">634</tt> <tt class="py-line"><tt class="py-string"> </section></tt> </tt>
2339 <a name="L635"></a><tt class="py-lineno">635</tt> <tt class="py-line"><tt class="py-string"> <tag /></tt> </tt>
2340 <a name="L636"></a><tt class="py-lineno">636</tt> <tt class="py-line"><tt class="py-string"> <tag /></tt> </tt>
2341 <a name="L637"></a><tt class="py-lineno">637</tt> <tt class="py-line"><tt class="py-string"></body></tt> </tt>
2342 <a name="L638"></a><tt class="py-lineno">638</tt> <tt class="py-line"><tt class="py-string">"""</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
2343 <a name="L639"></a><tt class="py-lineno">639</tt> <tt class="py-line"> </tt>
2344 <a name="tag"></a><div id="tag-def"><a name="L640"></a><tt class="py-lineno">640</tt> <a class="py-toggle" href="#" id="tag-toggle" onclick="return toggle('tag');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="lxml.tests.test_xpathevaluator-module.html#tag">tag</a><tt class="py-op">(</tt><tt class="py-param">elem</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
2345 </div><div id="tag-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="tag-expanded"><a name="L641"></a><tt class="py-lineno">641</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">elem</tt><tt class="py-op">.</tt><tt id="link-423" class="py-name"><a title="lxml.etree._Comment.tag
2346 lxml.etree._Element.tag
2347 lxml.etree._Entity.tag
2348 lxml.etree._ProcessingInstruction.tag
2349 lxml.etree._ReadOnlyProxy.tag
2350 lxml.tests.test_xpathevaluator.tag
2351 xml.etree.ElementTree.Element.tag" class="py-name" href="#" onclick="return doclink('link-423', 'tag', 'link-88');">tag</a></tt> </tt>
2352 </div><a name="L642"></a><tt class="py-lineno">642</tt> <tt class="py-line"> </tt>
2353 <a name="tag_or_value"></a><div id="tag_or_value-def"><a name="L643"></a><tt class="py-lineno">643</tt> <a class="py-toggle" href="#" id="tag_or_value-toggle" onclick="return toggle('tag_or_value');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="lxml.tests.test_xpathevaluator-module.html#tag_or_value">tag_or_value</a><tt class="py-op">(</tt><tt class="py-param">elem</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
2354 </div><div id="tag_or_value-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="tag_or_value-expanded"><a name="L644"></a><tt class="py-lineno">644</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">getattr</tt><tt class="py-op">(</tt><tt class="py-name">elem</tt><tt class="py-op">,</tt> <tt class="py-string">'tag'</tt><tt class="py-op">,</tt> <tt class="py-name">elem</tt><tt class="py-op">)</tt> </tt>
2355 </div><a name="L645"></a><tt class="py-lineno">645</tt> <tt class="py-line"> </tt>
2356 <a name="stringTest"></a><div id="stringTest-def"><a name="L646"></a><tt class="py-lineno">646</tt> <a class="py-toggle" href="#" id="stringTest-toggle" onclick="return toggle('stringTest');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="lxml.tests.test_xpathevaluator-module.html#stringTest">stringTest</a><tt class="py-op">(</tt><tt class="py-param">ctxt</tt><tt class="py-op">,</tt> <tt class="py-param">s1</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
2357 </div><div id="stringTest-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="stringTest-expanded"><a name="L647"></a><tt class="py-lineno">647</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-string">"Hello "</tt><tt class="py-op">+</tt><tt class="py-name">s1</tt> </tt>
2358 </div><a name="L648"></a><tt class="py-lineno">648</tt> <tt class="py-line"> </tt>
2359 <a name="stringListTest"></a><div id="stringListTest-def"><a name="L649"></a><tt class="py-lineno">649</tt> <a class="py-toggle" href="#" id="stringListTest-toggle" onclick="return toggle('stringListTest');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="lxml.tests.test_xpathevaluator-module.html#stringListTest">stringListTest</a><tt class="py-op">(</tt><tt class="py-param">ctxt</tt><tt class="py-op">,</tt> <tt class="py-param">s1</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
2360 </div><div id="stringListTest-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="stringListTest-expanded"><a name="L650"></a><tt class="py-lineno">650</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-op">[</tt><tt class="py-string">"Hello "</tt><tt class="py-op">]</tt> <tt class="py-op">+</tt> <tt class="py-name">list</tt><tt class="py-op">(</tt><tt class="py-name">s1</tt><tt class="py-op">)</tt> <tt class="py-op">+</tt> <tt class="py-op">[</tt><tt class="py-string">"!"</tt><tt class="py-op">]</tt> </tt>
2361 </div><a name="L651"></a><tt class="py-lineno">651</tt> <tt class="py-line"> </tt>
2362 <a name="floatTest"></a><div id="floatTest-def"><a name="L652"></a><tt class="py-lineno">652</tt> <a class="py-toggle" href="#" id="floatTest-toggle" onclick="return toggle('floatTest');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="lxml.tests.test_xpathevaluator-module.html#floatTest">floatTest</a><tt class="py-op">(</tt><tt class="py-param">ctxt</tt><tt class="py-op">,</tt> <tt class="py-param">f1</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
2363 </div><div id="floatTest-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="floatTest-expanded"><a name="L653"></a><tt class="py-lineno">653</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">f1</tt><tt class="py-op">+</tt><tt class="py-number">4</tt> </tt>
2364 </div><a name="L654"></a><tt class="py-lineno">654</tt> <tt class="py-line"> </tt>
2365 <a name="booleanTest"></a><div id="booleanTest-def"><a name="L655"></a><tt class="py-lineno">655</tt> <a class="py-toggle" href="#" id="booleanTest-toggle" onclick="return toggle('booleanTest');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="lxml.tests.test_xpathevaluator-module.html#booleanTest">booleanTest</a><tt class="py-op">(</tt><tt class="py-param">ctxt</tt><tt class="py-op">,</tt> <tt class="py-param">b1</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
2366 </div><div id="booleanTest-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="booleanTest-expanded"><a name="L656"></a><tt class="py-lineno">656</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-keyword">not</tt> <tt class="py-name">b1</tt> </tt>
2367 </div><a name="L657"></a><tt class="py-lineno">657</tt> <tt class="py-line"> </tt>
2368 <a name="setTest"></a><div id="setTest-def"><a name="L658"></a><tt class="py-lineno">658</tt> <a class="py-toggle" href="#" id="setTest-toggle" onclick="return toggle('setTest');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="lxml.tests.test_xpathevaluator-module.html#setTest">setTest</a><tt class="py-op">(</tt><tt class="py-param">ctxt</tt><tt class="py-op">,</tt> <tt class="py-param">st1</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
2369 </div><div id="setTest-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="setTest-expanded"><a name="L659"></a><tt class="py-lineno">659</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">st1</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt> </tt>
2370 </div><a name="L660"></a><tt class="py-lineno">660</tt> <tt class="py-line"> </tt>
2371 <a name="setTest2"></a><div id="setTest2-def"><a name="L661"></a><tt class="py-lineno">661</tt> <a class="py-toggle" href="#" id="setTest2-toggle" onclick="return toggle('setTest2');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="lxml.tests.test_xpathevaluator-module.html#setTest2">setTest2</a><tt class="py-op">(</tt><tt class="py-param">ctxt</tt><tt class="py-op">,</tt> <tt class="py-param">st1</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
2372 </div><div id="setTest2-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="setTest2-expanded"><a name="L662"></a><tt class="py-lineno">662</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">st1</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">:</tt><tt class="py-number">2</tt><tt class="py-op">]</tt> </tt>
2373 </div><a name="L663"></a><tt class="py-lineno">663</tt> <tt class="py-line"> </tt>
2374 <a name="argsTest1"></a><div id="argsTest1-def"><a name="L664"></a><tt class="py-lineno">664</tt> <a class="py-toggle" href="#" id="argsTest1-toggle" onclick="return toggle('argsTest1');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="lxml.tests.test_xpathevaluator-module.html#argsTest1">argsTest1</a><tt class="py-op">(</tt><tt class="py-param">ctxt</tt><tt class="py-op">,</tt> <tt class="py-param">s</tt><tt class="py-op">,</tt> <tt class="py-param">f</tt><tt class="py-op">,</tt> <tt class="py-param">b</tt><tt class="py-op">,</tt> <tt class="py-param">st</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
2375 </div><div id="argsTest1-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="argsTest1-expanded"><a name="L665"></a><tt class="py-lineno">665</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-string">", "</tt><tt class="py-op">.</tt><tt id="link-424" class="py-name" targets="Method lxml.cssselect.XPathExpr.join()=lxml.cssselect.XPathExpr-class.html#join"><a title="lxml.cssselect.XPathExpr.join" class="py-name" href="#" onclick="return doclink('link-424', 'join', 'link-424');">join</a></tt><tt class="py-op">(</tt><tt class="py-name">map</tt><tt class="py-op">(</tt><tt class="py-name">str</tt><tt class="py-op">,</tt> <tt class="py-op">(</tt><tt class="py-name">s</tt><tt class="py-op">,</tt> <tt class="py-name">f</tt><tt class="py-op">,</tt> <tt class="py-name">b</tt><tt class="py-op">,</tt> <tt class="py-name">list</tt><tt class="py-op">(</tt><tt class="py-name">map</tt><tt class="py-op">(</tt><tt id="link-425" class="py-name"><a title="lxml.etree._Comment.tag
2376 lxml.etree._Element.tag
2377 lxml.etree._Entity.tag
2378 lxml.etree._ProcessingInstruction.tag
2379 lxml.etree._ReadOnlyProxy.tag
2380 lxml.tests.test_xpathevaluator.tag
2381 xml.etree.ElementTree.Element.tag" class="py-name" href="#" onclick="return doclink('link-425', 'tag', 'link-88');">tag</a></tt><tt class="py-op">,</tt> <tt class="py-name">st</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
2382 </div><a name="L666"></a><tt class="py-lineno">666</tt> <tt class="py-line"> </tt>
2383 <a name="argsTest2"></a><div id="argsTest2-def"><a name="L667"></a><tt class="py-lineno">667</tt> <a class="py-toggle" href="#" id="argsTest2-toggle" onclick="return toggle('argsTest2');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="lxml.tests.test_xpathevaluator-module.html#argsTest2">argsTest2</a><tt class="py-op">(</tt><tt class="py-param">ctxt</tt><tt class="py-op">,</tt> <tt class="py-param">st1</tt><tt class="py-op">,</tt> <tt class="py-param">st2</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
2384 </div><div id="argsTest2-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="argsTest2-expanded"><a name="L668"></a><tt class="py-lineno">668</tt> <tt class="py-line"> <tt class="py-name">st1</tt><tt class="py-op">.</tt><tt id="link-426" class="py-name" targets="Method lxml.etree._AppendOnlyElementProxy.extend()=lxml.etree._AppendOnlyElementProxy-class.html#extend,Method lxml.etree._Element.extend()=lxml.etree._Element-class.html#extend,Method lxml.etree._OpaqueDocumentWrapper.extend()=lxml.etree._OpaqueDocumentWrapper-class.html#extend"><a title="lxml.etree._AppendOnlyElementProxy.extend
2385 lxml.etree._Element.extend
2386 lxml.etree._OpaqueDocumentWrapper.extend" class="py-name" href="#" onclick="return doclink('link-426', 'extend', 'link-426');">extend</a></tt><tt class="py-op">(</tt><tt class="py-name">st2</tt><tt class="py-op">)</tt> </tt>
2387 <a name="L669"></a><tt class="py-lineno">669</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">st1</tt> </tt>
2388 </div><a name="L670"></a><tt class="py-lineno">670</tt> <tt class="py-line"> </tt>
2389 <a name="resultTypesTest"></a><div id="resultTypesTest-def"><a name="L671"></a><tt class="py-lineno">671</tt> <a class="py-toggle" href="#" id="resultTypesTest-toggle" onclick="return toggle('resultTypesTest');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="lxml.tests.test_xpathevaluator-module.html#resultTypesTest">resultTypesTest</a><tt class="py-op">(</tt><tt class="py-param">ctxt</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
2390 </div><div id="resultTypesTest-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="resultTypesTest-expanded"><a name="L672"></a><tt class="py-lineno">672</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-op">[</tt><tt class="py-name">None</tt><tt class="py-op">,</tt><tt class="py-name">None</tt><tt class="py-op">]</tt> </tt>
2391 </div><a name="L673"></a><tt class="py-lineno">673</tt> <tt class="py-line"> </tt>
2392 <a name="resultTypesTest2"></a><div id="resultTypesTest2-def"><a name="L674"></a><tt class="py-lineno">674</tt> <a class="py-toggle" href="#" id="resultTypesTest2-toggle" onclick="return toggle('resultTypesTest2');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="lxml.tests.test_xpathevaluator-module.html#resultTypesTest2">resultTypesTest2</a><tt class="py-op">(</tt><tt class="py-param">ctxt</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
2393 </div><div id="resultTypesTest2-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="resultTypesTest2-expanded"><a name="L675"></a><tt class="py-lineno">675</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt id="link-427" class="py-name" targets="Function lxml.tests.test_xpathevaluator.resultTypesTest()=lxml.tests.test_xpathevaluator-module.html#resultTypesTest"><a title="lxml.tests.test_xpathevaluator.resultTypesTest" class="py-name" href="#" onclick="return doclink('link-427', 'resultTypesTest', 'link-427');">resultTypesTest</a></tt> </tt>
2394 </div><a name="L676"></a><tt class="py-lineno">676</tt> <tt class="py-line"> </tt>
2395 <a name="L677"></a><tt class="py-lineno">677</tt> <tt class="py-line"><tt id="link-428" class="py-name" targets="Variable lxml.tests.test_xpathevaluator.uri=lxml.tests.test_xpathevaluator-module.html#uri"><a title="lxml.tests.test_xpathevaluator.uri" class="py-name" href="#" onclick="return doclink('link-428', 'uri', 'link-428');">uri</a></tt> <tt class="py-op">=</tt> <tt class="py-string">"http://www.example.com/"</tt> </tt>
2396 <a name="L678"></a><tt class="py-lineno">678</tt> <tt class="py-line"> </tt>
2397 <a name="L679"></a><tt class="py-lineno">679</tt> <tt class="py-line"><tt id="link-429" class="py-name"><a title="lxml.tests.test_xpathevaluator.extension" class="py-name" href="#" onclick="return doclink('link-429', 'extension', 'link-233');">extension</a></tt> <tt class="py-op">=</tt> <tt class="py-op">{</tt><tt class="py-op">(</tt><tt class="py-name">None</tt><tt class="py-op">,</tt> <tt class="py-string">'stringTest'</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> <tt id="link-430" class="py-name" targets="Function lxml.tests.test_xpathevaluator.stringTest()=lxml.tests.test_xpathevaluator-module.html#stringTest"><a title="lxml.tests.test_xpathevaluator.stringTest" class="py-name" href="#" onclick="return doclink('link-430', 'stringTest', 'link-430');">stringTest</a></tt><tt class="py-op">,</tt> </tt>
2398 <a name="L680"></a><tt class="py-lineno">680</tt> <tt class="py-line"> <tt class="py-op">(</tt><tt class="py-name">None</tt><tt class="py-op">,</tt> <tt class="py-string">'stringListTest'</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> <tt id="link-431" class="py-name" targets="Function lxml.tests.test_xpathevaluator.stringListTest()=lxml.tests.test_xpathevaluator-module.html#stringListTest"><a title="lxml.tests.test_xpathevaluator.stringListTest" class="py-name" href="#" onclick="return doclink('link-431', 'stringListTest', 'link-431');">stringListTest</a></tt><tt class="py-op">,</tt> </tt>
2399 <a name="L681"></a><tt class="py-lineno">681</tt> <tt class="py-line"> <tt class="py-op">(</tt><tt class="py-name">None</tt><tt class="py-op">,</tt> <tt class="py-string">'floatTest'</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> <tt id="link-432" class="py-name" targets="Function lxml.tests.test_xpathevaluator.floatTest()=lxml.tests.test_xpathevaluator-module.html#floatTest"><a title="lxml.tests.test_xpathevaluator.floatTest" class="py-name" href="#" onclick="return doclink('link-432', 'floatTest', 'link-432');">floatTest</a></tt><tt class="py-op">,</tt> </tt>
2400 <a name="L682"></a><tt class="py-lineno">682</tt> <tt class="py-line"> <tt class="py-op">(</tt><tt class="py-name">None</tt><tt class="py-op">,</tt> <tt class="py-string">'booleanTest'</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> <tt id="link-433" class="py-name" targets="Function lxml.tests.test_xpathevaluator.booleanTest()=lxml.tests.test_xpathevaluator-module.html#booleanTest"><a title="lxml.tests.test_xpathevaluator.booleanTest" class="py-name" href="#" onclick="return doclink('link-433', 'booleanTest', 'link-433');">booleanTest</a></tt><tt class="py-op">,</tt> </tt>
2401 <a name="L683"></a><tt class="py-lineno">683</tt> <tt class="py-line"> <tt class="py-op">(</tt><tt class="py-name">None</tt><tt class="py-op">,</tt> <tt class="py-string">'setTest'</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> <tt id="link-434" class="py-name" targets="Function lxml.tests.test_xpathevaluator.setTest()=lxml.tests.test_xpathevaluator-module.html#setTest"><a title="lxml.tests.test_xpathevaluator.setTest" class="py-name" href="#" onclick="return doclink('link-434', 'setTest', 'link-434');">setTest</a></tt><tt class="py-op">,</tt> </tt>
2402 <a name="L684"></a><tt class="py-lineno">684</tt> <tt class="py-line"> <tt class="py-op">(</tt><tt class="py-name">None</tt><tt class="py-op">,</tt> <tt class="py-string">'setTest2'</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> <tt id="link-435" class="py-name" targets="Function lxml.tests.test_xpathevaluator.setTest2()=lxml.tests.test_xpathevaluator-module.html#setTest2"><a title="lxml.tests.test_xpathevaluator.setTest2" class="py-name" href="#" onclick="return doclink('link-435', 'setTest2', 'link-435');">setTest2</a></tt><tt class="py-op">,</tt> </tt>
2403 <a name="L685"></a><tt class="py-lineno">685</tt> <tt class="py-line"> <tt class="py-op">(</tt><tt class="py-name">None</tt><tt class="py-op">,</tt> <tt class="py-string">'argsTest1'</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> <tt id="link-436" class="py-name" targets="Function lxml.tests.test_xpathevaluator.argsTest1()=lxml.tests.test_xpathevaluator-module.html#argsTest1"><a title="lxml.tests.test_xpathevaluator.argsTest1" class="py-name" href="#" onclick="return doclink('link-436', 'argsTest1', 'link-436');">argsTest1</a></tt><tt class="py-op">,</tt> </tt>
2404 <a name="L686"></a><tt class="py-lineno">686</tt> <tt class="py-line"> <tt class="py-op">(</tt><tt class="py-name">None</tt><tt class="py-op">,</tt> <tt class="py-string">'argsTest2'</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> <tt id="link-437" class="py-name" targets="Function lxml.tests.test_xpathevaluator.argsTest2()=lxml.tests.test_xpathevaluator-module.html#argsTest2"><a title="lxml.tests.test_xpathevaluator.argsTest2" class="py-name" href="#" onclick="return doclink('link-437', 'argsTest2', 'link-437');">argsTest2</a></tt><tt class="py-op">,</tt> </tt>
2405 <a name="L687"></a><tt class="py-lineno">687</tt> <tt class="py-line"> <tt class="py-op">(</tt><tt class="py-name">None</tt><tt class="py-op">,</tt> <tt class="py-string">'resultTypesTest'</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> <tt id="link-438" class="py-name"><a title="lxml.tests.test_xpathevaluator.resultTypesTest" class="py-name" href="#" onclick="return doclink('link-438', 'resultTypesTest', 'link-427');">resultTypesTest</a></tt><tt class="py-op">,</tt> </tt>
2406 <a name="L688"></a><tt class="py-lineno">688</tt> <tt class="py-line"> <tt class="py-op">(</tt><tt class="py-name">None</tt><tt class="py-op">,</tt> <tt class="py-string">'resultTypesTest2'</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> <tt id="link-439" class="py-name" targets="Function lxml.tests.test_xpathevaluator.resultTypesTest2()=lxml.tests.test_xpathevaluator-module.html#resultTypesTest2"><a title="lxml.tests.test_xpathevaluator.resultTypesTest2" class="py-name" href="#" onclick="return doclink('link-439', 'resultTypesTest2', 'link-439');">resultTypesTest2</a></tt><tt class="py-op">,</tt><tt class="py-op">}</tt> </tt>
2407 <a name="L689"></a><tt class="py-lineno">689</tt> <tt class="py-line"> </tt>
2408 <a name="xpath"></a><div id="xpath-def"><a name="L690"></a><tt class="py-lineno">690</tt> <a class="py-toggle" href="#" id="xpath-toggle" onclick="return toggle('xpath');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="lxml.tests.test_xpathevaluator-module.html#xpath">xpath</a><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
2409 </div><div id="xpath-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="xpath-expanded"><a name="L691"></a><tt class="py-lineno">691</tt> <tt class="py-line"> <tt class="py-docstring">"""</tt> </tt>
2410 <a name="L692"></a><tt class="py-lineno">692</tt> <tt class="py-line"><tt class="py-docstring"> Test xpath extension functions.</tt> </tt>
2411 <a name="L693"></a><tt class="py-lineno">693</tt> <tt class="py-line"><tt class="py-docstring"> </tt> </tt>
2412 <a name="L694"></a><tt class="py-lineno">694</tt> <tt class="py-line"><tt class="py-docstring"> >>> root = SAMPLE_XML</tt> </tt>
2413 <a name="L695"></a><tt class="py-lineno">695</tt> <tt class="py-line"><tt class="py-docstring"> >>> e = etree.XPathEvaluator(root, extensions=[extension])</tt> </tt>
2414 <a name="L696"></a><tt class="py-lineno">696</tt> <tt class="py-line"><tt class="py-docstring"> >>> e("stringTest('you')")</tt> </tt>
2415 <a name="L697"></a><tt class="py-lineno">697</tt> <tt class="py-line"><tt class="py-docstring"> 'Hello you'</tt> </tt>
2416 <a name="L698"></a><tt class="py-lineno">698</tt> <tt class="py-line"><tt class="py-docstring"> >>> e(_bytes("stringTest('\\\\xe9lan')").decode("unicode_escape"))</tt> </tt>
2417 <a name="L699"></a><tt class="py-lineno">699</tt> <tt class="py-line"><tt class="py-docstring"> u'Hello \\xe9lan'</tt> </tt>
2418 <a name="L700"></a><tt class="py-lineno">700</tt> <tt class="py-line"><tt class="py-docstring"> >>> e("stringTest('you','there')") #doctest: +ELLIPSIS</tt> </tt>
2419 <a name="L701"></a><tt class="py-lineno">701</tt> <tt class="py-line"><tt class="py-docstring"> Traceback (most recent call last):</tt> </tt>
2420 <a name="L702"></a><tt class="py-lineno">702</tt> <tt class="py-line"><tt class="py-docstring"> ...</tt> </tt>
2421 <a name="L703"></a><tt class="py-lineno">703</tt> <tt class="py-line"><tt class="py-docstring"> TypeError: stringTest() takes... 2 ...arguments ...</tt> </tt>
2422 <a name="L704"></a><tt class="py-lineno">704</tt> <tt class="py-line"><tt class="py-docstring"> >>> e("floatTest(2)")</tt> </tt>
2423 <a name="L705"></a><tt class="py-lineno">705</tt> <tt class="py-line"><tt class="py-docstring"> 6.0</tt> </tt>
2424 <a name="L706"></a><tt class="py-lineno">706</tt> <tt class="py-line"><tt class="py-docstring"> >>> e("booleanTest(true())")</tt> </tt>
2425 <a name="L707"></a><tt class="py-lineno">707</tt> <tt class="py-line"><tt class="py-docstring"> False</tt> </tt>
2426 <a name="L708"></a><tt class="py-lineno">708</tt> <tt class="py-line"><tt class="py-docstring"> >>> list(map(tag, e("setTest(/body/tag)")))</tt> </tt>
2427 <a name="L709"></a><tt class="py-lineno">709</tt> <tt class="py-line"><tt class="py-docstring"> ['tag']</tt> </tt>
2428 <a name="L710"></a><tt class="py-lineno">710</tt> <tt class="py-line"><tt class="py-docstring"> >>> list(map(tag, e("setTest2(/body/*)")))</tt> </tt>
2429 <a name="L711"></a><tt class="py-lineno">711</tt> <tt class="py-line"><tt class="py-docstring"> ['tag', 'section']</tt> </tt>
2430 <a name="L712"></a><tt class="py-lineno">712</tt> <tt class="py-line"><tt class="py-docstring"> >>> list(map(tag_or_value, e("stringListTest(/body/tag)")))</tt> </tt>
2431 <a name="L713"></a><tt class="py-lineno">713</tt> <tt class="py-line"><tt class="py-docstring"> ['Hello ', 'tag', 'tag', 'tag', '!']</tt> </tt>
2432 <a name="L714"></a><tt class="py-lineno">714</tt> <tt class="py-line"><tt class="py-docstring"> >>> e("argsTest1('a',1.5,true(),/body/tag)")</tt> </tt>
2433 <a name="L715"></a><tt class="py-lineno">715</tt> <tt class="py-line"><tt class="py-docstring"> "a, 1.5, True, ['tag', 'tag', 'tag']"</tt> </tt>
2434 <a name="L716"></a><tt class="py-lineno">716</tt> <tt class="py-line"><tt class="py-docstring"> >>> list(map(tag, e("argsTest2(/body/tag, /body/section)")))</tt> </tt>
2435 <a name="L717"></a><tt class="py-lineno">717</tt> <tt class="py-line"><tt class="py-docstring"> ['tag', 'section', 'tag', 'tag']</tt> </tt>
2436 <a name="L718"></a><tt class="py-lineno">718</tt> <tt class="py-line"><tt class="py-docstring"> >>> e("resultTypesTest()")</tt> </tt>
2437 <a name="L719"></a><tt class="py-lineno">719</tt> <tt class="py-line"><tt class="py-docstring"> Traceback (most recent call last):</tt> </tt>
2438 <a name="L720"></a><tt class="py-lineno">720</tt> <tt class="py-line"><tt class="py-docstring"> ...</tt> </tt>
2439 <a name="L721"></a><tt class="py-lineno">721</tt> <tt class="py-line"><tt class="py-docstring"> XPathResultError: This is not a supported node-set result: None</tt> </tt>
2440 <a name="L722"></a><tt class="py-lineno">722</tt> <tt class="py-line"><tt class="py-docstring"> >>> try:</tt> </tt>
2441 <a name="L723"></a><tt class="py-lineno">723</tt> <tt class="py-line"><tt class="py-docstring"> ... e("resultTypesTest2()")</tt> </tt>
2442 <a name="L724"></a><tt class="py-lineno">724</tt> <tt class="py-line"><tt class="py-docstring"> ... except etree.XPathResultError:</tt> </tt>
2443 <a name="L725"></a><tt class="py-lineno">725</tt> <tt class="py-line"><tt class="py-docstring"> ... print("Got error")</tt> </tt>
2444 <a name="L726"></a><tt class="py-lineno">726</tt> <tt class="py-line"><tt class="py-docstring"> Got error</tt> </tt>
2445 <a name="L727"></a><tt class="py-lineno">727</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
2446 </div><a name="L728"></a><tt class="py-lineno">728</tt> <tt class="py-line"> </tt>
2447 <a name="L729"></a><tt class="py-lineno">729</tt> <tt class="py-line"><tt class="py-keyword">if</tt> <tt class="py-name">sys</tt><tt class="py-op">.</tt><tt class="py-name">version_info</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt> <tt class="py-op">>=</tt> <tt class="py-number">3</tt><tt class="py-op">:</tt> </tt>
2448 <a name="L730"></a><tt class="py-lineno">730</tt> <tt class="py-line"> <tt id="link-440" class="py-name"><a title="lxml.cssselect.Attrib.xpath
2449 lxml.cssselect.Class.xpath
2450 lxml.cssselect.CombinedSelector.xpath
2451 lxml.cssselect.Element.xpath
2452 lxml.cssselect.Function.xpath
2453 lxml.cssselect.Hash.xpath
2454 lxml.cssselect.Or.xpath
2455 lxml.cssselect.Pseudo.xpath
2456 lxml.etree._Element.xpath
2457 lxml.etree._ElementTree.xpath
2458 lxml.tests.test_xpathevaluator.xpath" class="py-name" href="#" onclick="return doclink('link-440', 'xpath', 'link-16');">xpath</a></tt><tt class="py-op">.</tt><tt id="link-441" class="py-name" targets="Variable lxml.html.ElementSoup.__doc__=lxml.html.ElementSoup-module.html#__doc__,Variable lxml.html.soupparser.__doc__=lxml.html.soupparser-module.html#__doc__"><a title="lxml.html.ElementSoup.__doc__
2459 lxml.html.soupparser.__doc__" class="py-name" href="#" onclick="return doclink('link-441', '__doc__', 'link-441');">__doc__</a></tt> <tt class="py-op">=</tt> <tt id="link-442" class="py-name"><a title="lxml.cssselect.Attrib.xpath
2460 lxml.cssselect.Class.xpath
2461 lxml.cssselect.CombinedSelector.xpath
2462 lxml.cssselect.Element.xpath
2463 lxml.cssselect.Function.xpath
2464 lxml.cssselect.Hash.xpath
2465 lxml.cssselect.Or.xpath
2466 lxml.cssselect.Pseudo.xpath
2467 lxml.etree._Element.xpath
2468 lxml.etree._ElementTree.xpath
2469 lxml.tests.test_xpathevaluator.xpath" class="py-name" href="#" onclick="return doclink('link-442', 'xpath', 'link-16');">xpath</a></tt><tt class="py-op">.</tt><tt id="link-443" class="py-name"><a title="lxml.html.ElementSoup.__doc__
2470 lxml.html.soupparser.__doc__" class="py-name" href="#" onclick="return doclink('link-443', '__doc__', 'link-441');">__doc__</a></tt><tt class="py-op">.</tt><tt id="link-444" 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
2471 lxml.etree._ExsltRegExp.replace" class="py-name" href="#" onclick="return doclink('link-444', 'replace', 'link-444');">replace</a></tt><tt class="py-op">(</tt><tt class="py-string">" u'"</tt><tt class="py-op">,</tt> <tt class="py-string">" '"</tt><tt class="py-op">)</tt> </tt>
2472 <a name="L731"></a><tt class="py-lineno">731</tt> <tt class="py-line"> <tt id="link-445" class="py-name"><a title="lxml.cssselect.Attrib.xpath
2473 lxml.cssselect.Class.xpath
2474 lxml.cssselect.CombinedSelector.xpath
2475 lxml.cssselect.Element.xpath
2476 lxml.cssselect.Function.xpath
2477 lxml.cssselect.Hash.xpath
2478 lxml.cssselect.Or.xpath
2479 lxml.cssselect.Pseudo.xpath
2480 lxml.etree._Element.xpath
2481 lxml.etree._ElementTree.xpath
2482 lxml.tests.test_xpathevaluator.xpath" class="py-name" href="#" onclick="return doclink('link-445', 'xpath', 'link-16');">xpath</a></tt><tt class="py-op">.</tt><tt id="link-446" class="py-name"><a title="lxml.html.ElementSoup.__doc__
2483 lxml.html.soupparser.__doc__" class="py-name" href="#" onclick="return doclink('link-446', '__doc__', 'link-441');">__doc__</a></tt> <tt class="py-op">=</tt> <tt id="link-447" class="py-name"><a title="lxml.cssselect.Attrib.xpath
2484 lxml.cssselect.Class.xpath
2485 lxml.cssselect.CombinedSelector.xpath
2486 lxml.cssselect.Element.xpath
2487 lxml.cssselect.Function.xpath
2488 lxml.cssselect.Hash.xpath
2489 lxml.cssselect.Or.xpath
2490 lxml.cssselect.Pseudo.xpath
2491 lxml.etree._Element.xpath
2492 lxml.etree._ElementTree.xpath
2493 lxml.tests.test_xpathevaluator.xpath" class="py-name" href="#" onclick="return doclink('link-447', 'xpath', 'link-16');">xpath</a></tt><tt class="py-op">.</tt><tt id="link-448" class="py-name"><a title="lxml.html.ElementSoup.__doc__
2494 lxml.html.soupparser.__doc__" class="py-name" href="#" onclick="return doclink('link-448', '__doc__', 'link-441');">__doc__</a></tt><tt class="py-op">.</tt><tt id="link-449" class="py-name"><a title="lxml.etree._Element.replace
2495 lxml.etree._ExsltRegExp.replace" class="py-name" href="#" onclick="return doclink('link-449', 'replace', 'link-444');">replace</a></tt><tt class="py-op">(</tt><tt class="py-string">" XPathResultError"</tt><tt class="py-op">,</tt> </tt>
2496 <a name="L732"></a><tt class="py-lineno">732</tt> <tt class="py-line"> <tt class="py-string">" lxml.etree.XPathResultError"</tt><tt class="py-op">)</tt> </tt>
2497 <a name="L733"></a><tt class="py-lineno">733</tt> <tt class="py-line"> <tt id="link-450" class="py-name"><a title="lxml.cssselect.Attrib.xpath
2498 lxml.cssselect.Class.xpath
2499 lxml.cssselect.CombinedSelector.xpath
2500 lxml.cssselect.Element.xpath
2501 lxml.cssselect.Function.xpath
2502 lxml.cssselect.Hash.xpath
2503 lxml.cssselect.Or.xpath
2504 lxml.cssselect.Pseudo.xpath
2505 lxml.etree._Element.xpath
2506 lxml.etree._ElementTree.xpath
2507 lxml.tests.test_xpathevaluator.xpath" class="py-name" href="#" onclick="return doclink('link-450', 'xpath', 'link-16');">xpath</a></tt><tt class="py-op">.</tt><tt id="link-451" class="py-name"><a title="lxml.html.ElementSoup.__doc__
2508 lxml.html.soupparser.__doc__" class="py-name" href="#" onclick="return doclink('link-451', '__doc__', 'link-441');">__doc__</a></tt> <tt class="py-op">=</tt> <tt id="link-452" class="py-name"><a title="lxml.cssselect.Attrib.xpath
2509 lxml.cssselect.Class.xpath
2510 lxml.cssselect.CombinedSelector.xpath
2511 lxml.cssselect.Element.xpath
2512 lxml.cssselect.Function.xpath
2513 lxml.cssselect.Hash.xpath
2514 lxml.cssselect.Or.xpath
2515 lxml.cssselect.Pseudo.xpath
2516 lxml.etree._Element.xpath
2517 lxml.etree._ElementTree.xpath
2518 lxml.tests.test_xpathevaluator.xpath" class="py-name" href="#" onclick="return doclink('link-452', 'xpath', 'link-16');">xpath</a></tt><tt class="py-op">.</tt><tt id="link-453" class="py-name"><a title="lxml.html.ElementSoup.__doc__
2519 lxml.html.soupparser.__doc__" class="py-name" href="#" onclick="return doclink('link-453', '__doc__', 'link-441');">__doc__</a></tt><tt class="py-op">.</tt><tt id="link-454" class="py-name"><a title="lxml.etree._Element.replace
2520 lxml.etree._ExsltRegExp.replace" class="py-name" href="#" onclick="return doclink('link-454', 'replace', 'link-444');">replace</a></tt><tt class="py-op">(</tt><tt class="py-string">" exactly 2 arguments"</tt><tt class="py-op">,</tt> </tt>
2521 <a name="L734"></a><tt class="py-lineno">734</tt> <tt class="py-line"> <tt class="py-string">" exactly 2 positional arguments"</tt><tt class="py-op">)</tt> </tt>
2522 <a name="L735"></a><tt class="py-lineno">735</tt> <tt class="py-line"> </tt>
2523 <a name="test_suite"></a><div id="test_suite-def"><a name="L736"></a><tt class="py-lineno">736</tt> <a class="py-toggle" href="#" id="test_suite-toggle" onclick="return toggle('test_suite');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="lxml.tests.test_xpathevaluator-module.html#test_suite">test_suite</a><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
2524 </div><div id="test_suite-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="test_suite-expanded"><a name="L737"></a><tt class="py-lineno">737</tt> <tt class="py-line"> <tt class="py-name">suite</tt> <tt class="py-op">=</tt> <tt class="py-name">unittest</tt><tt class="py-op">.</tt><tt class="py-name">TestSuite</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
2525 <a name="L738"></a><tt class="py-lineno">738</tt> <tt class="py-line"> <tt class="py-name">suite</tt><tt class="py-op">.</tt><tt class="py-name">addTests</tt><tt class="py-op">(</tt><tt class="py-op">[</tt><tt class="py-name">unittest</tt><tt class="py-op">.</tt><tt class="py-name">makeSuite</tt><tt class="py-op">(</tt><tt id="link-455" class="py-name" targets="Class lxml.tests.test_xpathevaluator.ETreeXPathTestCase=lxml.tests.test_xpathevaluator.ETreeXPathTestCase-class.html"><a title="lxml.tests.test_xpathevaluator.ETreeXPathTestCase" class="py-name" href="#" onclick="return doclink('link-455', 'ETreeXPathTestCase', 'link-455');">ETreeXPathTestCase</a></tt><tt class="py-op">)</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
2526 <a name="L739"></a><tt class="py-lineno">739</tt> <tt class="py-line"> <tt class="py-name">suite</tt><tt class="py-op">.</tt><tt class="py-name">addTests</tt><tt class="py-op">(</tt><tt class="py-op">[</tt><tt class="py-name">unittest</tt><tt class="py-op">.</tt><tt class="py-name">makeSuite</tt><tt class="py-op">(</tt><tt id="link-456" class="py-name" targets="Class lxml.tests.test_xpathevaluator.ETreeXPathClassTestCase=lxml.tests.test_xpathevaluator.ETreeXPathClassTestCase-class.html"><a title="lxml.tests.test_xpathevaluator.ETreeXPathClassTestCase" class="py-name" href="#" onclick="return doclink('link-456', 'ETreeXPathClassTestCase', 'link-456');">ETreeXPathClassTestCase</a></tt><tt class="py-op">)</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
2527 <a name="L740"></a><tt class="py-lineno">740</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt id="link-457" class="py-name"><a title="lxml.etree
2528 lxml.sax.ElementTreeContentHandler.etree
2529 lxml.tests.test_elementtree.CElementTreeTestCase.etree
2530 lxml.tests.test_elementtree.ETreeTestCaseBase.etree
2531 lxml.tests.test_io.IOTestCaseBase.etree" class="py-name" href="#" onclick="return doclink('link-457', 'etree', 'link-9');">etree</a></tt><tt class="py-op">.</tt><tt id="link-458" class="py-name" targets="Variable lxml.etree.LIBXSLT_COMPILED_VERSION=lxml.etree-module.html#LIBXSLT_COMPILED_VERSION"><a title="lxml.etree.LIBXSLT_COMPILED_VERSION" class="py-name" href="#" onclick="return doclink('link-458', 'LIBXSLT_COMPILED_VERSION', 'link-458');">LIBXSLT_COMPILED_VERSION</a></tt> <tt class="py-op">>=</tt> <tt class="py-op">(</tt><tt class="py-number">1</tt><tt class="py-op">,</tt><tt class="py-number">1</tt><tt class="py-op">,</tt><tt class="py-number">25</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
2532 <a name="L741"></a><tt class="py-lineno">741</tt> <tt class="py-line"> <tt class="py-name">suite</tt><tt class="py-op">.</tt><tt class="py-name">addTests</tt><tt class="py-op">(</tt><tt class="py-op">[</tt><tt class="py-name">unittest</tt><tt class="py-op">.</tt><tt class="py-name">makeSuite</tt><tt class="py-op">(</tt><tt id="link-459" class="py-name" targets="Class lxml.tests.test_xpathevaluator.ETreeXPathExsltTestCase=lxml.tests.test_xpathevaluator.ETreeXPathExsltTestCase-class.html"><a title="lxml.tests.test_xpathevaluator.ETreeXPathExsltTestCase" class="py-name" href="#" onclick="return doclink('link-459', 'ETreeXPathExsltTestCase', 'link-459');">ETreeXPathExsltTestCase</a></tt><tt class="py-op">)</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
2533 <a name="L742"></a><tt class="py-lineno">742</tt> <tt class="py-line"> <tt class="py-name">suite</tt><tt class="py-op">.</tt><tt class="py-name">addTests</tt><tt class="py-op">(</tt><tt class="py-op">[</tt><tt class="py-name">unittest</tt><tt class="py-op">.</tt><tt class="py-name">makeSuite</tt><tt class="py-op">(</tt><tt id="link-460" class="py-name" targets="Class lxml.tests.test_xpathevaluator.ETreeETXPathClassTestCase=lxml.tests.test_xpathevaluator.ETreeETXPathClassTestCase-class.html"><a title="lxml.tests.test_xpathevaluator.ETreeETXPathClassTestCase" class="py-name" href="#" onclick="return doclink('link-460', 'ETreeETXPathClassTestCase', 'link-460');">ETreeETXPathClassTestCase</a></tt><tt class="py-op">)</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
2534 <a name="L743"></a><tt class="py-lineno">743</tt> <tt class="py-line"> <tt class="py-name">suite</tt><tt class="py-op">.</tt><tt class="py-name">addTests</tt><tt class="py-op">(</tt><tt class="py-op">[</tt><tt class="py-name">doctest</tt><tt class="py-op">.</tt><tt class="py-name">DocTestSuite</tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
2535 <a name="L744"></a><tt class="py-lineno">744</tt> <tt class="py-line"> <tt class="py-name">suite</tt><tt class="py-op">.</tt><tt class="py-name">addTests</tt><tt class="py-op">(</tt> </tt>
2536 <a name="L745"></a><tt class="py-lineno">745</tt> <tt class="py-line"> <tt class="py-op">[</tt><tt id="link-461" class="py-name"><a title="lxml.tests.common_imports.make_doctest" class="py-name" href="#" onclick="return doclink('link-461', 'make_doctest', 'link-13');">make_doctest</a></tt><tt class="py-op">(</tt><tt class="py-string">'../../../doc/xpathxslt.txt'</tt><tt class="py-op">)</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
2537 <a name="L746"></a><tt class="py-lineno">746</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">suite</tt> </tt>
2538 </div><a name="L747"></a><tt class="py-lineno">747</tt> <tt class="py-line"> </tt>
2539 <a name="L748"></a><tt class="py-lineno">748</tt> <tt class="py-line"><tt class="py-keyword">if</tt> <tt class="py-name">__name__</tt> <tt class="py-op">==</tt> <tt class="py-string">'__main__'</tt><tt class="py-op">:</tt> </tt>
2540 <a name="L749"></a><tt class="py-lineno">749</tt> <tt class="py-line"> <tt class="py-keyword">print</tt><tt class="py-op">(</tt><tt class="py-string">'to test use test.py %s'</tt> <tt class="py-op">%</tt> <tt class="py-name">__file__</tt><tt class="py-op">)</tt> </tt>
2541 <a name="L750"></a><tt class="py-lineno">750</tt> <tt class="py-line"> </tt><script type="text/javascript">
2543 expandto(location.href);
2548 <!-- ==================== NAVIGATION BAR ==================== -->
2549 <table class="navbar" border="0" width="100%" cellpadding="0"
2550 bgcolor="#a0c0ff" cellspacing="0">
2551 <tr valign="middle">
2553 <th> <a
2554 href="lxml-module.html">Home</a> </th>
2557 <th> <a
2558 href="module-tree.html">Trees</a> </th>
2561 <th> <a
2562 href="identifier-index.html">Indices</a> </th>
2565 <th> <a
2566 href="help.html">Help</a> </th>
2568 <!-- Project homepage -->
2569 <th class="navbar" align="right" width="100%">
2570 <table border="0" cellpadding="0" cellspacing="0">
2571 <tr><th class="navbar" align="center"
2572 ><a class="navbar" target="_top" href="/">lxml API</a></th>
2576 <table border="0" cellpadding="0" cellspacing="0" width="100%%">
2578 <td align="left" class="footer">
2579 Generated by Epydoc 3.0.1 on Tue Jul 31 10:14:23 2012
2581 <td align="right" class="footer">
2582 <a target="mainFrame" href="http://epydoc.sourceforge.net"
2583 >http://epydoc.sourceforge.net</a>
2588 <script type="text/javascript">
2590 // Private objects are initially displayed (because if
2591 // javascript is turned off then we want them to be
2592 // visible); but by default, we want to hide them. So hide
2593 // them unless we have a cookie that says to show them.