From c43bf9f35f3705a26cd7a555f950764fa25dbc70 Mon Sep 17 00:00:00 2001 From: pictuga Date: Wed, 4 Dec 2013 20:14:09 +0100 Subject: [PATCH] Feed: print roottree Keeps doctype declaration, xml stylesheets and so on --- feeds.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/feeds.py b/feeds.py index 2ee2179..4f936a3 100644 --- a/feeds.py +++ b/feeds.py @@ -303,6 +303,9 @@ class FeedParser(FeedBase): description = desc = FeedDescriptor('desc') items = FeedListDescriptor('items') + def tostring(self, **k): + return etree.tostring(self.xml.getroottree(), pretty_print=True, **k) + class FeedParserRSS(FeedParser): """ RSS Parser