On 08/08/2022 22:08, Majewski, Steven Dennis (sdm7g) wrote:

Add options:  method=‘c14n2’, strip_text=True
When you serialize the output.
( pretty_print should also be the default False )

>>> print(etree.tostring(etree.fromstring(ss),method='c14n2', strip_text=True))
b'<wpt lat="46.98520" lon="6.8831"><name>blah</name></wpt>'
Thank you.
_______________________________________________
lxml - The Python XML Toolkit mailing list -- lxml@python.org
To unsubscribe send an email to lxml-le...@python.org
https://mail.python.org/mailman3/lists/lxml.python.org/
Member address: arch...@mail-archive.com

Reply via email to