How do I to convert an org.jdom.Document to a String in Java?
How to convert org.jdom.Document to String
I got the answer myself
XMLOutputter xmOut = new XMLOutputter();
System.out.println("----" + xmOut.outputString(doc));
You can as well do like this with StringWriter
StringWriter writer = new StringWriter();
new XMLOutputter().output(doc, writer);
System.out.println(writer.toString());
© 2022 - 2024 — McMap. All rights reserved.