[XML-SIG] [ pyxml-Bugs-843101 ] dom toxml raises exception with xmlns=''

SourceForge.net noreply at sourceforge.net
Sun Nov 16 06:02:38 EST 2003


Bugs item #843101, was opened at 2003-11-16 12:02
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=106473&aid=843101&group_id=6473

Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Fabio Forno (sciasbat)
Assigned to: Nobody/Anonymous (nobody)
Summary: dom toxml raises exception with xmlns=''

Initial Comment:
If I parse am xml document wich at some points resets
the default namespace to the empty string, i.e. 
doc=minidom.parseString("<a xmlns=''><b/></a>")
then, if I try to convert it back to xml with
doc.toxml() I get this exception:
File "<stdin>", line 1, in ?
  File
"/usr/lib/python2.3/site-packages/_xmlplus/dom/minidom.py",
line 47, in toxml
    return self.toprettyxml("", "", encoding)
  File
"/usr/lib/python2.3/site-packages/_xmlplus/dom/minidom.py",
line 59, in toprettyxml
    self.writexml(writer, "", indent, newl, encoding)
  File
"/usr/lib/python2.3/site-packages/_xmlplus/dom/minidom.py",
line 1739, in writexml
    node.writexml(writer, indent, addindent, newl)
  File
"/usr/lib/python2.3/site-packages/_xmlplus/dom/minidom.py",
line 816, in writexml
    _write_data(writer, attrs[a_name].value)
  File
"/usr/lib/python2.3/site-packages/_xmlplus/dom/minidom.py",
line 304, in _write_data
    data = data.replace("&", "&amp;").replace("<", "&lt;")
AttributeError: 'NoneType' object has no attribute
'replace'

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=106473&aid=843101&group_id=6473



More information about the XML-SIG mailing list