diff --git a/tei2imxml.py b/tei2imxml.py index 4297040..c76ed1f 100755 --- a/tei2imxml.py +++ b/tei2imxml.py @@ -618,7 +618,11 @@ def handle_refs_hyperimage(ref): fn_parent = footnote.getparent() # we assert here that the parent of a footnote is always a paragraph or a quote - footnote_id = footnote.xpath("@xml:id")[0] + try: + footnote_id = footnote.xpath("@xml:id")[0] + except IndexError: + logging.error("Found footnote without xml:id. Exiting.") + sys.exit(1) # logging.debug(f"The prefix of fn_parent is {fn_parent.prefix}.")