3,424
社区成员
发帖
与我相关
我的任务
分享
import java.io.*;
import java.util.*;
import javax.xml.parsers.*;
import com.sun.org.apache.xml.internal.serialize.*;
import org.w3c.dom.*;
public void output(String filePath) {
try {
PrintWriter pwriter = new PrintWriter(new FileOutputStream(filePath));
XMLSerializer serl = new XMLSerializer(pwriter, new OutputFormat("xml", "UTF-8", true));
serl.serialize(doc);
pwriter.close();
} catch (FileNotFoundException ex) {
} catch (IOException ex) {
}
}