我可以设置更新的值,但不会写回xml
xml_doc = minidom.parse(xml_path)
item_list = xml_doc.getElementsByTagName('JOB')
for items in item_list:
if str(items.attributes['JOBNAME'].value) in parsedXmlData:
old_value = items.attributes['CMDLINE'].value
print old_value
items.setAttribute('CMDLINE', parsedXmlData[str(items.attributes['JOBNAME'].value)])
print "New Value", items.attributes['CMDLINE'].value
我到底错过了什么?