XML/JDOM: Replacement for deprecated XMLOutputter ??

B

Bernd Oninger

When I compile my java source with jdom b10 the compiler tells me that the instrcution

XMLOutputter outputter = new XMLOutputter(" ", true);
Outputter.output(doc, new FileWriter("t.xml"));

is deprecated.

What si the appropriate replacement of this deprecated command ?

Bernd
 
G

GIMME

JDOM b10 has much improved XML formatting - it makes it work switching.

These clips should work for you ...

import org.jdom.output.XMLOutputter;
import org.jdom.output.Format;

try {
XMLOutputter out= new XMLOutputter(Format.getPrettyFormat());
out.output( elm , System.out);
} catch ( java.io.IOException ex ) {
System.out.println("whatever");
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top