public class Demo4 { public static void main(String[] args) throws Exception { SAXReader reader = new SAXReader(); Document document = reader.read(new File("src/book.xml")); String value = document.selectSingleNode("//作者").getText(); System.out.println(value); } }提取具体东西时,可以查看xpath文档,了解提取路径 原文链接:https://www.f2er.com/xml/297954.html