Project

General

Profile

« Previous | Next » 

Revision 4078

xml_func.py: simplify(): Apply pass-through optimizations for _if statements with no condition (which means false). This faciliates automated testing after an _if statement has been added, because the put template provided as part of the automated test will only change for those datasources that actually have a condition entry for the _if statement, which greatly reduces the number of tests that need to be accepted. (Note that the path before the _if will still be included as an empty path if there are no other mappings to that table, because the _if statement does not surround it.)

View differences:

import.specimens.xml.ref
5 5
            <_merge>
6 6
                <1>$InstitutionCode</1>
7 7
                <2>$CollectionCode</2>
8
                <3><_if name="if indirect voucher"><else>$CatalogNumber</else></_if></3>
8
                <3>$CatalogNumber</3>
9 9
            </_merge>
10 10
        </authorlocationcode>
11 11
        <elevation>
......
239 239
                    <plantobservation>
240 240
                        <collectionnumber>$CollectorNumber</collectionnumber>
241 241
                        <specimenreplicate>
242
                            <catalognumber_dwc><_if name="if indirect voucher"><else>$CatalogNumber</else></_if></catalognumber_dwc>
242
                            <catalognumber_dwc>$CatalogNumber</catalognumber_dwc>
243 243
                            <collectioncode_dwc>$CollectionCode</collectioncode_dwc>
244 244
                            <institution_id><party><organizationname>$InstitutionCode</organizationname></party></institution_id>
245 245
                        </specimenreplicate>

Also available in: Unified diff