

def parseEtree(inFileName):
    doc = parsexml_(inFileName)
    rootNode = doc.getroot()
    (rootTag, rootClass) = get_root_tag(rootNode)
    if (rootClass is None):
        rootTag = 'Network_Connection'
        rootClass = NetworkConnectionObjectType
    rootObj = rootClass.factory()
    rootObj.build(rootNode)
    doc = None
    rootElement = rootObj.to_etree(None, name_=rootTag)
    content = etree_.tostring(rootElement, pretty_print=True, xml_declaration=True, encoding='utf-8')
    sys.stdout.write(content)
    sys.stdout.write('\n')
    return (rootObj, rootElement)

dataset/ETHPy150Open CybOXProject/python-cybox/cybox/bindings/network_connection_object.py parseEtree/original