Write the XML etree in the exporter object to a file Args: xmlpath: string representing the path/file name Returns:
(self, xmlpath, pretty=True)
| 117 | |
| 118 | |
| 119 | def write_xml(self, xmlpath, pretty=True): |
| 120 | """ |
| 121 | Write the XML etree in the exporter object to a file |
| 122 | Args: |
| 123 | xmlpath: string representing the path/file name |
| 124 | |
| 125 | Returns: |
| 126 | """ |
| 127 | # try to write the XML etree to a file |
| 128 | self.logger.info('Exporting XML file to %s', xmlpath) |
| 129 | # from IPython import embed |
| 130 | # embed() |
| 131 | if pretty: |
| 132 | indent(self.etree.getroot()) |
| 133 | self.etree.write(xmlpath, |
| 134 | encoding='utf-8', |
| 135 | xml_declaration=True |
| 136 | ) |
| 137 | else: |
| 138 | self.etree.write(xmlpath, |
| 139 | encoding='utf-8', |
| 140 | xml_declaration=True |
| 141 | ) |
| 142 | |
| 143 | def dump_etree(self): |
| 144 | """ |
no test coverage detected