dom4j的org.dom4j.IllegalAddException处理
来源:互联网 发布:域名在哪里备案 编辑:程序博客网 时间:2024/06/09 11:00
Document doc = DocumentHelper.createDocument();
Element root = doc.addElement("config")
Element files = root.addElement("files");
String configFiles="<files><file name="AdShower123.exe" oriname="update\adshower123.zip" ver="1.0.0.1" md5="" update="http://soft.51cy.org:80/adv/package/adshower.zip" action="3" param="" op="0" optype="3" opcmd="$(appdir)\AdShower.exe" opparam=""/><file name="AdShower123.exe" oriname="update\adshower123.zip" ver="1.0.0.1" md5="" update="http://soft.51cy.org:80/adv/package/adshower.zip" action="3" param="" op="0" optype="3" opcmd="$(appdir)\AdShower.exe" opparam=""/></files>";
Document fileDom=DocumentHelper.parseText(configFiles);
//root.add(fileDom.getRootElement());
//System.out.println("2222222222:"+fileDom.selectNodes("files").toString());
for (Iterator iterator = fileDom.getRootElement().elementIterator(); iterator.hasNext();) {
Element e = (Element) iterator.next();
// files.add(e);
files.add((Element)e.clone());
}
红色是出错的位置,蓝色为正确的写法
参考链接:http://moon-cake.iteye.com/blog/298052
- dom4j的org.dom4j.IllegalAddException处理
- DOM4J 操作 XML 时抛出 org.dom4j.IllegalAddException 的异常的解决方案
- Dom4j中异常处理:org.dom4j.DocumentException
- org.dom4j
- org.dom4j
- org/dom4j/DocumentException
- org.dom4j.DocumentException
- Dom4j
- dom4j
- DOM4J
- DOM4j
- Dom4j
- Dom4j
- dom4j
- dom4j
- dom4j
- dom4j
- dom4j
- Amazon AppStream服务介绍
- 在Win2003、Win7、XP中配置IIS搭建ASP.NET Web网站或应用程序
- EC2使用iostat, netstat,需安装
- 获得OSGi Bundle相关的路径信息
- 错误:is quoted with " which must be escaped when used within the value (转载)
- dom4j的org.dom4j.IllegalAddException处理
- Android webview加载本地图片
- Windows7使用git/github
- oracle 热备脚本
- 最火爆的开源流式系统Storm vs 新星Samza .
- 学习算法之类
- 证书创建工具 和 参数详解 (Makecert.exe) .
- Charles移动端抓包工具使用
- 结构体在内存中的对齐规则