public static void main(String[] args){ genXmlFile(); } public static void genXmlFile(){ try{ //解析器工厂类 DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); //解析器 DocumentBuilder builder = factory.newDocumentBuilder(); //操作的Document对象 Document document = builder.new...
生成xml文件,引用JDom1.1。 mport 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 XmlWriterJDom { public static void main(String[] args){ try{ genXmlFile();...