Project

General

Profile

« Previous | Next » 

Revision 82

Moved XPath prep code (setting ID, value) to xpath.py

View differences:

map
74 74
            row_idx = 0
75 75
            for row in reader:
76 76
                row_id = str(row_idx)
77
                def put_col(name, value):
78
                    xpath.put_obj(out_doc, map_[name], row_id, has_types, value)
77 79
                for idx, name in enumerate(fieldnames):
78
                    value = row[idx]
79
                    if value != '' and name in map_:
80
                        path = copy.deepcopy(map_[name]) # don't modify value!
81
                        xpath.set_id(path, row_id, has_types)
82
                        xpath.set_value(path, value)
83
                        xpath.get(out_doc, path, True)
80
                    if row[idx] != '' and name in map_: put_col(name, row[idx])
84 81
                row_idx += 1
85 82
        doc = out_doc
86 83
    

Also available in: Unified diff