Create tree iterator. The iterator loops over the element and all subelements in document order, returning all elements with a matching tag. If the tree structure is modified during iteration, new or removed elements may or may not be included. To get a stabl
(self, tag=None)
| 383 | return self.attrib.items() |
| 384 | |
| 385 | def iter(self, tag=None): |
| 386 | """Create tree iterator. |
| 387 | |
| 388 | The iterator loops over the element and all subelements in document |
| 389 | order, returning all elements with a matching tag. |
| 390 | |
| 391 | If the tree structure is modified during iteration, new or removed |
| 392 | elements may or may not be included. To get a stable set, use the |
| 393 | list() function on the iterator, and loop over the resulting list. |
| 394 | |
| 395 | *tag* is what tags to look for (default is to return all elements) |
| 396 | |
| 397 | Return an iterator containing all the matching elements. |
| 398 | |
| 399 | """ |
| 400 | if tag == "*": |
| 401 | tag = None |
| 402 | if tag is None or self.tag == tag: |
| 403 | yield self |
| 404 | for e in self._children: |
| 405 | yield from e.iter(tag) |
| 406 | |
| 407 | def itertext(self): |
| 408 | """Create text iterator. |
no outgoing calls
no test coverage detected