public static void main(String[] args) throws ParserConfigurationException, SAXException, IOException {
//得到DOM解析器的工厂实例
DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
//从DOM工厂中获得DOM解析器
DocumentBuilder dbBuilder = dbFactory.newDocumentBuilder();
//把要解析的xml文档读入DOM解析器
Document doc = dbBuilder.parse("C:/Users/Hoperun/workspace1/testAjax1/WebContent/WEB-INF/NewFile.xml");
// System.out.println("处理该文档的DomImplementation对象 = "+ doc.getImplementation());
//得到文档名称为Student的元素的节点列表
NodeList nList = doc.getElementsByTagName("city");
for (int i=0;i<nList.getLength();i++){
System.out.println(nList.item(i).getChildNodes().item(1).getTextContent());
System.out.println(n
//得到DOM解析器的工厂实例
DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
//从DOM工厂中获得DOM解析器
DocumentBuilder dbBuilder = dbFactory.newDocumentBuilder();
//把要解析的xml文档读入DOM解析器
Document doc = dbBuilder.parse("C:/Users/Hoperun/workspace1/testAjax1/WebContent/WEB-INF/NewFile.xml");
// System.out.println("处理该文档的DomImplementation对象 = "+ doc.getImplementation());
//得到文档名称为Student的元素的节点列表
NodeList nList = doc.getElementsByTagName("city");
for (int i=0;i<nList.getLength();i++){
System.out.println(nList.item(i).getChildNodes().item(1).getTextContent());
System.out.println(n