Revision 4321
Added by Aaron Marcuse-Kubitza over 12 years ago
lib/xml_dom.py | ||
---|---|---|
259 | 259 |
'''Removes empty children''' |
260 | 260 |
for child in NodeElemIter(node): prune_empty(child) |
261 | 261 |
|
262 |
def prune(node): |
|
263 |
'''Removes empty children and then node if it's empty''' |
|
264 |
prune_children(node) |
|
265 |
prune_empty(node) |
|
266 |
|
|
262 | 267 |
def set_child(node, name, value): |
263 | 268 |
'''Note: does not remove any existing child of the same name''' |
264 | 269 |
child = node.ownerDocument.createElement(name) |
Also available in: Unified diff
xml_dom.py: Added prune()