1 Jul 2006 14:53
Re: let lxml write the ?xml pi
Stefan Behnel <behnel_ml <at> gkec.informatik.tu-darmstadt.de>
2006-07-01 12:53:03 GMT
2006-07-01 12:53:03 GMT
Hi Albert, Albert Brandl wrote: > I started using lxml some weeks ago, and have been lurking on the > mailing list for some time now. Recently I had the problem that the xml > prologue is not included by default, and stumbled over the following > mail: > > On Mon, Jun 19, 2006 at 12:48:37PM +0200, Martijn Faassen wrote: >> I.e., try the following: >> >> etree.tostring(t, 'utf-8', xml_declaration=True) > > Is there any reason that the method write_c14n() does not support this > flag? The canonical form is a bit more readable, therefore I'd prefer > to use this method. As the documentation of the write_c14n() method states, it always writes UTF-8 encoded byte streams, so there is no real need for the prologue. I wouldn't mind adding this, though. Things like 'standalone' and the XML version would otherwise not be available in the output. BTW, if it's about the readability, pretty printing might be closer to what you want anyway. Stefan
Best regards,
Albert
RSS Feed