/ Published in: Java
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
// This method writes a DOM document to a file try { // Prepare the DOM document for writing Source source = new DOMSource(doc); // Prepare the output file Result result = new StreamResult(file); // Write the DOM document to the file Transformer xformer = TransformerFactory.newInstance().newTransformer(); xformer.transform(source, result); } catch (TransformerConfigurationException e) { } catch (TransformerException e) { } }
URL: http://www.exampledepot.com/egs/javax.xml.transform/WriteDom.html