Document doc = getResultDoc();
TransformerFactory tf = TransformerFactory.newInstance();
Transformer transformer = tf.newTransformer();
transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
StringWriter writer = new StringWriter();
transformer.transform(new DOMSource(doc), new StreamResult(writer));
String output = writer.getBuffer().toString();
FileUtils.writeStringToFile(new File("/home/fernando/Documents/temporary/result.xsd"), output,
StandardCharsets.UTF_8);
Created
February 18, 2019 00:39
-
-
Save fernandor777/f97bf085e797284dcbc3224a5c42385a to your computer and use it in GitHub Desktop.
XML java
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment