| from xml.dom import minidom |
| compare_xml.py [ -o file.xml ] |
| opts, args = getopt.getopt(sys.argv[1:], "hfo:koz", ["device="]) |
| except getopt.GetoptEror: |
| print "Comparing %s and %s" % (enfile, otherfile) |
| endoc = minidom.parse(enfile) |
| enstrings = endoc.getElementsByTagName('string') |
| otherdoc = minidom.parse(otherfile) |
| otherstrings = otherdoc.getElementsByTagName('string') |
| for others in otherstrings: |
| if ens.attributes['name'].value == others.attributes['name'].value: |
| print "'%s' present in %s and not in %s" % (ens.attributes['name'].value, enfile, otherfile) |
| for others in otherstrings: |
| if ens.attributes['name'].value == others.attributes['name'].value: |
| print "'%s' present in %s and not in %s" % (others.attributes['name'].value, otherfile, enfile) |