Skip to content

Commit

Permalink
Lists
Browse files Browse the repository at this point in the history
  • Loading branch information
kthoden committed Sep 18, 2019
1 parent def5408 commit e28da2c
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions tei2imxml.py
Original file line number Diff line number Diff line change
Expand Up @@ -901,16 +901,19 @@ def handle_refs_default(ref):
#########
eoa_lists = xml_tree.xpath("//t:body//t:list", namespaces=NS_MAP)
for eoalist in eoa_lists:
items = eoalist.findall("t:item", namespaces=NS_MAP)
for listitem in items:
listitem.tag = "p"
libeoaconvert.wrap_into_element(etree.Element("item"), listitem)
if eoalist.get("type") == "ordered":
pass
for listitem in items:
new_item_element = listitem.getparent()
new_item_element.set("id-text", f"{str(items.index(listitem) + 1)}")
new_item_element.set("label", f"{str(items.index(listitem) + 1)}.")
if eoalist.get("type") == "unordered":
pass
eoalist.set("type", "simple")
if eoalist.get("type") == "gloss":
eoalist.set("type", "description")
items = eoalist.findall("t:item", namespaces=NS_MAP)
for listitem in items:
listitem.tag = "p"
libeoaconvert.wrap_into_element(etree.Element("item"), listitem)

##############
# References #
Expand Down

0 comments on commit e28da2c

Please sign in to comment.