mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-08 16:13:38 +02:00
...
This commit is contained in:
parent
0bae35b79c
commit
13d0bf8d01
1 changed files with 2 additions and 0 deletions
|
|
@ -23,6 +23,8 @@
|
|||
from calibre.utils.zipfile import ZipFile
|
||||
|
||||
def xml2str(root, pretty_print=False, with_tail=False):
|
||||
if hasattr(etree, 'cleanup_namespaces'):
|
||||
etree.cleanup_namespaces(root)
|
||||
ans = etree.tostring(root, encoding='utf-8', xml_declaration=True,
|
||||
pretty_print=pretty_print, with_tail=with_tail)
|
||||
return ans
|
||||
|
|
|
|||
Loading…
Reference in a new issue