DOMImplementationRegistry registry = DOMImplementationRegistry.newInstance(); //1
DOMImplementationLS domImplLs =
(DOMImplementationLS)registry.getDOMImplementation("LS"); //2
LSSerializer serializer = domImplLs.createLSSerializer(); //3
serializer.getDomConfig().setParameter("format-pretty-print", true); //4
LSOutput out = domImplLs.createLSOutput(); //5
out.setEncoding("GBK");
File file = new File("./src/com/example/xml_dom/test02.xml"); //6
if(!file.exists())
file.createNewFile();
out.setCharacterStream(new FileWriter(file));
serializer.write(doc, out); //7
第三方插件去看技术文档
那个技术文档?,在哪里看?
@shenshenxuezi: 不知道