diff --git a/src/tei2imxml.py b/src/tei2imxml.py index 2d877dc..88fa28b 100755 --- a/src/tei2imxml.py +++ b/src/tei2imxml.py @@ -614,6 +614,13 @@ def handle_refs_default(ref): else: logging.warning("Found a processing instruction without parent!") + eoa_parts = xml_tree.xpath("//t:div[@type='part']", namespaces=NS_MAP) + for part in eoa_parts: + part.tag = "div0" + xml_id = part.attrib["{http://www.w3.org/XML/1998/namespace}id"] + del part.attrib["{http://www.w3.org/XML/1998/namespace}id"] + part.set("id", xml_id) + eoa_chapters = xml_tree.xpath("//t:div[@type='chapter']", namespaces=NS_MAP) for chapter in eoa_chapters: chapter.tag = "div1"