As I already suggested for lxml, you can use the QName class to process qualified names, e.g.
QName(some_element.tag).localname
Or even just
QName(some_element).localname
It appears that ElementTree doesn't support this. It lists the QName type as "opaque". However, it does provide a "text" attribute that contains the qualified tag name.
http://docs.python.org/2/library/xml.etree.elementtree.html#xml.etree.ElementTree.QName
Here is the corresponding documentation from lxml:
http://lxml.de/api/lxml.etree.QName-class.html
QName instances in lxml provide the properties "localname", "namespace" and "text". |