Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Docstring added
  • Loading branch information
Klaus Thoden committed Aug 22, 2018
1 parent 93db156 commit 9c19260
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions imxml2tei.py
@@ -1,6 +1,12 @@
#!/usr/bin/env python3
# -*- coding: utf-8; mode: python -*-

"""Unfinished program to convert a customized DocBook XML to TEI XML.
This program creates a TEI XML version out of a DocBook XML file.
"""

import sys
import configparser
from lxml import etree
Expand Down Expand Up @@ -274,7 +280,7 @@ def transform_intermediate_xml(xml_tree):
etree.strip_attributes(item, "label")
etree.strip_tags(item, "p")

# code if we need to treat the description list differently for any reason
# code if we need to treat the description list differently for any reason
# description_lists = xml_tree.xpath("//list[@type='description']")
# for element in description_lists:
# element.set("type", "gloss")
Expand Down Expand Up @@ -333,7 +339,7 @@ def transform_intermediate_xml(xml_tree):
table.set("rows", str(len(rows)))
table.set("cols", str(len(columns)))
table.set(id_attr, fix_xml_id(tab_label.text))

table_header = etree.Element("head")
table_header.text = tab_caption.text
table.insert(0, table_header)
Expand All @@ -357,10 +363,10 @@ def transform_intermediate_xml(xml_tree):
if figure.tag == "EOAfigurenonumber":
figure.set("rend", "nonumber")
else:
image_caption = figure.find(".//caption")
image_caption = figure.find(".//caption")
image_caption.tag = "head"
figure.append(image_caption)

figure.tag = "figure"
figure_size = figure.find(".//width")

Expand Down

0 comments on commit 9c19260

Please sign in to comment.