MCPcopy Create free account
hub / github.com/FreeOpcUa/python-opcua / write_xml

Method write_xml

opcua/common/xmlexporter.py:119–141  ·  view source on GitHub ↗

Write the XML etree in the exporter object to a file Args: xmlpath: string representing the path/file name Returns:

(self, xmlpath, pretty=True)

Source from the content-addressed store, hash-verified

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 """

Callers 3

export_xmlMethod · 0.95
export_xmlMethod · 0.95

Calls 2

indentFunction · 0.85
writeMethod · 0.45

Tested by

no test coverage detected