def writeHtmlDoc(filing, root, reportZip, reportFolder, filename): htmlText = treeToString(root, method='html', with_tail=False, pretty_print=True, encoding='utf-8') if reportZip: reportZip.writestr(filename, htmlText) elif reportFolder is not None: filing.writeFile(os.path.join(reportFolder, filename), htmlText)
def writeXmlDoc(filing, etree, reportZip, reportFolder, filename): xmlText = treeToString(etree.getroottree(), method='xml', with_tail=False, pretty_print=True, encoding='utf-8', xml_declaration=True) if reportZip: reportZip.writestr(filename, xmlText) elif reportFolder is not None: filing.writeFile(os.path.join(reportFolder, filename), xmlText)