From: Fredrik Unger Date: Wed, 4 Mar 2026 07:10:26 +0000 (+0100) Subject: docbook: fixed the xslt output (remove DOCTYPE) X-Git-Url: https://source.tree.se/git?a=commitdiff_plain;h=cb7cbc33a9f8276047bef55a29e7cf3f7522f9b5;p=treecutter.git docbook: fixed the xslt output (remove DOCTYPE) The doctype caused errors in the parsing of the html, as it apears inside the template. Adjusted this and pretty printed the string for readability --- diff --git a/treecutter/docbook.py b/treecutter/docbook.py index 1e39a98..ee31054 100644 --- a/treecutter/docbook.py +++ b/treecutter/docbook.py @@ -240,7 +240,13 @@ class Docbook: def xslt(self, transform): """XSLT transform""" - return etree.tostring(transform(self._doc)) + transformed = transform(self._doc) + transformed_str = etree.tostring(transformed.getroot(), + encoding="unicode", + method="xml", doctype=None, + pretty_print=True, + xml_declaration=False)) + return transformed_str def clean(self): """cleaning xml"""