diff --git a/src/imxml2epub.py b/src/imxml2epub.py index 9bb8e4e..d4d4197 100755 --- a/src/imxml2epub.py +++ b/src/imxml2epub.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 # -*- coding: utf-8; mode: python -*- -# Time-stamp: <2020-05-27 09:09:09 (kthoden)> +# Time-stamp: <2020-05-27 11:07:24 (kthoden)> """ Convert a customized DocBook XML file into a set of files that constitute the contents of an EPUB file. @@ -1043,7 +1043,7 @@ class FootnoteError(Exception): for xmlChapter in xmlChapters: groupings = libeoaconvert.get_bigfoot_data(xmlChapter) - xmlFootnotes = list(xmlChapter.findall(".//note")) + xmlFootnotes = xmlChapter.xpath(".//note[not(ancestor::opener)]") logging.info("Here come the footnotes. Found " + str(len(xmlFootnotes))) has_old = 0 != len(xmlFootnotes) has_new = 0 != len( diff --git a/src/tei2imxml.py b/src/tei2imxml.py index 04940be..5fd4672 100755 --- a/src/tei2imxml.py +++ b/src/tei2imxml.py @@ -754,6 +754,12 @@ def handle_refs_default(ref): hilayer = ref.get("select") logging.debug(f"Found hyperimage annotation layer {hilayer}") ref_subelement.set("data-hilayer", hilayer) + elif type_attribute == "page": + ref.tag = "EOApageref" + del ref.attrib["type"] + del ref.attrib["target"] + etree.SubElement(ref, "ref", teitarget=target_attribute) + etree.SubElement(ref, "Label").text = target_attribute[1:] else: ref.tag = "EOAref" del ref.attrib["target"]