00c96876e33c9bcf5a6185ff9013701cf30acd39
[platform/upstream/python-lxml.git] / doc / html / api / lxml.etree.XPathElementEvaluator-class.html
1 <?xml version="1.0" encoding="ascii"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
3           "DTD/xhtml1-transitional.dtd">
4 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5 <head>
6   <title>lxml.etree.XPathElementEvaluator</title>
7   <link rel="stylesheet" href="epydoc.css" type="text/css" />
8   <script type="text/javascript" src="epydoc.js"></script>
9 </head>
10
11 <body bgcolor="white" text="black" link="blue" vlink="#204080"
12       alink="#204080">
13 <!-- ==================== NAVIGATION BAR ==================== -->
14 <table class="navbar" border="0" width="100%" cellpadding="0"
15        bgcolor="#a0c0ff" cellspacing="0">
16   <tr valign="middle">
17   <!-- Home link -->
18       <th>&nbsp;&nbsp;&nbsp;<a
19         href="lxml-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>
20
21   <!-- Tree link -->
22       <th>&nbsp;&nbsp;&nbsp;<a
23         href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
24
25   <!-- Index link -->
26       <th>&nbsp;&nbsp;&nbsp;<a
27         href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>
28
29   <!-- Help link -->
30       <th>&nbsp;&nbsp;&nbsp;<a
31         href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
32
33   <!-- Project homepage -->
34       <th class="navbar" align="right" width="100%">
35         <table border="0" cellpadding="0" cellspacing="0">
36           <tr><th class="navbar" align="center"
37             ><a class="navbar" target="_top" href="/">lxml API</a></th>
38           </tr></table></th>
39   </tr>
40 </table>
41 <table width="100%" cellpadding="0" cellspacing="0">
42   <tr valign="top">
43     <td width="100%">
44       <span class="breadcrumbs">
45         <a href="lxml-module.html">Package&nbsp;lxml</a> ::
46         <a href="lxml.etree-module.html">Module&nbsp;etree</a> ::
47         Class&nbsp;XPathElementEvaluator
48       </span>
49     </td>
50     <td>
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&nbsp;private</a>]</span></td></tr>
55         <tr><td align="right"><span class="options"
56             >[<a href="frames.html" target="_top">frames</a
57             >]&nbsp;|&nbsp;<a href="lxml.etree.XPathElementEvaluator-class.html"
58             target="_top">no&nbsp;frames</a>]</span></td></tr>
59       </table>
60     </td>
61   </tr>
62 </table>
63 <!-- ==================== CLASS DESCRIPTION ==================== -->
64 <h1 class="epydoc">Class XPathElementEvaluator</h1><p class="nomargin-top"></p>
65 <pre class="base-tree">
66          object --+    
67                   |    
68 <a href="lxml.etree._XPathEvaluatorBase-class.html" onclick="show_private();">_XPathEvaluatorBase</a> --+
69                       |
70                      <strong class="uidshort">XPathElementEvaluator</strong>
71 </pre>
72
73 <dl><dt>Known Subclasses:</dt>
74 <dd>
75       <ul class="subclass-list">
76 <li><a href="lxml.etree.XPathDocumentEvaluator-class.html">XPathDocumentEvaluator</a></li>  </ul>
77 </dd></dl>
78
79 <hr />
80 <p>XPathElementEvaluator(self, element, namespaces=None, extensions=None, regexp=True, smart_strings=True)
81 Create an XPath evaluator for an element.</p>
82 <p>Absolute XPath expressions (starting with '/') will be evaluated against
83 the ElementTree as returned by getroottree().</p>
84 <p>Additional namespace declarations can be passed with the
85 'namespace' keyword argument.  EXSLT regular expression support
86 can be disabled with the 'regexp' boolean keyword (defaults to
87 True).  Smart strings will be returned for string results unless
88 you pass <tt class="rst-docutils literal">smart_strings=False</tt>.</p>
89
90 <!-- ==================== INSTANCE METHODS ==================== -->
91 <a name="section-InstanceMethods"></a>
92 <table class="summary" border="1" cellpadding="3"
93        cellspacing="0" width="100%" bgcolor="white">
94 <tr bgcolor="#70b0f0" class="table-header">
95   <td colspan="2" class="table-header">
96     <table border="0" cellpadding="0" cellspacing="0" width="100%">
97       <tr valign="top">
98         <td align="left"><span class="table-header">Instance Methods</span></td>
99         <td align="right" valign="top"
100          ><span class="options">[<a href="#section-InstanceMethods"
101          class="privatelink" onclick="toggle_private();"
102          >hide private</a>]</span></td>
103       </tr>
104     </table>
105   </td>
106 </tr>
107 <tr>
108     <td width="15%" align="right" valign="top" class="summary">
109       <span class="summary-type">&nbsp;</span>
110     </td><td class="summary">
111       <table width="100%" cellpadding="0" cellspacing="0" border="0">
112         <tr>
113           <td><span class="summary-sig"><a href="lxml.etree.XPathElementEvaluator-class.html#__call__" class="summary-sig-name">__call__</a>(<span class="summary-sig-arg">self</span>,
114         <span class="summary-sig-arg">_path</span>,
115         <span class="summary-sig-arg">**_variables</span>)</span><br />
116       Evaluate an XPath expression on the document.</td>
117           <td align="right" valign="top">
118             
119             
120           </td>
121         </tr>
122       </table>
123       
124     </td>
125   </tr>
126 <tr>
127     <td width="15%" align="right" valign="top" class="summary">
128       <span class="summary-type">&nbsp;</span>
129     </td><td class="summary">
130       <table width="100%" cellpadding="0" cellspacing="0" border="0">
131         <tr>
132           <td><span class="summary-sig"><a href="lxml.etree.XPathElementEvaluator-class.html#__init__" class="summary-sig-name">__init__</a>(<span class="summary-sig-arg">self</span>,
133         <span class="summary-sig-arg">element</span>,
134         <span class="summary-sig-arg">namespaces</span>=<span class="summary-sig-default">None</span>,
135         <span class="summary-sig-arg">extensions</span>=<span class="summary-sig-default">None</span>,
136         <span class="summary-sig-arg">regexp</span>=<span class="summary-sig-default">True</span>,
137         <span class="summary-sig-arg">smart_strings</span>=<span class="summary-sig-default">True</span>)</span><br />
138       x.__init__(...) initializes x; see help(type(x)) for signature</td>
139           <td align="right" valign="top">
140             
141             
142           </td>
143         </tr>
144       </table>
145       
146     </td>
147   </tr>
148 <tr>
149     <td width="15%" align="right" valign="top" class="summary">
150       <span class="summary-type">a new object with type S, a subtype of T</span>
151     </td><td class="summary">
152       <table width="100%" cellpadding="0" cellspacing="0" border="0">
153         <tr>
154           <td><span class="summary-sig"><a href="lxml.etree.XPathElementEvaluator-class.html#__new__" class="summary-sig-name">__new__</a>(<span class="summary-sig-arg">T</span>,
155         <span class="summary-sig-arg">S</span>,
156         <span class="summary-sig-arg">...</span>)</span></td>
157           <td align="right" valign="top">
158             
159             
160           </td>
161         </tr>
162       </table>
163       
164     </td>
165   </tr>
166 <tr>
167     <td width="15%" align="right" valign="top" class="summary">
168       <span class="summary-type">&nbsp;</span>
169     </td><td class="summary">
170       <table width="100%" cellpadding="0" cellspacing="0" border="0">
171         <tr>
172           <td><span class="summary-sig"><a name="register_namespace"></a><span class="summary-sig-name">register_namespace</span>(<span class="summary-sig-arg">...</span>)</span><br />
173       Register a namespace with the XPath context.</td>
174           <td align="right" valign="top">
175             
176             
177           </td>
178         </tr>
179       </table>
180       
181     </td>
182   </tr>
183 <tr>
184     <td width="15%" align="right" valign="top" class="summary">
185       <span class="summary-type">&nbsp;</span>
186     </td><td class="summary">
187       <table width="100%" cellpadding="0" cellspacing="0" border="0">
188         <tr>
189           <td><span class="summary-sig"><a name="register_namespaces"></a><span class="summary-sig-name">register_namespaces</span>(<span class="summary-sig-arg">...</span>)</span><br />
190       Register a prefix -&gt; uri dict.</td>
191           <td align="right" valign="top">
192             
193             
194           </td>
195         </tr>
196       </table>
197       
198     </td>
199   </tr>
200   <tr>
201     <td colspan="2" class="summary">
202     <p class="indent-wrapped-lines"><b>Inherited from <code><a href="lxml.etree._XPathEvaluatorBase-class.html" onclick="show_private();">_XPathEvaluatorBase</a></code></b>:
203       <code><a href="lxml.etree._XPathEvaluatorBase-class.html#evaluate">evaluate</a></code>
204       </p>
205     <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>:
206       <code>__delattr__</code>,
207       <code>__format__</code>,
208       <code>__getattribute__</code>,
209       <code>__hash__</code>,
210       <code>__reduce__</code>,
211       <code>__reduce_ex__</code>,
212       <code>__repr__</code>,
213       <code>__setattr__</code>,
214       <code>__sizeof__</code>,
215       <code>__str__</code>,
216       <code>__subclasshook__</code>
217       </p>
218     </td>
219   </tr>
220 </table>
221 <!-- ==================== PROPERTIES ==================== -->
222 <a name="section-Properties"></a>
223 <table class="summary" border="1" cellpadding="3"
224        cellspacing="0" width="100%" bgcolor="white">
225 <tr bgcolor="#70b0f0" class="table-header">
226   <td colspan="2" class="table-header">
227     <table border="0" cellpadding="0" cellspacing="0" width="100%">
228       <tr valign="top">
229         <td align="left"><span class="table-header">Properties</span></td>
230         <td align="right" valign="top"
231          ><span class="options">[<a href="#section-Properties"
232          class="privatelink" onclick="toggle_private();"
233          >hide private</a>]</span></td>
234       </tr>
235     </table>
236   </td>
237 </tr>
238   <tr>
239     <td colspan="2" class="summary">
240     <p class="indent-wrapped-lines"><b>Inherited from <code><a href="lxml.etree._XPathEvaluatorBase-class.html" onclick="show_private();">_XPathEvaluatorBase</a></code></b>:
241       <code><a href="lxml.etree._XPathEvaluatorBase-class.html#error_log">error_log</a></code>
242       </p>
243     <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>:
244       <code>__class__</code>
245       </p>
246     </td>
247   </tr>
248 </table>
249 <!-- ==================== METHOD DETAILS ==================== -->
250 <a name="section-MethodDetails"></a>
251 <table class="details" border="1" cellpadding="3"
252        cellspacing="0" width="100%" bgcolor="white">
253 <tr bgcolor="#70b0f0" class="table-header">
254   <td colspan="2" class="table-header">
255     <table border="0" cellpadding="0" cellspacing="0" width="100%">
256       <tr valign="top">
257         <td align="left"><span class="table-header">Method Details</span></td>
258         <td align="right" valign="top"
259          ><span class="options">[<a href="#section-MethodDetails"
260          class="privatelink" onclick="toggle_private();"
261          >hide private</a>]</span></td>
262       </tr>
263     </table>
264   </td>
265 </tr>
266 </table>
267 <a name="__call__"></a>
268 <div>
269 <table class="details" border="1" cellpadding="3"
270        cellspacing="0" width="100%" bgcolor="white">
271 <tr><td>
272   <table width="100%" cellpadding="0" cellspacing="0" border="0">
273   <tr valign="top"><td>
274   <h3 class="epydoc"><span class="sig"><span class="sig-name">__call__</span>(<span class="sig-arg">self</span>,
275         <span class="sig-arg">_path</span>,
276         <span class="sig-arg">**_variables</span>)</span>
277     <br /><em class="fname">(Call operator)</em>
278   </h3>
279   </td><td align="right" valign="top"
280     >&nbsp;
281     </td>
282   </tr></table>
283   
284   <p>Evaluate an XPath expression on the document.</p>
285 <p>Variables may be provided as keyword arguments.  Note that namespaces
286 are currently not supported for variables.</p>
287 <p>Absolute XPath expressions (starting with '/') will be evaluated
288 against the ElementTree as returned by getroottree().</p>
289   <dl class="fields">
290   </dl>
291 </td></tr></table>
292 </div>
293 <a name="__init__"></a>
294 <div>
295 <table class="details" border="1" cellpadding="3"
296        cellspacing="0" width="100%" bgcolor="white">
297 <tr><td>
298   <table width="100%" cellpadding="0" cellspacing="0" border="0">
299   <tr valign="top"><td>
300   <h3 class="epydoc"><span class="sig"><span class="sig-name">__init__</span>(<span class="sig-arg">self</span>,
301         <span class="sig-arg">element</span>,
302         <span class="sig-arg">namespaces</span>=<span class="sig-default">None</span>,
303         <span class="sig-arg">extensions</span>=<span class="sig-default">None</span>,
304         <span class="sig-arg">regexp</span>=<span class="sig-default">True</span>,
305         <span class="sig-arg">smart_strings</span>=<span class="sig-default">True</span>)</span>
306     <br /><em class="fname">(Constructor)</em>
307   </h3>
308   </td><td align="right" valign="top"
309     >&nbsp;
310     </td>
311   </tr></table>
312   
313   x.__init__(...) initializes x; see help(type(x)) for signature
314   <dl class="fields">
315     <dt>Overrides:
316         object.__init__
317     </dt>
318   </dl>
319 </td></tr></table>
320 </div>
321 <a name="__new__"></a>
322 <div>
323 <table class="details" border="1" cellpadding="3"
324        cellspacing="0" width="100%" bgcolor="white">
325 <tr><td>
326   <table width="100%" cellpadding="0" cellspacing="0" border="0">
327   <tr valign="top"><td>
328   <h3 class="epydoc"><span class="sig"><span class="sig-name">__new__</span>(<span class="sig-arg">T</span>,
329         <span class="sig-arg">S</span>,
330         <span class="sig-arg">...</span>)</span>
331   </h3>
332   </td><td align="right" valign="top"
333     >&nbsp;
334     </td>
335   </tr></table>
336   
337   
338   <dl class="fields">
339     <dt>Returns: a new object with type S, a subtype of T</dt>
340     <dt>Overrides:
341         object.__new__
342     </dt>
343   </dl>
344 </td></tr></table>
345 </div>
346 <br />
347 <!-- ==================== NAVIGATION BAR ==================== -->
348 <table class="navbar" border="0" width="100%" cellpadding="0"
349        bgcolor="#a0c0ff" cellspacing="0">
350   <tr valign="middle">
351   <!-- Home link -->
352       <th>&nbsp;&nbsp;&nbsp;<a
353         href="lxml-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>
354
355   <!-- Tree link -->
356       <th>&nbsp;&nbsp;&nbsp;<a
357         href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
358
359   <!-- Index link -->
360       <th>&nbsp;&nbsp;&nbsp;<a
361         href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>
362
363   <!-- Help link -->
364       <th>&nbsp;&nbsp;&nbsp;<a
365         href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
366
367   <!-- Project homepage -->
368       <th class="navbar" align="right" width="100%">
369         <table border="0" cellpadding="0" cellspacing="0">
370           <tr><th class="navbar" align="center"
371             ><a class="navbar" target="_top" href="/">lxml API</a></th>
372           </tr></table></th>
373   </tr>
374 </table>
375 <table border="0" cellpadding="0" cellspacing="0" width="100%%">
376   <tr>
377     <td align="left" class="footer">
378     Generated by Epydoc 3.0.1
379     on Wed Jan 29 12:26:21 2020
380     </td>
381     <td align="right" class="footer">
382       <a target="mainFrame" href="http://epydoc.sourceforge.net"
383         >http://epydoc.sourceforge.net</a>
384     </td>
385   </tr>
386 </table>
387
388 <script type="text/javascript">
389   <!--
390   // Private objects are initially displayed (because if
391   // javascript is turned off then we want them to be
392   // visible); but by default, we want to hide them.  So hide
393   // them unless we have a cookie that says to show them.
394   checkCookie();
395   // -->
396 </script>
397 </body>
398 </html>