Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Divider fully implemented
  • Loading branch information
kthoden committed Feb 28, 2020
1 parent 5cabc7f commit ea181fe
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/imxml2django.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
# -*- coding: utf-8; mode: python -*-
# Time-stamp: <2019-12-18 10:27:58 (kthoden)>
# Time-stamp: <2020-02-28 16:59:46 (kthoden)>

"""
Create an XML file that can be inserted into the Django database
Expand Down Expand Up @@ -815,6 +815,11 @@ def djangoParseObject(xmlElement, indent=False, listtype=None, listnumber=0, uid
box_element.set("order", str(intObjectNumber))
xmlResult.append(box_element)
intObjectNumber += 1
elif xmlElement.tag == "p" and xmlElement.get("class") == "divider":
xmlElement.tag = "EOAparagraph"
xmlElement.set("order", str(intObjectNumber))
intObjectNumber += 1
xmlResult = xmlElement
elif xmlElement.tag == "EOAtocentry":
# throw them out for the time being
xmlResult = etree.Element("temp")
Expand Down
1 change: 1 addition & 0 deletions src/tei2imxml.py
Expand Up @@ -699,6 +699,7 @@ def handle_refs_default(ref):
eoa_milestones = xml_tree.xpath("//t:milestone[@type='divider']", namespaces=NS_MAP)
for milestone in eoa_milestones:
milestone.tag = "p"
del milestone.attrib["type"]
milestone.set("class", "divider")

eoa_subsections = xml_tree.xpath("//t:div[@type='subsection']", namespaces=NS_MAP)
Expand Down

0 comments on commit ea181fe

Please sign in to comment.