Re: XML header with lxml

2011-04-05 Thread Stefan Behnel
Chroma Key, 04.04.2011 21:49: On 2011-04-04 18:54:40 +0200, Jabba Laci said: I want to construct an XML file with lxml but I don't find how to add the '' header. from lxml import etree as ET html = ET.Element("html") print ET.tostring(html) Add the "xml_declaration=True" as an argument of e

Re: XML header with lxml

2011-04-05 Thread Stefan Behnel
Jabba Laci, 04.04.2011 18:54: I want to construct an XML file with lxml but I don't find how to add the '' header. This is not required. According to the XML spec, the default is: So, unless you diverge from these values, you do not need an XML declaration in your file. If you want to out

Re: XML header with lxml

2011-04-04 Thread Chroma Key
On 2011-04-04 18:54:40 +0200, Jabba Laci said: I want to construct an XML file with lxml but I don't find how to add the '' header. from lxml import etree as ET html = ET.Element("html") print ET.tostring(html) Add the "xml_declaration=True" as an argument of etree.tostring(). -- C-K -- ht

XML header with lxml

2011-04-04 Thread Jabba Laci
Hi, I want to construct an XML file with lxml but I don't find how to add the '' header. from lxml import etree as ET html = ET.Element("html") print ET.tostring(html) simply prints Thanks, Laszlo -- http://mail.python.org/mailman/listinfo/python-list