def load(source: TextIO) -> XmlNode: dom = _parse(source) node = dom.firstChild while node.nodeType != xml.dom.Node.ELEMENT_NODE: node = node.nextSibling assert node is not None, "Root not not found!" return from_dom(node)
def from_xml(xml_file): model = ConfigurationModel() dom = _parse(xml_file) options = dom.getElementsByTagName('option') for option_node in options: model.options.append(Option.from_node(option_node)) dom.unlink() return model
def from_xml(xml_file): model = FailureModel() dom = _parse(xml_file) tests = dom.getElementsByTagName('test') for test in tests: model.tests.append(Test.from_node(test)) dom.unlink() return model