用javax.xml.transform.TransformerransformerFactory tFactory = TransformerFactory.newInstance();
Transformer transformer = tFactory.newTransformer();transformer.setOutputProperty(OutputKeys.INDENT, "yes");
transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "no");
transformer.setOutputProperty(OutputKeys.METHOD, "xml");
transformer.setOutputProperty(OutputKeys.VERSION, "1.0");
transformer.setOutputProperty(OutputKeys.ENCODING, "GB2312");transformer.transform(new DOMSource(dom), new StreamResult(new FileOutputStream(filePath)));
Transformer transformer = tFactory.newTransformer();transformer.setOutputProperty(OutputKeys.INDENT, "yes");
transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "no");
transformer.setOutputProperty(OutputKeys.METHOD, "xml");
transformer.setOutputProperty(OutputKeys.VERSION, "1.0");
transformer.setOutputProperty(OutputKeys.ENCODING, "GB2312");transformer.transform(new DOMSource(dom), new StreamResult(new FileOutputStream(filePath)));
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货