Project

General

Profile

« Previous | Next » 

Revision 2009

xml_dom.py: set_value(): If value is None and node is Element, remove value node entirely instead of setting node's value to None

View differences:

lib/xml_dom.py
174 174
        else:
175 175
            assert is_elem(node)
176 176
            node.appendChild(node.ownerDocument.createTextNode(value))
177
    else: node.nodeValue = value
177
    elif value_node_ != None:
178
        if is_elem(node): remove(value_node_)
179
        else: node.nodeValue = value
178 180

  
179 181
class NodeTextEntryIter:
180 182
    def __init__(self, node): self.iter_ = NodeElemIter(node)

Also available in: Unified diff