This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author scoder
Recipients Tim Chambers, brycenesbitt, eli.bendersky, jjmiller50, martin.panter, pocek, rhettinger, scoder
Date 2019-04-27.16:58:56
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1556384336.48.0.507570904269.issue18304@roundup.psfhosted.org>
In-reply-to
Content
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.
History
Date User Action Args
2019-04-27 16:58:56scodersetrecipients: + scoder, rhettinger, eli.bendersky, martin.panter, brycenesbitt, pocek, jjmiller50, Tim Chambers
2019-04-27 16:58:56scodersetmessageid: <1556384336.48.0.507570904269.issue18304@roundup.psfhosted.org>
2019-04-27 16:58:56scoderlinkissue18304 messages
2019-04-27 16:58:56scodercreate