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>$InstitutionCD</1>
7 7
                <2>$CollectionCD</2>
8
                <3><_if name="if indirect voucher"><else>$CatalogNO</else></_if></3>
8
                <3>$CatalogNO</3>
9 9
            </_merge>
10 10
        </authorlocationcode>
11 11
        <elevation>
......
160 160
                    <collectiondate><_date><date>$LatestDateCollected</date></_date></collectiondate>
161 161
                    <plantobservation>
162 162
                        <specimenreplicate>
163
                            <catalognumber_dwc><_if name="if indirect voucher"><else>$CatalogNO</else></_if></catalognumber_dwc>
163
                            <catalognumber_dwc>$CatalogNO</catalognumber_dwc>
164 164
                            <collectioncode_dwc>$CollectionCD</collectioncode_dwc>
165 165
                            <institution_id><party><organizationname>$InstitutionCD</organizationname></party></institution_id>
166 166
                        </specimenreplicate>

Also available in: Unified diff