Skip to content

Commit

Permalink
Parent can be chapter element
Browse files Browse the repository at this point in the history
  • Loading branch information
kthoden committed May 27, 2020
1 parent 3fed658 commit 1077a40
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/tei2imxml.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 1077a40

Please sign in to comment.