Skip to main content

java jdom, find doubling element

No replies
mond14
Offline
Joined: 2013-05-28
Points: 0

Hello, I hope you will very well,

Please I have xml file and I use jdom to parse it, I want to know if this file it exsite of doubling id.

here is a code but I can not manage to do so,

static boolean doubling() {

List listEtudiant = root.getChildren("user");

Iterator i = listEtudiant.iterator();

boolean bool = false;

while (i.hasNext()) {
Element courant = (Element) i.next();

if (courant.getChild("id").getTextTrim().equals(?????????)) {

bool = true;

}

}
return bool;
}
=========================================
and here is the xml file:

<.resplist.>
<.user>

<.id.>1<./id/>
<.nom>xxxx<./nom>

yyyyy

<./user>
<.user>

<.id.>3<./id/>
<.nom>xxxx<./nom>
<.prenom>yyyyy<./prenom>
<;/user>
<.user>

3<./id>
<.nom>xxxx<./nom>
<.prenom>yyyyy<./prenom>
<./user>
<./resplist>

thank you for your help