Closed xrotwang closed 5 years ago
Ah, yes, duplicating was more of an oversight. I'd now unify it, I guess, turning references
into a Counter
as well, and reducing the code to:
for attr, collection in [('id', ids), ('idref', references)]:
if attrib == attr:
if e in parent_map and parent_map[e].tag == 'plate':
# Quick and dirty plate handling.
# We only support plate matching in direct children of the plate.
var = parent_map[e].get('var')
for id_ in parent_map[e].get('range').split(','):
collection.update([value.replace('$({0})'.format(var), id_)])
else:
collection.update([value])
./_test.xml
validate_ids
is called only after writing and saving the XMLvalidate_ids
detects plate-scope now by looking up parent tags