From 2c9b5d196ae9ee3c228a450f5f956de984866671 Mon Sep 17 00:00:00 2001 From: Klaus Thoden Date: Wed, 28 Nov 2018 12:46:13 +0100 Subject: [PATCH] Block quote rename --- fix_tei.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/fix_tei.py b/fix_tei.py index 5b8a85c..29f5039 100644 --- a/fix_tei.py +++ b/fix_tei.py @@ -332,6 +332,10 @@ def cleanup_xml(xml_tree): for paragraph in paragraphs: paragraph.attrib.pop("rend") + wrongblockquotes = xml_tree.xpath("//t:p[contains(@rend, 'Quotation')]", namespaces=NS_MAP) + for blockquote in wrongblockquotes: + paragraph.set("rend", "quote") + etree.strip_tags(xml_tree, "tagtobestripped") return xml_tree