def read_xml(path, tag_name='QW', attribute_name='value'):
dom_tree = xml_parse(path)
root_node = dom_tree.documentElement
tag_list = root_node.getElementsByTagName(tag_name)
details = ''
for tag in tag_list:
if tag.hasAttribute(attribute_name):
details += tag.getAttribute(attribute_name)
return details
读取xml文件指定内容
猜你喜欢
转载自blog.csdn.net/Z_Pythagoras/article/details/105060419
今日推荐
周排行