Méthode afficher() qui permet d'afficher les elements du fichier xml * @return */ public void afficher(){ for (int i = 0; i < nodeList.getLength(); i++) { Element e = (Element)nodeList.item(i); System.out.println(e.getAttribute("name")+ " =>" + e.getTextContent().trim()); //System.out.println("On ajoute la clé : "+e.getAttribute("name")+" avec la valeur : "+e.getTextContent().trim()); } } /** * Elle me trouve b quand je lui donne a */ public String getValueByKey(String key) { if (key == null) { return null; } for (int i = 0; i < this.nodeList.getLength(); i++) { Element e = (Element)this.nodeList.item(i); if (key.equals(e.getAttribute("name"))) { return (e.getTextContent().trim()); } } return null; } }