How to find a node if parent node and child node has same name?

espot16

New Member
I am working on a project in which I have to operate XML files using java. Earlier I was getting nodes by using node name, ie. \[code\]getElementsByTagName()\[/code\]. Now a problem arises when I have an xml file with parent node and child node with same name.
How can I distinguish between them.This a short sample of my xml file.\[code\] <deviceparameters> <parameter> // parent <name>ABC</name> <parameter>Yes</parameter> // child with same name <value>20</value> </parameter> </deviceparameters>\[/code\]Thanks in advance.
 
Back
Top