Hello all,
I'm working on minidom.
My goal is to see whether an element already exists in the xml file before adding. I was using getElementsByTa gName() to check weather the element already exists.
The code looks something like this:
Value = argv[1]
This part gives me index error index out of range.
Can you people suggest me a good solution.
Is there any other method which I can use to find the element already exists or not in an xml file.
Thanks in advance.
I'm working on minidom.
My goal is to see whether an element already exists in the xml file before adding. I was using getElementsByTa gName() to check weather the element already exists.
The code looks something like this:
Value = argv[1]
Code:
a = dom.getElementsByTagName(Name)[0].childNodes[0].nodeValue
if (a!=Value):
add elements.
else:
return
Can you people suggest me a good solution.
Is there any other method which I can use to find the element already exists or not in an xml file.
Thanks in advance.
Comment