Project

General

Profile

« Previous | Next » 

Revision 23

In data2xml, fixed xpath.get() to do last_only optimization properly for pointer targets

View differences:

scripts/xml2db/xml_util.py
73 73
    else: node.nodeValue = value
74 74

  
75 75
def by_tag_name(node, name, last_only=False):
76
    # The last_only optimization just checks the most recently inserted node
76
    # last_only optimization returns last (most recently inserted) matching node
77 77
    children = []
78 78
    for child in NodeElemReverseIter(node):
79 79
        if child.tagName == name:
scripts/data2xml/xml_util.py
73 73
    else: node.nodeValue = value
74 74

  
75 75
def by_tag_name(node, name, last_only=False):
76
    # The last_only optimization just checks the most recently inserted node
76
    # last_only optimization returns last (most recently inserted) matching node
77 77
    children = []
78 78
    for child in NodeElemReverseIter(node):
79 79
        if child.tagName == name:
scripts/data2xml/xpath.py
128 128
                    if obj != None: id_ = str(int(xml_util.get_id(obj)) + 1)
129 129
                    else: id_ = '0'
130 130
                    xml_util.set_value(doc, node, id_)
131
                else: last_only = False
131 132
                set_id(target, id_)
132
            return get(doc, target, create, False)
133
            return get(doc, target, create, last_only)
133 134
        
134 135
        parent = node
135 136
        elem_idx += 1

Also available in: Unified diff