Ola,
Ja procurei e nada me ajudou a remover um elemento usando o JDOM, aguém poderia me ajudar?
public void removeElement(String elementId){
org.jdom.Document doc = null;
SAXBuilder builder = new SAXBuilder();
try {
doc = builder.build("C:\test\arquivo.xml");
} catch (Exception e) {
e.printStackTrace();
}
org.jdom.Element agenda = doc.getRootElement();
List<org.jdom.Element> contatos = agenda.getChildren();
for (org.jdom.Element element : contatos ){
if (element.getAttributeValue("id").equals(elementId)){
//ACHEI O ELEMENTO AGORA PRECISO REMOVE-LO
}
}
}