为什么没有显示啊。应该怎么改啊?
为什么没有显示啊。应该怎么改啊?请写出正确的。谢谢
package jspxml;
import java.io.*;
import org.w3c.dom.*;
import javax.xml.parsers.*;
public class j1
{
public static void main(String[] args)
{
try{
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
DocumentBuilder db = dbf.newDocumentBuilder();
Document document = db.parse(new FileInputStream("e:/aa.xml"));
Element root = document.getDocumentElement();
Node tnode;
tnode=root.getElementsByTagName("name").item(0);
System.out.println(tnode.getNodeValue());
}catch(Exception e){System.out.println(e);}
}
}