Project

General

Profile

« Previous | Next » 

Revision 4300

xml_func.py: Added passthru()

View differences:

xml_func.py
87 87
    for child in xml_dom.NodeElemIter(node):
88 88
        if xml_dom.is_empty(child): xml_dom.remove(child)
89 89

  
90
def passthru(node):
91
    '''Passes through single child node'''
92
    children = list(xml_dom.NodeEntryIter(node))
93
    if len(children) == 1: xml_dom.replace(node, children[0][1])
94

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

Also available in: Unified diff