From 9c192607894c011ecb0ca0c11b8ce6e2be49e75d Mon Sep 17 00:00:00 2001 From: Klaus Thoden Date: Wed, 22 Aug 2018 15:56:59 +0200 Subject: [PATCH] Docstring added --- imxml2tei.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/imxml2tei.py b/imxml2tei.py index dd5a780..41deedc 100755 --- a/imxml2tei.py +++ b/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 @@ -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") @@ -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) @@ -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")