Stefan Behnel <stefan...@behnel.de> added the comment:
Coming back to this issue after a while, I think it's still a relevant problem in some use cases. However, it's not currently clear what an improved solution would look like. The fully qualified tag names in Clark notation are long, sure, but also extremely convenient in being explicit and fully self-contained. One thing I noticed is that the examples used in this and other reports usually employ the .find() methods. Maybe issues 28238 and 30485 can reduce the pain to an acceptable level? Regarding the specific proposals: > root.xmlns_at_root.append('{namespace}') This cannot work since searches from a child element would then not know about the prefix. Elements in ElementTree do not have a global tree state. > 2. Leave the abbreviation colon-separated prefix in front of the element tags > as they come in. Note that prefixes are only indirections. They do not have a meaning by themselves and multiple prefixes can (and often do) refer to the same namespace. Moving the prefix resolution from the parser to the users seems to make the situation worse instead of better. ---------- versions: +Python 3.8 -Python 3.6 _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue18304> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com