Skip to content

Commit 2886a85

Browse files
authored
Change the XML library to lxml to avoid namespace renaming and other XML problems
1 parent 0061b55 commit 2886a85

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docxtpl/template.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ def render_footnotes(
359359

360360
for k, v in self.docx.sections[0].part.related_parts.items():
361361
if v.content_type == 'application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml':
362-
import xml.etree.ElementTree as ET
362+
from lxml import etree as ET
363363
tree = ET.fromstring(v.blob)
364364
for footnote in tree.findall('.//w:t', docx.oxml.ns.nsmap):
365365
if hasattr(footnote, 'text'):

0 commit comments

Comments
 (0)