写入XML文件

mac2022-06-30  17

public static void writeXMLFile(Document doc,String xmlFileName) throws IOException{  OutputFormat format = OutputFormat.createPrettyPrint();// 创建文件输出的时候,自动缩进的格式                    format.setEncoding("UTF-8");//设置编码  //文件生成的地址  XMLWriter writer = new XMLWriter(new FileWriter("f:\\createFile\\"+xmlFileName),format);  //写入文件  writer.write(doc);  writer.close(); }

转载于:https://www.cnblogs.com/jun021225/p/6270624.html

相关资源:android读写xml文件
最新回复(0)