diff --git a/src/tei2imxml.py b/src/tei2imxml.py index 35eff6b..ef4f1ad 100755 --- a/src/tei2imxml.py +++ b/src/tei2imxml.py @@ -1527,8 +1527,11 @@ def add_bibliography_monograph(xml_tree, refs_for_bib_chapter): for eoa_pi in eoa_pis: if eoa_pi.text == "printbibliography": bibliography_parent = eoa_pi.getparent() - bibliography_parent.tag = "tagtobestripped" - bibliography_chapter = eoa_pi.xpath("ancestor-or-self::div1[1]")[0] + if bibliography_parent.tag == "div1": + bibliography_chapter = bibliography_parent + else: + bibliography_parent.tag = "tagtobestripped" + bibliography_chapter = eoa_pi.xpath("ancestor-or-self::div1[1]")[0] # print(bibliography_chapter)