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 Faililoetelu4{ public static void main(String argumendid[]) throws Exception{ Document d=DocumentBuilderFactory.newInstance(). newDocumentBuilder().parse("faililoetelu.xml"); Node n=d.getFirstChild().getFirstChild(); while(n!=null){ if(n.getNodeType()==Node.ELEMENT_NODE){ if(n.getNodeName().equals("fail")){ System.out.println(n.getFirstChild().getNodeValue()); } } n=n.getNextSibling(); } /* NodeList fnimed=((Element)d.getFirstChild()).getElementsByTagName("fail"); System.out.println(fnimed.getLength()); for(int i=0; i