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.

Title: minidom: wrong processing of xmlns attributes
Type: behavior Stage: resolved
Components: XML Versions: Python 3.7, Python 3.6, Python 2.7
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

It should print


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():
msg324106 - (view) Author: Victor Porton (porton) Date: 2018-08-25 22:58
My bug report was wrong:
In the DOM, all namespace declaration attributes are by definition bound to the namespace URI: "". These are the attributes whose namespace prefix or qualified name is "xmlns" as introduced in [XML Namespaces 1.1].
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