Skip to content

Commit

Permalink
Find index also in div1
Browse files Browse the repository at this point in the history
  • Loading branch information
kthoden committed Nov 14, 2019
1 parent dbc6cfc commit 06f0f90
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions eoatex2imxml.py
Original file line number Diff line number Diff line change
Expand Up @@ -1706,8 +1706,14 @@ def make_indices_child_of_div0():

if index_sections:
for section in index_sections:
parent_div0 = section.xpath("./ancestor::div0")[0]
parent_div0.append(section)
try:
parent_div = section.xpath("./ancestor::div0")[0]
except IndexError:
logging.warning("Index is not embedded in div0, but div1 ")
parent_div = section.xpath("./ancestor::div1")[0]
parent_div.append(section)

libeoaconvert.debug_xml_here( xmlTree, "indexmover", DEBUG_DIR)

make_indices_child_of_div0()
etree.strip_tags(xmlTree, "tagtobestripped")
Expand Down

0 comments on commit 06f0f90

Please sign in to comment.