String path = null;
SAXReader sax = new SAXReader();
Document document = sax.read(new File("src/main/java/config.xml"));
//获取根元素
Element root = document.getRootElement();
System.out.println("获取到的根元素" + root);
//获取所有的子元素Love
List<Element> elements = root.elements("Gather");
//输入name元素的内容
for (Element element : elements) {
String elementTextTrim = element.elementTextTrim("path");
path =elementTextTrim;
}
return path;
*
## ****```今天项目用到xml解析,记录下来,以防忘记。****
*