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文件指定内容
最新推荐文章于 2024-09-15 22:31:42 发布