Hello all,
this is a XML file (generated by papyrus (. uml)).
*****file XML*******
see joint
********************
I am willing to go before I draw the handle.
This is a JAVA code for the following parcour and display an attribute "xmi: version" of the root. but the display is null, why?
*****code de la classe JDOM2*********
import java.io.*;
import org.jdom2.*;
import org.jdom2.input.*;
import java.util.List;
import java.util.Iterator;
public class JDOM2
{
static org.jdom2.Document document;
static Element racine;
public static void main(String[] args)
{
//On crée une instance de SAXBuilder
SAXBuilder sxb = new SAXBuilder();
try
{
//On crée un nouveau document JDOM avec en argument le fichier XML
document = sxb.build(new File("C:\\Users\\Hela\\Desktop\\HelaEclipseJDK\\Etudedecas\\etude.uml"));
}
catch(Exception e){}
//On initialise un nouvel élément racine avec l'élément racine du document.
racine = document.getRootElement();
System.out.println(racine.getAttributeValue("xmi:version"));
}}