List of usage examples for org.w3c.dom.ls LSSerializer writeToURI
public boolean writeToURI(Node nodeArg, String uri) throws LSException;
LSSerializer.write
was called with a LSOutput
with no encoding specified and LSOutput.systemId
set to the uri
argument. From source file:Main.java
/** * Writes the given document to a file (pretty-printed) * //from ww w . j a v a 2 s. co m * @param doc Document to serialize * @param file File to write */ public static void writeDocument(Document doc, File file) { if (doc == null) return; LSSerializer writer = impl.createLSSerializer(); writer.getDomConfig().setParameter("format-pretty-print", Boolean.TRUE); writer.writeToURI(doc, file.toURI().toString()); }