+ def wrap_up(self, doc):
+ filepath = os.path.join(sfatables_config, 'processors', self.final_processor)
+
+ if not os.path.exists(filepath):
+ raise Exception('Could not find final rule filter')
+
+ styledoc = libxml2.parseFile(filepath)
+ style = libxslt.parseStylesheetDoc(styledoc)
+ result = style.applyStylesheet(doc, None)
+ stylesheet_result = style.saveResultToString(result)
+ style.freeStylesheet()
+ doc.freeDoc()
+ result.freeDoc()
+
+ return stylesheet_result