Project

General

Profile

« Previous | Next » 

Revision 1995

xml_func.py: strip(): Remove _ignore XML funcs completely instead of replacing them with their values

View differences:

xml_func.py
71 71

  
72 72
def strip(node):
73 73
    '''Replaces every XML function with its last parameter (which is usually its
74
    value)'''
74
    value), except for _ignore, which is removed completely'''
75 75
    for child in xml_dom.NodeElemIter(node): strip(child)
76 76
    name = node.tagName
77 77
    if name.startswith('_') and name in funcs:
78
        value = pop_value(list(xml_dom.NodeTextEntryIter(node)), name=None)
78
        if name == '_ignore': value = None
79
        else: value = pop_value(list(xml_dom.NodeTextEntryIter(node)), None)
79 80
        xml_dom.replace_with_text(node, value)
80 81

  
81 82
##### XML functions

Also available in: Unified diff