Java: Supprimer des Attributs d’un document

Author:

Java: Supprimer des Attributs d'un document
{filelink=8395}

/***** 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!

Leave a Reply

Your email address will not be published. Required fields are marked *