ciao!scusa se chiedo ancora aiuto ma ho cambiato il codice ma mi da errore dopo un po....i campi li prende e li visualizza ma poi mi da errore....posto il codice della funzione e l errore...

private static void handleDocument(Document document) {
/* Tutti i nodi contenuti in document che si chiamano "libro" */
String risultato = null;
NodeList doc_xml = document.getElementsByTagName("virtual-sensor");
for(int i = 0; i < doc_xml.getLength(); i++) {
Element data = (Element)doc_xml.item(i);
String Descriptor = data.getElementsByTagName("description").item(0).g etTextContent();
String table_name = data.getAttribute("name");
NodeList internalList = data.getElementsByTagName("output-structure").item(0).getChildNodes();
for(int j =0 ;j<=internalList.getLength()-1;j++){
Node field= ( Node )internalList.item(i);

NamedNodeMap output= data.getElementsByTagName("field").item(j).getAttr ibutes();
Node res =output.getNamedItem("name");
risultato=res.getNodeValue();
System.out.println("out: "+risultato);
System.out.println("j: "+j);
}

//NamedNodeMap output= data.getElementsByTagName("field").item(0).getAttr ibutes();
//Node res =output.getNamedItem("name");
//risultato=res.getNodeValue();
String Cord = data.getElementsByTagName("addressing").item(0).ge tTextContent();
System.out.println("Table: "+table_name);
System.out.println("Descriptor: " + Descriptor);
System.out.println("OutputStructure: " + risultato);
System.out.println("Coordinate: " + Cord);
}
}


l errore che mi da è questo:

Errore.
java.lang.NullPointerException
at file_output.handleDocument(file_output.java:59)
at file_output.main(file_output.java:30)

bha nn capisco proprio:-)