import javax.xml.parsers.*; import javax.xml.transform.*; import javax.xml.transform.dom.*; import javax.xml.transform.stream.*; import org.w3c.dom.*; import java.io.*; public class UuriDokumenti{ public static void main(String argumendid[]) throws Exception{ Document d=DocumentBuilderFactory.newInstance(). newDocumentBuilder().parse("inimloetelu.xml"); Element juur=(Element)d.getFirstChild(); System.out.println(juur.getNodeName()); System.out.println(juur.getFirstChild().getNodeName()); System.out.println(juur.getFirstChild(). getFirstChild().getNodeName()); System.out.println(juur.getFirstChild(). getFirstChild().getFirstChild().getNodeValue()); System.out.println(juur.getFirstChild(). getFirstChild().getNextSibling(). getFirstChild().getNodeValue()); NodeList inimla=juur.getChildNodes(); System.out.println("Inimesi kokku "+inimla.getLength()); for(int i=0; i