Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Index finding method
  • Loading branch information
Klaus Thoden committed Aug 30, 2018
1 parent 678b570 commit 11533e0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions eoatex2imxml.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
# -*- coding: utf-8; mode: python -*-
# Time-stamp: <2018-08-22 15:24:35 (kthoden)>
# Time-stamp: <2018-08-24 17:17:19 (kthoden)>

"""
Converts Latex files into a customized DocBook XML file.
Expand Down Expand Up @@ -1636,7 +1636,9 @@ def cleanup():
upper_div = bib_parent_element.xpath("./ancestor::div1")[0]
previous_div0 = upper_div.getparent()

other_content = bib_parent_element.xpath(".//EOAtocentry | .//EOAprintpersonindex | .//EOAprintlocationindex | .//EOAprintindex")
# possible culprit for not finding the index
# other_content = bib_parent_element.xpath(".//EOAtocentry | .//EOAprintpersonindex | .//EOAprintlocationindex | .//EOAprintindex")
other_content = upper_div.xpath(".//EOAtocentry | .//EOAprintpersonindex | .//EOAprintlocationindex | .//EOAprintindex")
if len(other_content) > 0:
for element in other_content:
previous_div0.append(element)
Expand Down
4 changes: 2 additions & 2 deletions imxml2django.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
# -*- coding: utf-8; mode: python -*-
# Time-stamp: <2018-08-22 15:44:39 (kthoden)>
# Time-stamp: <2018-08-24 17:37:51 (kthoden)>

"""
Create an XML file that can be inserted into the Django database
Expand Down Expand Up @@ -1526,7 +1526,7 @@ def bring_footnote_down_django(footnote, fragment, footnote_number, object_numbe

# If EOAprintpersonindex is found, append xml_eoa_print_person_index to xmlEOAdocument
# xmlPrintindex = xmlDjangoTree.find(".//EOAprintpersonindex")
xmlPrintindex = xmlTree.find(".//EOAprintpersonindex")
xmlPrintindex = xmlTree.find("//EOAprintpersonindex")
if xmlPrintindex is not None != 0:
# Remove <p><EOAprintindex/></p> from xmlDjangoTree
xmlPrintindex.tag = "temp"
Expand Down

0 comments on commit 11533e0

Please sign in to comment.