Bonjour,
Je souhaiterais savoir comment je pourrais traiter des occurences d'un fichier XML tels que :
Comment je pourrais traiter cette occurence avec une hashmap ?
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5 <Test> <Information T="A">C</Information> <Information T="B">D</Information> </Test>
Le souci étant que ma recupChaine écrase ma précédente.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12 if("Information".equals(rawName)){ map_Info.put("T=A",recupChaine); map_Info.put("T=B",recupChaine); test.setMap_Info(map_Info); Set entries = map_Info.entrySet(); Iterator it = entries.iterator(); while (it.hasNext()) { Map.Entry entry = (Map.Entry) it.next(); System.out.println(entry.getKey() + "-->" + entry.getValue()); }
Du coup cela me fait
T=A-->D au lieu de T=A-->C
T=B-->D
Merci.
Partager