From 3b125418b303f35207110d30daa6f7d603424182 Mon Sep 17 00:00:00 2001 From: Klaus Thoden Date: Tue, 29 May 2018 17:08:17 +0200 Subject: [PATCH] Footnotes --- tei2imxml.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tei2imxml.py b/tei2imxml.py index 766a12a..85f1ff8 100644 --- a/tei2imxml.py +++ b/tei2imxml.py @@ -469,7 +469,11 @@ def transform_body(xml_tree, cited_data, publang): fn_parent = footnote.getparent() # we assert here that the parent of a footnote is always a paragraph - assert(fn_parent.tag == "p") + footnote_id = footnote.xpath("@xml:id")[0] + + if fn_parent.tag != "p": + print("This footnote's parent is not a p element: %s. Exiting." % footnote_id) + sys.exit() fn_paragraphs = footnote.xpath("t:p", namespaces=NS_MAP) for fn_paragraph in fn_paragraphs: