How to access multiple declarations xmlnsin the root element of an XML tree? For instance:
import xml.etree.cElementTree as ET
data = """<root
xmlns:one="http://www.first.uri/here/"
xmlns:two="http://www.second.uri/here/">
...all other child elements here...
</root>"""
tree = ET.fromstring(data)
I want to get a dictionary like this, or at least some format to make it easier to get the URI and the corresponding tag
{'one':"http://www.first.uri/here/", 'two':"http://www.second.uri/here/"}
source
share