随笔分类 - XML
Dom4j 解析数据
摘要:studentInfo.xml 1 <?xml version="1.0" encoding="gb2312"?> 2 <students> 3 <student age="25"><!--如果没有age属性,默认的为20--> 4 <name>崔卫兵</name> 5 <college>PC学院</college> 6 <telephone>62354666</telephone> 7 <notes>男
阅读全文
采用Pull解析器解析和生成XML内容.
摘要:Xml对象: 1 /** 2 * 获取数据 3 * @param xml 4 * @return 5 * @throws Exception 6 */ 7 public static List<Person> getPersons(InputStream xml) throws Exception 8 { 9 List<Person> persons = null;10 Person person = null;11 12 XmlPullParser pullParser = Xm...
阅读全文
浙公网安备 33010602011771号