[XML-SIG] Empty string namespace - to bug or not to bug?

Andrew Clover and-xml at doxdesk.com
Mon Oct 13 04:40:05 EDT 2003

Alexis Marrero wrote:

> Is this a bug?

> doc = minidom.parseString('<root xmlns="">value</root>')
> doc.toxml()

IMO yes, but the bug occurs before doc.toxml. After the
parseString call, doc.documentElement.attributes.item(0).value
evaluates to None instead of '' (and it is this that causes the
later exception).

I suspect this code in expatbuilder.py, line 764:

  d = a.childNodes[0].__dict__
  d['data'] = d['nodeValue'] = uri
  d = a.__dict__
  d['value'] = d['nodeValue'] = uri


  if uri is None:
    uri= ''

immediately preceding this code seems to fix the problem, though
I haven't investigated whether this is the best way of doing it.

Add to bug tracker [Y|N]?

Andrew Clover
mailto:and at doxdesk.com

More information about the XML-SIG mailing list