标签:XML
首先根据xml路径获取到xml的流文件public void Test(){
InputStream input = this.Class().getResourceAsStream("/xxx.xml");
SAXReader reader = new SAXReader();
try {
Document document = reader.read();
Element rootEle = document.getRootElemnt();
Iterator<Elelment> iter01 = rootEle.elementIterator();
while(iter01.hasNext()){
Element element01 = iter01.next();
String xx = element01.attributeValue();
String yy = element01.attributeValue();
Iterator iter02 = element01.elementIterator();
while(iter02.hasNext){
Element element02 = iter02.next();
String xx = element01.attributeValue();
String yy = element01.attributeValue();
}
}
}catch(Exception e){
e.printStackTrace();
}
}
标签:XML
原文地址:http://blog.51cto.com/13654477/2088286