<parent>
<child1>FIN </child1>
<child2>Age 13</child2>
<child3>Chennai</child3>
</parent>
<parent>
<child1>FRE</child1>
<child2>Age 15</child2>
<child3>Delhi</child3>
</parent>
This is the XML which I am using. I need to get a value child3 node if my child1 node is matches in Java code. If FIN is matches, I need to get a value of child3 "Chennai". I'm using DoumentBuilderFactory to read XML.
Help me to solve this logic.looking
for a Java coding.
for( int i = 0; i< PatientVariables.length; i++){
// loop the staff child node
NodeList patientlist = PatientVariables[i].getChildNodes();
for (int i = 0; i < patientlist.getLength(); i++) {
Node node = patientlist.item(i);