/***** Code de MesExemples.com *******/
public void delAttribute(Document doc) { Element root = doc.getDocumentElement(); Element person = (Element)root.getFirstChild(); person.removeAttribute("taille"); person.removeAttribute("sexe"); }
Code testé avec le fichier XML Suivant
Sakoba
Adams
Rappel
Ne m'oubliez pas ce week-end!