[XML-SIG] [ pyxml-Bugs-743374 ] Error processing empty namespace attribute

SourceForge.net noreply@sourceforge.net
Sun, 25 May 2003 16:35:40 -0700


Bugs item #743374, was opened at 2003-05-25 23:35
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=743374&group_id=6473

Category: DOM
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Chui Tey (teyc)
Assigned to: Nobody/Anonymous (nobody)
Summary: Error processing empty namespace attribute

Initial Comment:
The following XML file was parsed, but could not be 
printed by minidom.

<?xml version="1.0" ?>
<test1 xmlns="uri:test.com">
  <test2 xmlns="">
     <test3>Hello</test3>
  </test2>
</test1>

>>> import xml.dom.minidom
>>> doc=xml.dom.minidom.parse('test.xml')
>>> print doc.toxml()
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "C:\Python22\Lib\site-
packages\_xmlplus\dom\minidom.py", line 47, in toxml
    return self.toprettyxml("", "", encoding)
  File "C:\Python22\Lib\site-
packages\_xmlplus\dom\minidom.py", line 59, in 
toprettyxml
    self.writexml(writer, "", indent, newl, encoding)
  File "C:\Python22\Lib\site-
packages\_xmlplus\dom\minidom.py", line 1746, in 
writexml
    node.writexml(writer, indent, addindent, newl)
  File "C:\Python22\Lib\site-
packages\_xmlplus\dom\minidom.py", line 816, in 
writexml
    node.writexml(writer,indent+addindent,addindent,newl)
  File "C:\Python22\Lib\site-
packages\_xmlplus\dom\minidom.py", line 811, in 
writexml
    _write_data(writer, attrs[a_name].value)
  File "C:\Python22\Lib\site-
packages\_xmlplus\dom\minidom.py", line 301, 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=743374&group_id=6473