Revision 4234
Added by Aaron Marcuse-Kubitza over 12 years ago
lib/xml_dom.py | ||
---|---|---|
40 | 40 |
if new == None: old.parentNode.removeChild(old) |
41 | 41 |
else: old.parentNode.replaceChild(new, old) # note order reversed |
42 | 42 |
|
43 |
def bool2str(val): |
|
44 |
'''For use with replace_with_text()''' |
|
45 |
if val: return '1' |
|
46 |
else: return None # remove node |
|
47 |
|
|
43 | 48 |
def replace_with_text(node, new): |
44 | 49 |
''' |
45 | 50 |
@return The *new* node |
Also available in: Unified diff
xml_dom.py: Added bool2str()