I am generating some XML with lxml and getting nodes generated like this:
<QBXML xmlns:py="http://codespeak.net/lxml/objectify/pytype" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
py:pytype="TREE">
and:
<MaxReturned py:pytype="int">
These custom attributes are killing Quickbooks' parser. Can I get LXML to render without the custom stuff?
Looks like the following take care of it:
objectify.deannotate(root, xsi_nil=True)
etree.cleanup_namespaces(root)
or, if using lxml >= 2.3.2 (thanks @Pedru):
objectify.deannotate(root, cleanup_namespaces=True, xsi_nil=True)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With