From cb7cbc33a9f8276047bef55a29e7cf3f7522f9b5 Mon Sep 17 00:00:00 2001 From: Fredrik Unger Date: Wed, 4 Mar 2026 08:10:26 +0100 Subject: [PATCH] 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 --- treecutter/docbook.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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""" -- 2.30.2