Project

General

Profile

« Previous | Next » 

Revision 4298

xml_func.py: Added prune()

View differences:

lib/xml_func.py
82 82

  
83 83
def is_xml_func(node): return is_xml_func_name(node.tagName)
84 84

  
85
def prune(node):
86
    '''Removes empty children'''
87
    for child in xml_dom.NodeElemIter(node):
88
        if xml_dom.is_empty(child): xml_dom.remove(child)
89

  
85 90
def simplify(node):
86 91
    '''Simplifies the XML functions in an XML tree.
87 92
    * Merges nodes tagged as mergable

Also available in: Unified diff