updated emane model xml to leverage lxml
This commit is contained in:
parent
4ccb1ed9f3
commit
ae94c78fbb
4 changed files with 166 additions and 88 deletions
|
@ -12,6 +12,12 @@ from core.misc.ipaddress import MacAddress
|
|||
from core.netns import nodes
|
||||
|
||||
|
||||
def write_xml_file(xml_element, file_path, doctype=None):
|
||||
xml_data = etree.tostring(xml_element, xml_declaration=True, pretty_print=True, encoding="UTF-8", doctype=doctype)
|
||||
with open(file_path, "w") as xml_file:
|
||||
xml_file.write(xml_data)
|
||||
|
||||
|
||||
def get_type(element, name, _type):
|
||||
value = element.get(name)
|
||||
if value is not None:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue