Find all matching subelements by tag name or path. Same as getroot().iterfind(path), which is element.iterfind() *path* is a string having either an element tag or an XPath, *namespaces* is an optional mapping from namespace prefix to full name. Return an iterable
(self, path, namespaces=None)
| 663 | return self._root.findall(path, namespaces) |
| 664 | |
| 665 | def iterfind(self, path, namespaces=None): |
| 666 | """Find all matching subelements by tag name or path. |
| 667 | |
| 668 | Same as getroot().iterfind(path), which is element.iterfind() |
| 669 | |
| 670 | *path* is a string having either an element tag or an XPath, |
| 671 | *namespaces* is an optional mapping from namespace prefix to full name. |
| 672 | |
| 673 | Return an iterable yielding all matching elements in document order. |
| 674 | |
| 675 | """ |
| 676 | # assert self._root is not None |
| 677 | if path[:1] == "/": |
| 678 | path = "." + path |
| 679 | warnings.warn( |
| 680 | "This search is broken in 1.3 and earlier, and will be " |
| 681 | "fixed in a future version. If you rely on the current " |
| 682 | "behaviour, change it to %r" % path, |
| 683 | FutureWarning, stacklevel=2 |
| 684 | ) |
| 685 | return self._root.iterfind(path, namespaces) |
| 686 | |
| 687 | def write(self, file_or_filename, |
| 688 | encoding=None, |