Skip to content

Commit

Permalink
Table references are processed with uid, not label
Browse files Browse the repository at this point in the history
  • Loading branch information
kthoden committed Dec 18, 2019
1 parent b129fac commit 525320f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/imxml2django.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
# -*- coding: utf-8; mode: python -*-
# Time-stamp: <2019-12-17 12:03:08 (kthoden)>
# Time-stamp: <2019-12-17 16:35:51 (kthoden)>

"""
Create an XML file that can be inserted into the Django database
Expand Down Expand Up @@ -1691,9 +1691,9 @@ def bring_footnote_down_django(footnote, fragment, footnote_number, object_numbe
if xmlParent.tag == "EOAchapter":
strChapterOrder = xmlParent.get("order")
strObjectOrder = xmlEOAfootnote.get("order")
if xmlReferenceLabelText in dictTables:
if xmlReferenceRefTarget in dictTables:
logging.debug("Found link to table")
strResult = dictTables[xmlReferenceLabelText]
strResult = dictTables[xmlReferenceRefTarget]
xmlEOAtables = xmlEOAdocument.findall(".//EOAtable")
for xmlEOAtable in xmlEOAtables:
tmpReferenceRefTarget = xmlEOAtable.get("label")
Expand Down
8 changes: 4 additions & 4 deletions src/imxml2epub.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
# -*- coding: utf-8; mode: python -*-
# Time-stamp: <2019-12-09 16:26:29 (kthoden)>
# Time-stamp: <2019-12-18 09:44:30 (kthoden)>

""" Convert a customized DocBook XML file into a set of files that
constitute the contents of an EPUB file.
Expand Down Expand Up @@ -1478,7 +1478,7 @@ class FootnoteError(Exception):
strTableCaption = xmlTable.find(".//EOAtablecaption").text or ""
# logging.info("Working on ", strTableCaption)
if strTableCaption != "nonumber":
intTableNumber = dictTables[xmlTable.find(".//EOAtablelabel").text]
intTableNumber = dictTables[xml_table_id]
xmlTableCaption = etree.Element("p")
xmlTableCaption.text = str(intTableNumber) + " " + strTableCaption
if xmlTable.find(".//EOAtablecaption").getchildren() is not None:
Expand Down Expand Up @@ -1713,9 +1713,9 @@ class FootnoteError(Exception):
if xmlReferenceRefTarget in dictTheorems:
logging.info("Verweis auf Theorem gefunden")
strResult = dictTheorems[xmlReferenceRefTarget]
if xmlReferenceLabelText in dictTables:
if xmlReferenceRefTarget in dictTables:
logging.info("Verweis auf Tabelle gefunden")
strResult = dictTables[xmlReferenceLabelText]
strResult = dictTables[xmlReferenceRefTarget]
tmpTail = xmlReference.tail or ""
#tmpTail = tmpTail.strip()
logging.info("XXXXXXXX")
Expand Down

0 comments on commit 525320f

Please sign in to comment.