import org.dom4j.Attribute;
import org.dom4j.Document;
import org.dom4j.DocumentException;
import org.dom4j.Element;
import org.dom4j.io.SAXReader;
import java.io.File;
import java.util.List;
public class Test1 {
public static void main(String[] args) throws DocumentException {
File f=new File("C:\\Users\\Administrator\\IdeaProjects\\day24\\src\\HW4\\Test.XML");
boolean exists = f.exists();
System.out.println(exists);
//加载XML
SAXReader saxReade=new SAXReader();
//读取XML地址
Document document=saxReade.read(f);
//获取根节点
Element rootElement = document.getRootElement();
System.out.println(rootElement.getName());
//获取根节点下的第一重子节点:即子节点集合,代表的是华为手机信息组成的集合
List<Element> elements = rootElement.elements()