I came up with a pretty good workaround for the first question:
f = BytesIO()
with etree.xmlfile(f) as xf:
element = helper_library.create_root_element(...)
with xf.element(tag=element.tag, attrib=element.attrib,
nsmap=element.nsmap):
xf.write('text')
But answers to the second question would still be appreciated :)
_______________________________________________
lxml - The Python XML Toolkit mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/lxml.python.org/
Member address: [email protected]