Find all nodes from an XML using cElementTree
Is there a way to find all nodes in a xml tree using cElementTree? The findall method works only for specified tags.
You can use XPath paths on the findall method:
The 1.2 release supports simple element location paths. In its simplest form, a location path is one or more tag names, separated by slashes (/).
You can also use an asterisk (*) instead of a tag name, to match all elements at that level. For example, */subtag returns all subtag grandchildren.
An empty tag (//) is used to search on all levels of the tree, beneath the current level. The empty tag must always be followed by a tag name or an asterisk.