1
0
Fork 0
mirror of https://github.com/qurator-spk/modstool.git synced 2025-08-16 21:19:52 +02:00

page_info: Retrieve filenames + structMap types

This commit is contained in:
Mike Gerber 2023-11-22 18:11:14 +01:00
parent dd3943eaf6
commit 889d36f0d4
2 changed files with 94 additions and 3 deletions

View file

@ -13,7 +13,8 @@ __all__ = ["ns"]
ns = {
'mets': 'http://www.loc.gov/METS/',
'mods': 'http://www.loc.gov/mods/v3',
"alto": "http://www.loc.gov/standards/alto/ns-v2"
"alto": "http://www.loc.gov/standards/alto/ns-v2",
"xlink": "http://www.w3.org/1999/xlink",
}
@ -25,9 +26,12 @@ class TagGroup:
self.tag = tag
self.group = group
def __str__(self):
def to_xml(self):
return '\n'.join(str(ET.tostring(e), 'utf-8').strip() for e in self.group)
def __str__(self):
return f"TagGroup with content:\n{self.to_xml()}"
def is_singleton(self):
if len(self.group) != 1:
raise ValueError('More than one instance: {}'.format(self))