package xmlRead; import java.io.File; import java.util.Iterator; import org.dom4j.Document; import org.dom4j.DocumentException; import org.dom4j.Element; import org.dom4j.io.SAXReader; public class XmlRead { public static void main(String[] args) { try { File f = new File("C:\\Users\\Administrator\\Desktop\\testForRead.xml"); SAXReader reader = new SAXReader(); Document document = reader.read(f); //获取根节点元素 Element element = document.getRootElement(); //列出根节点 Utils utils = new Utils(); // utils.listElement(element); // System.out.println("遍历所有节点结束====================================================\r\n"); //取出 utils.getElements(element); utils.getAllElements(element); }catch (DocumentException e) { e.printStackTrace(); } } }
最近下载更多
最近浏览更多
sipm123 LV1
2023年3月5日
yuzhiyuan1977 LV2
2021年8月2日
499600644 LV1
2021年5月11日
maki666 LV1
2021年4月15日
shiopaaa LV13
2021年4月9日
abcabcabca LV3
2021年2月1日
15939671505
2020年12月18日
暂无贡献等级
h012345678 LV8
2020年12月15日
liuguojun920 LV6
2020年9月9日
yy0987 LV5
2020年8月23日