Преглед на файлове

Add the XML declaration

Guillaume Ayoub преди 14 години
родител
ревизия
3356d3235f
променени са 1 файла, в които са добавени 2 реда и са изтрити 1 реда
  1. 2 1
      radicale/xmlutils.py

+ 2 - 1
radicale/xmlutils.py

@@ -86,7 +86,8 @@ def _pretty_xml(element, level=0):
         if level and (not element.tail or not element.tail.strip()):
             element.tail = i
     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):