From 9e5bcbde0e10849f500088b8e8f958a1ffeea2bf Mon Sep 17 00:00:00 2001 From: Klaus Thoden Date: Thu, 22 Nov 2018 11:44:59 +0100 Subject: [PATCH] Remove some rend tags from paragraphs --- fix_tei.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/fix_tei.py b/fix_tei.py index 2e7536b..f9d66d1 100644 --- a/fix_tei.py +++ b/fix_tei.py @@ -328,6 +328,10 @@ def cleanup_xml(xml_tree): for footnote in footnotes: footnote.set("place", "bottom") + paragraphs = xml_tree.xpath("//t:p[contains(@rend, 'Text') or contains(@rend, 'Footnote')]", namespaces=NS_MAP) + for paragraph in paragraphs: + paragraph.attrib.pop("rend") + etree.strip_tags(xml_tree, "tagtobestripped") return xml_tree