Project

General

Profile

« Previous | Next » 

Revision 2109

xpath.py: get(): Create attrs: Fixed bug where attrs were created with last_only on, which caused attrs to get created multiple times if there were multiple attrs of the same name but different values, becase the last_only optimization would only check the last attr of that name

View differences:

inputs/NY/test/VegBIEN.specimens.xml.ref
37 37
                                </locationdetermination>
38 38
                                <locationnarrative>Parque Nacional del Manu. R&#237;o Manu: Cocha Casha Station; habitat: Floodplain forest</locationnarrative>
39 39
                                <elevation>350.0</elevation>
40
                                <elevationrange/>
40
                                <elevationrange>0.0</elevationrange>
41 41
                                <centerlatitude>-11.80</centerlatitude>
42 42
                                <centerlongitude>-71.40</centerlongitude>
43 43
                            </location>
......
138 138
                                </locationdetermination>
139 139
                                <locationnarrative>Belize Zoo, in savanna plot immediately behind zoo. Mile 31 on Western Highway</locationnarrative>
140 140
                                <elevation>15.0</elevation>
141
                                <elevationrange/>
141
                                <elevationrange>0.0</elevationrange>
142 142
                                <centerlatitude>17.40</centerlatitude>
143 143
                                <centerlongitude>-88.50</centerlongitude>
144 144
                            </location>
inputs/SpeciesLink/test/VegBIEN.specimens.xml.ref
36 36
                                    <longitude>-35.1385666667</longitude>
37 37
                                </locationdetermination>
38 38
                                <locationnarrative>Reserva Biol&#243;gica Guaribas-Pr&#243;ximo a trilha Caiana.</locationnarrative>
39
                                <elevation/>
40
                                <elevationrange/>
39
                                <elevation>181.0</elevation>
40
                                <elevationrange>0.0</elevationrange>
41 41
                                <centerlatitude>-6.73845</centerlatitude>
42 42
                                <centerlongitude>-35.1385666667</centerlongitude>
43 43
                            </location>
lib/xpath.py
289 289
        # Create attrs
290 290
        if create:
291 291
            for attr in elem.keys + elem.attrs:
292
                get(node, attr, create, last_only, allow_rooted=False)
292
                get(node, attr, create, last_only=False, allow_rooted=False)
293 293
        
294 294
        # Follow pointer
295 295
        if elem.is_ptr:

Also available in: Unified diff