xml修改问题
读xml没有问题,但是修改的时候会报filenotfound
StreamResult result = new StreamResult(new File(XMLfile));
transformer.transform(source, result);
[解决办法]
读到你相应的文件,然后一个个节点遍历查找啊
private void removeMessagesFromNode(List<Element> taskNodes) {
Iterator<Element> ite = taskNodes.iterator();
while (ite.hasNext()) {
Element nodElement = (Element) ite.next();
Element ext = nodElement.element("extend");
if (ext!=null) {
Element mess = ext.element("messages");
if (mess!=null) {
ext.remove(mess);
}
}
}
}