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 -- 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