读书人

Android开发之XML资料的解析

发布时间: 2013-09-17 13:35:59 作者: rapoo

Android开发之XML文件的解析

Android系统开发之XML文件的解析

我们知道Http在网络传输中的数据组织方式有三种分别为:XML方式、HTML方式、JSON方式。其中XML为可扩展标记语言,如下:

public class Test {/** * @param args */public static void main(String[] args) {// TODO Auto-generated method stubtry {File file = new File("C://test.xml");if(file.exists()) {FileInputStream inputStream = new FileInputStream(file);List<Person> list = PullXmlTools.parseXml(inputStream, "utf-8");for(Person person : list) {System.out.println(person.toString());}} else {System.out.println("file is not exitst");}} catch (Exception e) {// TODO: handle exception}}}


读书人网 >XML SOAP

热点推荐