![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
XML
Geek_ymv
公众号 geekymv
展开
-
使用DOM解析XML(一)
import java.io.File;import javax.xml.parsers.DocumentBuilder;import javax.xml.parsers.DocumentBuilderFactory;import org.w3c.dom.Document;import org.w3c.dom.Element;import org.w3c.dom.NodeList;原创 2014-05-08 20:40:10 · 788 阅读 · 0 评论 -
使用Dom4j解析xml文件---SAXReader方式
张三 A公司 (021)5555666 安徽省 李四 B公司 (021)5555777 安徽省原创 2014-08-22 17:29:36 · 1390 阅读 · 0 评论 -
使用Dom4j解析xml文件---DomReader方式
public class Dom4jDomReader { public static void main(String[] args) { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = null; try { buil原创 2014-08-22 20:07:00 · 2475 阅读 · 0 评论 -
使用Dom4j生成xml文件
public class Dom4JCreateXML { public static void main(String[] args) { Document document = DocumentHelper.createDocument(); Element root = DocumentHelper.createElement("联系人列表"); documen原创 2014-08-22 16:50:19 · 661 阅读 · 0 评论 -
使用JDOM解析xml文件
public class JDomReader { public static void main(String[] args) { SAXBuilder builder = new SAXBuilder(); try { Document doc = builder.build(new File("test.xml")); Element root原创 2014-08-24 09:46:22 · 758 阅读 · 0 评论 -
使用JDOM生成xml文件
public class JDomWriter { public static void main(String[] args) { Document doc = new Document(); Element root = new Element("root"); doc.addContent(root); //添加根元素 Comment comment原创 2014-08-24 09:42:53 · 732 阅读 · 0 评论