import java.io.File;
import org.jdom.Attribute;
import org.jdom.Document;
import org.jdom.Element;
import org.jdom.input.DOMBuilder;

public class GetAttribute {
	public static void main(String[] ar) {
		try {
			File XmlFile = new File("student.xml");
			DOMBuilder db = new DOMBuilder(false);
			Document dc = db.build(XmlFile);
			Element e = dc.getRootElement();
			System.out.println("Root " + e);
			Attribute att = e.getAttribute("name");
			System.out.println("Get root element Attribute." + att);
			} catch (Exception e) {
			System.out.println("Exception : " + e.getMessage());
		}
	}
}
