欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  Java

java 解析XML文件

程序员文章站 2022-04-13 19:41:20
...
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();                
 DocumentBuilder builder = factory.newDocumentBuilder();      
 Document document = builder.parse(inputStream);      
 Element element = document.getDocumentElement();     
 
 NodeList dataNodes = ((Element)element.getElementsByTagName("Application").item(0)).getChildNodes();
 for(int i = 0; i 
 1.7baidu.comsohu.com