local tag name from xml.etree.ElementTree in python?

Viewed 640

Why is there no method in the ElementTree API for the local element tag name? I get the fully-qualified name from element.tag, as .e.g.

{urn:schemas-microsoft-com:asm.v1}dependentAssembly 

The helper class QName doesn't have such a method.

I end up with code like

fulltag.split('}')[-1]

and feel strongly I've missed something?

Searching for solutions, I invariably end up with the 'cousin' project lxml.etree, which DOES include .localname.

0 Answers
Related