`

轻松删除某个element

阅读更多

不管前缀是什么,我们都可以轻松删除xml文件中的某个element

 

Document document=DocumentHelper.parseText("xml字符串");

Element root = document.getRootElement();

Element security=root.element("Header").element("Security");

if(security != null)

{

security.detach();

}

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics