Skip to content

Commit

Permalink
Change the XML library to lxml to avoid namespace renaming and other …
Browse files Browse the repository at this point in the history
…XML problems
  • Loading branch information
bartbroere committed Sep 17, 2024
1 parent 0061b55 commit 2886a85
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docxtpl/template.py
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ def render_footnotes(

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

0 comments on commit 2886a85

Please sign in to comment.