写文件:
import java.io.FileOutputStream;
import java.io.IOException;
import org.jdom.Document;
import org.jdom.Element;
import org.jdom.JDOMException;
import org.jdom.output.XMLOutputter;
public class JavaXML {
public void BuildXMLDoc() throws IOException, JDOMException {
// 创建根节点 list;
Element root = new Element("list");
// 根节点添加到文档中;
Document Doc = new Docu...
JDOM读写XML文件示例
写文件:
import java.io.FileOutputStream;
import java.io.IOException;
import org.jdom.Document;
import org.jdom.Element;
import org.jdom.JDOMException;
import org.jdom.output.XMLOutputter;
public class JavaXML {
public void BuildXMLDoc() throws IOException, JDOMException {
// 创建根节点 list;
Element root = new Element("list");
// 根节点添加到文档中;
Document Do...