[XML-SIG] [ pyxml-Bugs-774099 ] minidom setAttributeNodeNS return value may be wrong

SourceForge.net noreply at sourceforge.net
Sat Jul 19 02:42:42 EDT 2003


Bugs item #774099, was opened at 2003-07-19 08:42
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=774099&group_id=6473

Category: DOM
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Andrew Clover (bobince)
Assigned to: Nobody/Anonymous (nobody)
Summary: minidom setAttributeNodeNS return value may be wrong

Initial Comment:
In 0.8.2, minidom tries to remove attributes that have 
the same name *or* nsURI/localName as the new 
attribute when setAttributeNode[NS] is called.

An attribute replaced because it matches namespaceURI 
and localName will likely not be returned by the following 
code at line 745 of minidom.py:

  if old1 is not attr:
    return old1
  if old2 is not attr:
    return old2

Suggest replacement something like:

  for old in (old1, old2):
    if old is not None and old is not attr:
      return old
  return None

(Ideally there ought to be separate calls for 
setAttributeNode and setAttributeNodeNS, since one 
should only replace based on name and the other on 
nsURI/localName.)


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

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



More information about the XML-SIG mailing list