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>xml.etree.ElementTree.Element</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">
53 <table cellpadding="0" cellspacing="0">
54 <!-- hide/show private -->
55 <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
56 onclick="toggle_private();">hide private</a>]</span></td></tr>
57 <tr><td align="right"><span class="options"
58 >[<a href="frames.html" target="_top">frames</a
59 >] | <a href="xml.etree.ElementTree.Element-class.html"
60 target="_top">no frames</a>]</span></td></tr>
65 <!-- ==================== CLASS DESCRIPTION ==================== -->
66 <h1 class="epydoc">Class Element</h1><p class="nomargin-top"><span class="codelink"><a href="xml.etree.ElementTree-pysrc.html#Element">source code</a></span></p>
67 <pre class="base-tree">
70 <strong class="uidshort">Element</strong>
74 <!-- ==================== INSTANCE METHODS ==================== -->
75 <a name="section-InstanceMethods"></a>
76 <table class="summary" border="1" cellpadding="3"
77 cellspacing="0" width="100%" bgcolor="white">
78 <tr bgcolor="#70b0f0" class="table-header">
79 <td colspan="2" class="table-header">
80 <table border="0" cellpadding="0" cellspacing="0" width="100%">
82 <td align="left"><span class="table-header">Instance Methods</span></td>
83 <td align="right" valign="top"
84 ><span class="options">[<a href="#section-InstanceMethods"
85 class="privatelink" onclick="toggle_private();"
86 >hide private</a>]</span></td>
92 <td width="15%" align="right" valign="top" class="summary">
93 <span class="summary-type"> </span>
94 </td><td class="summary">
95 <table width="100%" cellpadding="0" cellspacing="0" border="0">
97 <td><span class="summary-sig"><a name="__delitem__"></a><span class="summary-sig-name">__delitem__</span>(<span class="summary-sig-arg">self</span>,
98 <span class="summary-sig-arg">index</span>)</span></td>
99 <td align="right" valign="top">
100 <span class="codelink"><a href="xml.etree.ElementTree-pysrc.html#Element.__delitem__">source code</a></span>
109 <td width="15%" align="right" valign="top" class="summary">
110 <span class="summary-type"> </span>
111 </td><td class="summary">
112 <table width="100%" cellpadding="0" cellspacing="0" border="0">
114 <td><span class="summary-sig"><a name="__getitem__"></a><span class="summary-sig-name">__getitem__</span>(<span class="summary-sig-arg">self</span>,
115 <span class="summary-sig-arg">index</span>)</span></td>
116 <td align="right" valign="top">
117 <span class="codelink"><a href="xml.etree.ElementTree-pysrc.html#Element.__getitem__">source code</a></span>
126 <td width="15%" align="right" valign="top" class="summary">
127 <span class="summary-type"> </span>
128 </td><td class="summary">
129 <table width="100%" cellpadding="0" cellspacing="0" border="0">
131 <td><span class="summary-sig"><a href="xml.etree.ElementTree.Element-class.html#__init__" class="summary-sig-name">__init__</a>(<span class="summary-sig-arg">self</span>,
132 <span class="summary-sig-arg">tag</span>,
133 <span class="summary-sig-arg">attrib</span>=<span class="summary-sig-default"><code class="variable-group">{</code><code class="variable-group">}</code></span>,
134 <span class="summary-sig-arg">**extra</span>)</span><br />
135 x.__init__(...) initializes x; see help(type(x)) for signature</td>
136 <td align="right" valign="top">
137 <span class="codelink"><a href="xml.etree.ElementTree-pysrc.html#Element.__init__">source code</a></span>
146 <td width="15%" align="right" valign="top" class="summary">
147 <span class="summary-type"> </span>
148 </td><td class="summary">
149 <table width="100%" cellpadding="0" cellspacing="0" border="0">
151 <td><span class="summary-sig"><a name="__len__"></a><span class="summary-sig-name">__len__</span>(<span class="summary-sig-arg">self</span>)</span></td>
152 <td align="right" valign="top">
153 <span class="codelink"><a href="xml.etree.ElementTree-pysrc.html#Element.__len__">source code</a></span>
162 <td width="15%" align="right" valign="top" class="summary">
163 <span class="summary-type"> </span>
164 </td><td class="summary">
165 <table width="100%" cellpadding="0" cellspacing="0" border="0">
167 <td><span class="summary-sig"><a name="__nonzero__"></a><span class="summary-sig-name">__nonzero__</span>(<span class="summary-sig-arg">self</span>)</span></td>
168 <td align="right" valign="top">
169 <span class="codelink"><a href="xml.etree.ElementTree-pysrc.html#Element.__nonzero__">source code</a></span>
178 <td width="15%" align="right" valign="top" class="summary">
179 <span class="summary-type"> </span>
180 </td><td class="summary">
181 <table width="100%" cellpadding="0" cellspacing="0" border="0">
183 <td><span class="summary-sig"><a href="xml.etree.ElementTree.Element-class.html#__repr__" class="summary-sig-name">__repr__</a>(<span class="summary-sig-arg">self</span>)</span><br />
185 <td align="right" valign="top">
186 <span class="codelink"><a href="xml.etree.ElementTree-pysrc.html#Element.__repr__">source code</a></span>
195 <td width="15%" align="right" valign="top" class="summary">
196 <span class="summary-type"> </span>
197 </td><td class="summary">
198 <table width="100%" cellpadding="0" cellspacing="0" border="0">
200 <td><span class="summary-sig"><a name="__setitem__"></a><span class="summary-sig-name">__setitem__</span>(<span class="summary-sig-arg">self</span>,
201 <span class="summary-sig-arg">index</span>,
202 <span class="summary-sig-arg">element</span>)</span></td>
203 <td align="right" valign="top">
204 <span class="codelink"><a href="xml.etree.ElementTree-pysrc.html#Element.__setitem__">source code</a></span>
213 <td width="15%" align="right" valign="top" class="summary">
214 <span class="summary-type"> </span>
215 </td><td class="summary">
216 <table width="100%" cellpadding="0" cellspacing="0" border="0">
218 <td><span class="summary-sig"><a name="append"></a><span class="summary-sig-name">append</span>(<span class="summary-sig-arg">self</span>,
219 <span class="summary-sig-arg">element</span>)</span></td>
220 <td align="right" valign="top">
221 <span class="codelink"><a href="xml.etree.ElementTree-pysrc.html#Element.append">source code</a></span>
230 <td width="15%" align="right" valign="top" class="summary">
231 <span class="summary-type"> </span>
232 </td><td class="summary">
233 <table width="100%" cellpadding="0" cellspacing="0" border="0">
235 <td><span class="summary-sig"><a name="clear"></a><span class="summary-sig-name">clear</span>(<span class="summary-sig-arg">self</span>)</span></td>
236 <td align="right" valign="top">
237 <span class="codelink"><a href="xml.etree.ElementTree-pysrc.html#Element.clear">source code</a></span>
246 <td width="15%" align="right" valign="top" class="summary">
247 <span class="summary-type"> </span>
248 </td><td class="summary">
249 <table width="100%" cellpadding="0" cellspacing="0" border="0">
251 <td><span class="summary-sig"><a name="copy"></a><span class="summary-sig-name">copy</span>(<span class="summary-sig-arg">self</span>)</span></td>
252 <td align="right" valign="top">
253 <span class="codelink"><a href="xml.etree.ElementTree-pysrc.html#Element.copy">source code</a></span>
262 <td width="15%" align="right" valign="top" class="summary">
263 <span class="summary-type"> </span>
264 </td><td class="summary">
265 <table width="100%" cellpadding="0" cellspacing="0" border="0">
267 <td><span class="summary-sig"><a name="extend"></a><span class="summary-sig-name">extend</span>(<span class="summary-sig-arg">self</span>,
268 <span class="summary-sig-arg">elements</span>)</span></td>
269 <td align="right" valign="top">
270 <span class="codelink"><a href="xml.etree.ElementTree-pysrc.html#Element.extend">source code</a></span>
279 <td width="15%" align="right" valign="top" class="summary">
280 <span class="summary-type"> </span>
281 </td><td class="summary">
282 <table width="100%" cellpadding="0" cellspacing="0" border="0">
284 <td><span class="summary-sig"><a name="find"></a><span class="summary-sig-name">find</span>(<span class="summary-sig-arg">self</span>,
285 <span class="summary-sig-arg">path</span>,
286 <span class="summary-sig-arg">namespaces</span>=<span class="summary-sig-default">None</span>)</span></td>
287 <td align="right" valign="top">
288 <span class="codelink"><a href="xml.etree.ElementTree-pysrc.html#Element.find">source code</a></span>
297 <td width="15%" align="right" valign="top" class="summary">
298 <span class="summary-type"> </span>
299 </td><td class="summary">
300 <table width="100%" cellpadding="0" cellspacing="0" border="0">
302 <td><span class="summary-sig"><a name="findall"></a><span class="summary-sig-name">findall</span>(<span class="summary-sig-arg">self</span>,
303 <span class="summary-sig-arg">path</span>,
304 <span class="summary-sig-arg">namespaces</span>=<span class="summary-sig-default">None</span>)</span></td>
305 <td align="right" valign="top">
306 <span class="codelink"><a href="xml.etree.ElementTree-pysrc.html#Element.findall">source code</a></span>
315 <td width="15%" align="right" valign="top" class="summary">
316 <span class="summary-type"> </span>
317 </td><td class="summary">
318 <table width="100%" cellpadding="0" cellspacing="0" border="0">
320 <td><span class="summary-sig"><a name="findtext"></a><span class="summary-sig-name">findtext</span>(<span class="summary-sig-arg">self</span>,
321 <span class="summary-sig-arg">path</span>,
322 <span class="summary-sig-arg">default</span>=<span class="summary-sig-default">None</span>,
323 <span class="summary-sig-arg">namespaces</span>=<span class="summary-sig-default">None</span>)</span></td>
324 <td align="right" valign="top">
325 <span class="codelink"><a href="xml.etree.ElementTree-pysrc.html#Element.findtext">source code</a></span>
334 <td width="15%" align="right" valign="top" class="summary">
335 <span class="summary-type"> </span>
336 </td><td class="summary">
337 <table width="100%" cellpadding="0" cellspacing="0" border="0">
339 <td><span class="summary-sig"><a name="get"></a><span class="summary-sig-name">get</span>(<span class="summary-sig-arg">self</span>,
340 <span class="summary-sig-arg">key</span>,
341 <span class="summary-sig-arg">default</span>=<span class="summary-sig-default">None</span>)</span></td>
342 <td align="right" valign="top">
343 <span class="codelink"><a href="xml.etree.ElementTree-pysrc.html#Element.get">source code</a></span>
352 <td width="15%" align="right" valign="top" class="summary">
353 <span class="summary-type"> </span>
354 </td><td class="summary">
355 <table width="100%" cellpadding="0" cellspacing="0" border="0">
357 <td><span class="summary-sig"><a name="getchildren"></a><span class="summary-sig-name">getchildren</span>(<span class="summary-sig-arg">self</span>)</span></td>
358 <td align="right" valign="top">
359 <span class="codelink"><a href="xml.etree.ElementTree-pysrc.html#Element.getchildren">source code</a></span>
368 <td width="15%" align="right" valign="top" class="summary">
369 <span class="summary-type"> </span>
370 </td><td class="summary">
371 <table width="100%" cellpadding="0" cellspacing="0" border="0">
373 <td><span class="summary-sig"><a name="getiterator"></a><span class="summary-sig-name">getiterator</span>(<span class="summary-sig-arg">self</span>,
374 <span class="summary-sig-arg">tag</span>=<span class="summary-sig-default">None</span>)</span></td>
375 <td align="right" valign="top">
376 <span class="codelink"><a href="xml.etree.ElementTree-pysrc.html#Element.getiterator">source code</a></span>
385 <td width="15%" align="right" valign="top" class="summary">
386 <span class="summary-type"> </span>
387 </td><td class="summary">
388 <table width="100%" cellpadding="0" cellspacing="0" border="0">
390 <td><span class="summary-sig"><a name="insert"></a><span class="summary-sig-name">insert</span>(<span class="summary-sig-arg">self</span>,
391 <span class="summary-sig-arg">index</span>,
392 <span class="summary-sig-arg">element</span>)</span></td>
393 <td align="right" valign="top">
394 <span class="codelink"><a href="xml.etree.ElementTree-pysrc.html#Element.insert">source code</a></span>
403 <td width="15%" align="right" valign="top" class="summary">
404 <span class="summary-type"> </span>
405 </td><td class="summary">
406 <table width="100%" cellpadding="0" cellspacing="0" border="0">
408 <td><span class="summary-sig"><a name="items"></a><span class="summary-sig-name">items</span>(<span class="summary-sig-arg">self</span>)</span></td>
409 <td align="right" valign="top">
410 <span class="codelink"><a href="xml.etree.ElementTree-pysrc.html#Element.items">source code</a></span>
419 <td width="15%" align="right" valign="top" class="summary">
420 <span class="summary-type"> </span>
421 </td><td class="summary">
422 <table width="100%" cellpadding="0" cellspacing="0" border="0">
424 <td><span class="summary-sig"><a name="iter"></a><span class="summary-sig-name">iter</span>(<span class="summary-sig-arg">self</span>,
425 <span class="summary-sig-arg">tag</span>=<span class="summary-sig-default">None</span>)</span></td>
426 <td align="right" valign="top">
427 <span class="codelink"><a href="xml.etree.ElementTree-pysrc.html#Element.iter">source code</a></span>
436 <td width="15%" align="right" valign="top" class="summary">
437 <span class="summary-type"> </span>
438 </td><td class="summary">
439 <table width="100%" cellpadding="0" cellspacing="0" border="0">
441 <td><span class="summary-sig"><a name="iterfind"></a><span class="summary-sig-name">iterfind</span>(<span class="summary-sig-arg">self</span>,
442 <span class="summary-sig-arg">path</span>,
443 <span class="summary-sig-arg">namespaces</span>=<span class="summary-sig-default">None</span>)</span></td>
444 <td align="right" valign="top">
445 <span class="codelink"><a href="xml.etree.ElementTree-pysrc.html#Element.iterfind">source code</a></span>
454 <td width="15%" align="right" valign="top" class="summary">
455 <span class="summary-type"> </span>
456 </td><td class="summary">
457 <table width="100%" cellpadding="0" cellspacing="0" border="0">
459 <td><span class="summary-sig"><a name="itertext"></a><span class="summary-sig-name">itertext</span>(<span class="summary-sig-arg">self</span>)</span></td>
460 <td align="right" valign="top">
461 <span class="codelink"><a href="xml.etree.ElementTree-pysrc.html#Element.itertext">source code</a></span>
470 <td width="15%" align="right" valign="top" class="summary">
471 <span class="summary-type"> </span>
472 </td><td class="summary">
473 <table width="100%" cellpadding="0" cellspacing="0" border="0">
475 <td><span class="summary-sig"><a name="keys"></a><span class="summary-sig-name">keys</span>(<span class="summary-sig-arg">self</span>)</span></td>
476 <td align="right" valign="top">
477 <span class="codelink"><a href="xml.etree.ElementTree-pysrc.html#Element.keys">source code</a></span>
486 <td width="15%" align="right" valign="top" class="summary">
487 <span class="summary-type"> </span>
488 </td><td class="summary">
489 <table width="100%" cellpadding="0" cellspacing="0" border="0">
491 <td><span class="summary-sig"><a name="makeelement"></a><span class="summary-sig-name">makeelement</span>(<span class="summary-sig-arg">self</span>,
492 <span class="summary-sig-arg">tag</span>,
493 <span class="summary-sig-arg">attrib</span>)</span></td>
494 <td align="right" valign="top">
495 <span class="codelink"><a href="xml.etree.ElementTree-pysrc.html#Element.makeelement">source code</a></span>
504 <td width="15%" align="right" valign="top" class="summary">
505 <span class="summary-type"> </span>
506 </td><td class="summary">
507 <table width="100%" cellpadding="0" cellspacing="0" border="0">
509 <td><span class="summary-sig"><a name="remove"></a><span class="summary-sig-name">remove</span>(<span class="summary-sig-arg">self</span>,
510 <span class="summary-sig-arg">element</span>)</span></td>
511 <td align="right" valign="top">
512 <span class="codelink"><a href="xml.etree.ElementTree-pysrc.html#Element.remove">source code</a></span>
521 <td width="15%" align="right" valign="top" class="summary">
522 <span class="summary-type"> </span>
523 </td><td class="summary">
524 <table width="100%" cellpadding="0" cellspacing="0" border="0">
526 <td><span class="summary-sig"><a name="set"></a><span class="summary-sig-name">set</span>(<span class="summary-sig-arg">self</span>,
527 <span class="summary-sig-arg">key</span>,
528 <span class="summary-sig-arg">value</span>)</span></td>
529 <td align="right" valign="top">
530 <span class="codelink"><a href="xml.etree.ElementTree-pysrc.html#Element.set">source code</a></span>
539 <td colspan="2" class="summary">
540 <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>:
541 <code>__delattr__</code>,
542 <code>__format__</code>,
543 <code>__getattribute__</code>,
544 <code>__hash__</code>,
545 <code>__new__</code>,
546 <code>__reduce__</code>,
547 <code>__reduce_ex__</code>,
548 <code>__setattr__</code>,
549 <code>__sizeof__</code>,
550 <code>__str__</code>,
551 <code>__subclasshook__</code>
556 <!-- ==================== CLASS VARIABLES ==================== -->
557 <a name="section-ClassVariables"></a>
558 <table class="summary" border="1" cellpadding="3"
559 cellspacing="0" width="100%" bgcolor="white">
560 <tr bgcolor="#70b0f0" class="table-header">
561 <td colspan="2" class="table-header">
562 <table border="0" cellpadding="0" cellspacing="0" width="100%">
564 <td align="left"><span class="table-header">Class Variables</span></td>
565 <td align="right" valign="top"
566 ><span class="options">[<a href="#section-ClassVariables"
567 class="privatelink" onclick="toggle_private();"
568 >hide private</a>]</span></td>
574 <td width="15%" align="right" valign="top" class="summary">
575 <span class="summary-type"> </span>
576 </td><td class="summary">
577 <a name="attrib"></a><span class="summary-name">attrib</span> = <code title="None">None</code><br />
582 <td width="15%" align="right" valign="top" class="summary">
583 <span class="summary-type"> </span>
584 </td><td class="summary">
585 <a name="tag"></a><span class="summary-name">tag</span> = <code title="None">None</code><br />
590 <td width="15%" align="right" valign="top" class="summary">
591 <span class="summary-type"> </span>
592 </td><td class="summary">
593 <a name="tail"></a><span class="summary-name">tail</span> = <code title="None">None</code><br />
598 <td width="15%" align="right" valign="top" class="summary">
599 <span class="summary-type"> </span>
600 </td><td class="summary">
601 <a name="text"></a><span class="summary-name">text</span> = <code title="None">None</code><br />
606 <!-- ==================== PROPERTIES ==================== -->
607 <a name="section-Properties"></a>
608 <table class="summary" border="1" cellpadding="3"
609 cellspacing="0" width="100%" bgcolor="white">
610 <tr bgcolor="#70b0f0" class="table-header">
611 <td colspan="2" class="table-header">
612 <table border="0" cellpadding="0" cellspacing="0" width="100%">
614 <td align="left"><span class="table-header">Properties</span></td>
615 <td align="right" valign="top"
616 ><span class="options">[<a href="#section-Properties"
617 class="privatelink" onclick="toggle_private();"
618 >hide private</a>]</span></td>
624 <td colspan="2" class="summary">
625 <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>:
626 <code>__class__</code>
631 <!-- ==================== METHOD DETAILS ==================== -->
632 <a name="section-MethodDetails"></a>
633 <table class="details" border="1" cellpadding="3"
634 cellspacing="0" width="100%" bgcolor="white">
635 <tr bgcolor="#70b0f0" class="table-header">
636 <td colspan="2" class="table-header">
637 <table border="0" cellpadding="0" cellspacing="0" width="100%">
639 <td align="left"><span class="table-header">Method Details</span></td>
640 <td align="right" valign="top"
641 ><span class="options">[<a href="#section-MethodDetails"
642 class="privatelink" onclick="toggle_private();"
643 >hide private</a>]</span></td>
649 <a name="__init__"></a>
651 <table class="details" border="1" cellpadding="3"
652 cellspacing="0" width="100%" bgcolor="white">
654 <table width="100%" cellpadding="0" cellspacing="0" border="0">
655 <tr valign="top"><td>
656 <h3 class="epydoc"><span class="sig"><span class="sig-name">__init__</span>(<span class="sig-arg">self</span>,
657 <span class="sig-arg">tag</span>,
658 <span class="sig-arg">attrib</span>=<span class="sig-default"><code class="variable-group">{</code><code class="variable-group">}</code></span>,
659 <span class="sig-arg">**extra</span>)</span>
660 <br /><em class="fname">(Constructor)</em>
662 </td><td align="right" valign="top"
663 ><span class="codelink"><a href="xml.etree.ElementTree-pysrc.html#Element.__init__">source code</a></span>
667 x.__init__(...) initializes x; see help(type(x)) for signature
671 <dd><em class="note">(inherited documentation)</em></dd>
676 <a name="__repr__"></a>
678 <table class="details" border="1" cellpadding="3"
679 cellspacing="0" width="100%" bgcolor="white">
681 <table width="100%" cellpadding="0" cellspacing="0" border="0">
682 <tr valign="top"><td>
683 <h3 class="epydoc"><span class="sig"><span class="sig-name">__repr__</span>(<span class="sig-arg">self</span>)</span>
684 <br /><em class="fname">(Representation operator)</em>
686 </td><td align="right" valign="top"
687 ><span class="codelink"><a href="xml.etree.ElementTree-pysrc.html#Element.__repr__">source code</a></span>
695 <dd><em class="note">(inherited documentation)</em></dd>
701 <!-- ==================== NAVIGATION BAR ==================== -->
702 <table class="navbar" border="0" width="100%" cellpadding="0"
703 bgcolor="#a0c0ff" cellspacing="0">
706 <th> <a
707 href="lxml-module.html">Home</a> </th>
710 <th> <a
711 href="module-tree.html">Trees</a> </th>
714 <th> <a
715 href="identifier-index.html">Indices</a> </th>
718 <th> <a
719 href="help.html">Help</a> </th>
721 <!-- Project homepage -->
722 <th class="navbar" align="right" width="100%">
723 <table border="0" cellpadding="0" cellspacing="0">
724 <tr><th class="navbar" align="center"
725 ><a class="navbar" target="_top" href="/">lxml API</a></th>
729 <table border="0" cellpadding="0" cellspacing="0" width="100%%">
731 <td align="left" class="footer">
732 Generated by Epydoc 3.0.1
733 on Thu Jul 9 18:29:53 2020
735 <td align="right" class="footer">
736 <a target="mainFrame" href="http://epydoc.sourceforge.net"
737 >http://epydoc.sourceforge.net</a>
742 <script type="text/javascript">
744 // Private objects are initially displayed (because if
745 // javascript is turned off then we want them to be
746 // visible); but by default, we want to hide them. So hide
747 // them unless we have a cookie that says to show them.