Force singleton for shelfLocator

Very few input sources contain multiple mods:shelfLocator elements
for a mods:Location (illegal according to DFG MODS Anwendungsprofil).
Force a singleton in this case.

Fixes gh-7.
master
Gerber, Mike 3 years ago
parent d35032067a
commit db79960ba1

@ -233,7 +233,7 @@ def mods_to_dict(mods, raise_errors=True):
return shelf_locator.get('displayLabel') is None return shelf_locator.get('displayLabel') is None
value['shelfLocator'] = TagGroup(tag, group) \ value['shelfLocator'] = TagGroup(tag, group) \
.filter(no_display_label) \ .filter(no_display_label) \
.is_singleton() \ .force_singleton() \
.has_no_attributes() \ .has_no_attributes() \
.text() .text()
elif tag == '{http://www.loc.gov/mods/v3}originInfo': elif tag == '{http://www.loc.gov/mods/v3}originInfo':

Loading…
Cancel
Save