简单的sax解析方式 更灵活的使用
String result = "";
try {
String filename = "students.xml";
URL url = Configuration.class.getClassLoader().getResource(filename);
String str = url.getFile();
// 转换编码
str = URLDecoder.decode(str, "utf-8");
File conf = new File(str);
SAXReader reader = new SAXReader();
Document document = reader.read(conf);
Element root = document.getRootElement();
Element chird = root.element(arg);
if (chird != null)
result = chird.attributeValue("value");
} catch (Exception e) {
// TODO: handle exception
}