1.写文件并设置encoding
OutputFormat format = OutputFormat.createPrettyPrint();
format.setEncoding("GBK");
output = new XMLWriter(new FileWriter(new File(filename)), format);
output.write(document);
2.先删文件再创建
File file = new File("d://xxx.xml");
if(file.exists()){
file.delete();
}
CreatXml temp = new CreatXml();
temp.createXMLFile("d://xxx.xml")
posted on 2008-08-20 23:50
xrzp 阅读(1221)
评论(0) 编辑 收藏 所属分类:
JAVA