Maarten ter Huurne <maar...@treewalker.org> added the comment:
I was working on what I thought would be an elegant solution to this problem: for non-qualified attributes, add the element's namespace before accessing the cache and strip the namespace prefix after accessing the cache if it's equal to the element's prefix. However, this approach doesn't work: even though non-qualified attributes will be processed like they are the element's namespace, they are considered to have no namespace. This means <ns:x a="1" ns:a="2"/> is considered valid XML, even though it effectively defines the same attribute twice. https://www.w3.org/TR/REC-xml-names/#uniqAttrs In my opinion the spec made a silly choice here, but that's probably not something that can fixed anymore. I haven't decided yet whether I'll make another attempt at fixing this issue. In any case, I hope this tale of caution benefits someone. ---------- nosy: +mthuurne _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue17088> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com