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
13 13
                                <2>$collectionID</2>
14 14
                            </_merge>
15 15
                        </2>
16
                        <3><_if name="if indirect voucher"><else>$catalogNumber</else></_if></3>
16
                        <3>$catalogNumber</3>
17 17
                    </_merge>
18 18
                </4>
19 19
            </_alt>
......
78 78
                    <plantobservation>
79 79
                        <collectionnumber>$recordNumber</collectionnumber>
80 80
                        <specimenreplicate>
81
                            <catalognumber_dwc><_if name="if indirect voucher"><else>$catalogNumber</else></_if></catalognumber_dwc>
81
                            <catalognumber_dwc>$catalogNumber</catalognumber_dwc>
82 82
                            <collectioncode_dwc>
83 83
                                <_merge>
84 84
                                    <1>$collectionCode</1>

Also available in: Unified diff