from common import * def gen_nodelist(root): nodenames = [] for node in root.nodes: nodenames.append(node.name) nodenames.sort() return "\n".join(nodenames) if __name__ == "__main__": nodes = xml_to_obj_hierarchy(sys.argv[1]) ready_nodes_dtd_hierarchy(nodes) print gen_nodelist(nodes)