Project

General

Profile

« Previous | Next » 

Revision 454

db_xml.py: Ignore only fields that are actually empty (rather than just not having element children), as a field containing anything other than a comment should be flagged as invalid input

View differences:

lib/db_xml.py
75 75
    # Divide children into fields and children with fkeys to parent
76 76
    for child in xml_dom.NodeElemIter(node):
77 77
        child_name = name_of(child)
78
        if xml_dom.is_text(child):
78
        if xml_dom.is_empty(child): pass # ignore empty field
79
        elif xml_dom.is_text(child):
79 80
            row[child_name] = strings.to_unicode(xml_dom.value(child))
80
        elif not xml_dom.has_elems(child): pass # ignore empty field
81 81
        elif is_ptr(child_name):
82 82
            row[child_name] = put(db, ptr_target(child), store_ids,
83 83
                row_ct_ref, pkeys)

Also available in: Unified diff