0

I have a XML file like

<?xml version="1.0" encoding="UTF-8"?>
    <Table>
      <Etudiant Id="1">
        <Nom>Roberval</Nom>
        <Prenom>Roberval</Prenom> 
      </Etudiant>
      <Etudiant Id="2">
        <Nom>Roberval</Nom>
        <Prenom>Roberval</Prenom>            
      </Etudiant>
      <Etudiant Id="3">
        <Nom>Roberval</Nom>
        <Prenom>Roberval</Prenom>
      </Etudiant>
    </Table>

I need to select Max Attribut value Using JDom.here is the Java code

try {
   SAXBuilder saxeBuilde = new SAXBuilder();
   Document document =  saxeBuilde.build(new File("Data.xml"));
   Element rootNode = document.getRootElement();
   List list = rootNode.getChildren("Etudiant");
   // need some code to get it
} catch(Exception) {
   System.out.println(e.getMessage);
}

How to get Max id for Etudiant using XPath JDom?

SurvivalMachine
  • 7,946
  • 15
  • 57
  • 87
  • So what is your problem exactly? – Tavo Oct 03 '16 at 12:28
  • My problem is, how to get Max id for Etudiant using XPath JDom, – Manouher07 Oct 03 '16 at 14:23
  • Possible duplicate of [how to get the attribute value of an xml node using java](http://stackoverflow.com/questions/11863038/how-to-get-the-attribute-value-of-an-xml-node-using-java) – Tavo Oct 03 '16 at 14:33

0 Answers0