Revision 3329
Added by Aaron Marcuse-Kubitza over 12 years ago
xml_dom.py | ||
---|---|---|
34 | 34 |
|
35 | 35 |
def replace(old, new): |
36 | 36 |
'''@param new Node|None''' |
37 |
assert old.parentNode != None # not removed from parent tree |
|
38 |
|
|
37 | 39 |
if new == None: old.parentNode.removeChild(old) |
38 | 40 |
else: old.parentNode.replaceChild(new, old) # note order reversed |
39 | 41 |
|
Also available in: Unified diff
xml_dom.py: replace(): Assert that old node not removed from parent tree