一、导入jar包 Dom4J不是Java提供的解析xml的方法,所以需要导入额外的jar包。可以去官方网站下载。 二、Dom4J解析实例 books.xml 冰与火之歌乔治马丁
POM文件配置一、DOM4J生成实例 Dom4JToXmlDemo.java public class Dom4JToXmlDemo {public static void main(String[] args) {//1、新建Document对象Document document = DocumentHelper.createDocument();//2、添加根节点bookstoreElement root = documen
dom4j
dom4j
1.6.1
下载成功了
头部报错,更新项目也不行
ArtifactTransferException: Failure to transfer xml-apis:xml-apis:jar:1.0.b2 from
http://repo.maven.apache.org/maven2 was cached in the local repository,
resolution will not be reattempted until the update
interval of central has elapsed or updates are forced. Original error: Could not transfer artifact
xml-apis:xml-apis:jar:1.0.b2 from/to central (http://repo.maven.apache.org/maven2): connection timed out to
http://repo.maven.apache.org/maven2/xml-apis/xml-apis/1.0.b2/xml-apis-1.0.b2.jar,
远程仓库连接超时,可能你机器连不上远程仓库或者远程仓库挂了,你可以选个国内的仓库试试