Project

General

Profile

« Previous | Next » 

Revision 890

bin/map: For XML inputs, use xpath.get()'s new multiple result support to iterate over elements matching the root, rather than just iterating over the first matching element's siblings. This fixes the broken 2-step tests for stems, which didn't filter by the root's attributes.

View differences:

bin/map
166 166
                nodes = xpath.get(row, in_)
167 167
                if nodes != []: return xml_dom.value(nodes[0])
168 168
                else: return None
169
            rows = xpath.get(doc0.documentElement, in_root)
169
            rows = xpath.get(doc0.documentElement, in_root, limit=end)
170 170
            if rows == []: raise SystemExit('Map error: Root "'+in_root
171 171
                +'" not found in input')
172
            map_rows(get_value, xml_dom.NodeElemIter(rows[0].parentNode))
172
            map_rows(get_value, rows)
173 173
        else: # input is CSV
174 174
            map_ = dict(mappings)
175 175
            reader = csv.reader(sys.stdin)

Also available in: Unified diff