Output XML buffer?
jan.m.danielsson at gmail.com
Mon Jun 25 23:22:41 CEST 2007
I'm using ElementTree to create an XHTML page (mod_python, blah,
blah, blah). When I use ElementTree.tostring(root) to create a buffer
which I want to return to the client, it doesn't include the XML prolog
(obvisouly, since tostring is merely traversing the tree from the node I
supply to it.
I could simply prefix the tostring output with a string containing my
"<?xml ...>" schtick. But let's, for the sake of argument, say that I
trust a library more to generate it for me, rather than hand coding it
myself (not entirely true, but let's assume that is the case).
More information about the Python-list