diff --git a/src/imxml2django.py b/src/imxml2django.py index cbc19f4..8396c08 100755 --- a/src/imxml2django.py +++ b/src/imxml2django.py @@ -2010,6 +2010,11 @@ def bring_footnote_down_django(footnote, fragment, footnote_number, object_numbe collagelinks = xmlDjangoTree.xpath(".//a[@type='collage']/originalcontents/a") for link in collagelinks: link.tag = "temp" + +some_empty_tags = xmlDjangoTree.xpath(".//anchor[not(node())] | .//b[not(node())]") +for tag in some_empty_tags: + tag.tag = "tagtobestripped" + etree.strip_tags(xmlDjangoTree, "temp", "citetext", "EOAprintbibliography", "originalcontents", "tagtobestripped") etree.strip_elements(xmlDjangoTree, "citekey", "elementtoberemoved", with_tail=False) etree.strip_attributes(xmlDjangoTree, "id-text", "id", "noindent", "type", "label", "spacebefore")#, "rend")