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.

classification
Title: minidom: wrong processing of xmlns attributes
Type: behavior Stage: resolved
Components: XML Versions: Python 3.7, Python 3.6, Python 2.7
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: porton
Priority: normal Keywords:

Created on 2018-08-01 13:32 by porton, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Messages (2)
msg322860 - (view) Author: Victor Porton (porton) Date: 2018-08-01 13:32
The below script prints

http://www.w3.org/2000/xmlns/
aa:aa

It should print

None
aa:aa

because xmlns:z is NOT an attribute of xmlns namespace.

~~~
import xml.dom.minidom

x = xml.dom.minidom.parseString("<x xmlns:z='aa:aa' z:q='1'/>")

for i in x.documentElement.attributes.values():
    print(i.namespaceURI)
~~~
msg324106 - (view) Author: Victor Porton (porton) Date: 2018-08-25 22:58
My bug report was wrong:

https://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core.html
In the DOM, all namespace declaration attributes are by definition bound to the namespace URI: "http://www.w3.org/2000/xmlns/". These are the attributes whose namespace prefix or qualified name is "xmlns" as introduced in [XML Namespaces 1.1].
History
Date User Action Args
2022-04-11 14:59:04adminsetgithub: 78487
2018-08-25 22:58:09portonsetstatus: open -> closed
type: behavior
messages: + msg324106

resolution: not a bug
stage: resolved
2018-08-01 13:32:29portoncreate