Hi have a XML file, I'm trying to get the child node value but it doesn t work , I'd try different way
in this case I want to get the value "solution"
DocumentBuilderFactory aronXml = DocumentBuilderFactory.newInstance();
DocumentBuilder aronText = aronXml.newDocumentBuilder();
Document aronDoc = aronText.parse (new File("XML/"+listName.get(i)));
String t = aronDoc.getDocumentElement().getNodeName();
System.out.println ("Root element of the doc is " + t);
NodeList children = aronDoc.getChildNodes();
for (int j = 0; j < children.getLength(); j++) {
Node child = children.item(j);
System.out.println(" the first child is: "+child);
}
<aaron2 lettres="DEORSU"
xmlns="com.ingenioquebec.dyna01.dictionnaire"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="com.ingenioquebec.dyna01.dictionnaire laPartieWord.xsd">
<solution>
<mot3 mot="DOX"/>
<mot4 mot="DUVF"/>
</solution>
<dictionnaire>
<mot3 mot="DES"/>
<mot4 mot="DESF"/>
</dictionnaire>
</aaron2>