]> git.ipfire.org Git - thirdparty/python-drafthorse.git/commitdiff
Add missing XML declaration
authorRaphael Michel <michel@rami.io>
Thu, 17 Apr 2025 09:26:45 +0000 (11:26 +0200)
committerRaphael Michel <michel@rami.io>
Thu, 17 Apr 2025 09:26:45 +0000 (11:26 +0200)
drafthorse/models/document.py

index b654f92a2d258257e55fba030abf144a87c56f2d..4b16f3126233f68b332808d9964b9c0874362a1d 100644 (file)
@@ -123,7 +123,7 @@ class Document(Element):
         for ns, url in self.__namespaces.items():
             if f"xmlns:{ns}".encode() not in xml:
                 root.set(f"xmlns:{ns}", url)
-        return ET.tostring(root, "utf-8")
+        return ET.tostring(root, "utf-8", xml_declaration=True)
 
     class Meta:
         namespace = NS_RSM