Add the XML declaration

This commit is contained in:
Guillaume Ayoub 2011-07-07 12:38:56 +02:00
parent 737802876f
commit 3356d3235f

View File

@ -86,7 +86,8 @@ def _pretty_xml(element, level=0):
if level and (not element.tail or not element.tail.strip()): if level and (not element.tail or not element.tail.strip()):
element.tail = i element.tail = i
if not level: if not level:
return ET.tostring(element, config.get("encoding", "request")) return '<?xml version="1.0"?>\n' + ET.tostring(
element, config.get("encoding", "request"))
def _tag(short_name, local): def _tag(short_name, local):