Esempio n. 1
0
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)
Esempio n. 2
0
	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		
Esempio n. 3
0
	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