XMLBeans 介绍
XMLBeans是一个XML-Java绑定工具,利用它可以很方便地解析XML文档。
上图是代理动态加载 XMLBeans 的框图。
Eclipse支持插件:xmlbeansplug(在线更新地址)。
file xmlfile = new file("c:\employees.xml"); // Bind the instance to the generated XMLBeans types. Employeesdocument empDoc = Employeesdocument.Factory.parse(xmlfile); // Get and print pIEces of the XML instance. Employees emps = empDoc.getEmployees(); Employee[] empArray = emps.getEmployeeArray(); for (int i = 0; i < empArray.length; i++) { System.out.println(empArray[i]); }
在线Javadoc:http://www.ostools.net/apidocs/apidoc?api=xmlbeans