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>
......
198 198
                            <definedvalue>$sex</definedvalue>
199 199
                        </definedvalue>
200 200
                        <specimenreplicate>
201
                            <catalognumber_dwc><_if name="if indirect voucher"><else>$catalogNumber</else></_if></catalognumber_dwc>
201
                            <catalognumber_dwc>$catalogNumber</catalognumber_dwc>
202 202
                            <collectioncode_dwc>
203 203
                                <_merge>
204 204
                                    <1>$collectionCode</1>

Also available in: Unified diff