日期:2014-05-19 浏览次数:20669 次
<?xml version="1.0" encoding="UTF-8"?> <个人信息> <性别>男</性别> <姓名>张三</姓名> <年龄>20</年龄> <电话>647743</电话> </个人信息>
public static void main(String[] args) { try { QueryMsgXMLUtil a = new QueryMsgXMLUtil(); QueryMsgObj obj = new QueryMsgObj (); obj.setUserName("张三"); obj.setIp("192.122.111.111"); obj.setOperationDate("2012-1-1"); obj.setOperationType("verify"); List list = new ArrayList(); QueryMsgSubObj obj2 = new QueryMsgSubObj(); obj2.setStarredNum("0"); obj2.setSelectSql("select * from vvv"); QueryMsgSubObj obj3 = new QueryMsgSubObj(); obj3.setStarredNum("1"); obj3.setSelectSql("select * from aaa"); list.add(obj2); list.add(obj3); obj.setSelectList(list); a.buildXMLoc(obj); TableFieldXMLUtil a = new TableFieldXMLUtil(); a.parseXMLToList("WEBCONTENT/buildXML/whrkxx.xml"); } catch (IOException e) { e.printStackTrace(); } catch (JDOMException e) { e.printStackTrace(); } }