Ciao.
Il problema è che il valore del nodo è un nodo di tipo text quindi non riesci a recuperarlo direttamente con getNodeValue().
Dovresti fare una cosa del tipo:
Prova non ho testato il codice ma dovrebbe andare. Ciaocodice:String xmlFile = "file:c:/prova.xml"; //Istanziamo un DOM Parser DOMParser parser = new DOMParser(); //Facciamo il parsing del documento parser.parse(xmlFile); Document document = parser.getDocument(); document.normalize(); Element root = document.getDocumentElement(); System.out.println(root.getNodeName()); NodeList children = root.getChildNodes(); for (int i=0; i<children.getLength(); i++){ System.out.println(children.item(i).getNodeName()); String aNodeValue = children.item(i).getFirstChild().getNodeValue(); } //Tieni presente che questa istruzione ti ritorna gli attributi associati a root e ora non dovrebbe darti nulla. NamedNodeMap map = root.getAttributes(); for (int i=0; i<map.getLength(); i++){ System.out.println(map.item(i).getNodeValue()); }![]()