Python处理XML文件
import xml.dom.minidomtry: f = open(filename) dom = xml.dom.minidom.parseString(f.read())finally: f.close()if dom != None: root = dom.documentElement for element in root.getElementsByTagName("bean"): for prop in element.getElementsByTagName("property"): if prop.getAttribute("name") == "sequenceDao": print "find"
?