java 1.5.0_11: How to indent xml output by DOMImplementationLS and LSSerializer

R

Rolf.Kemper

Dear Experts,
I have to write a DOM Document and I used the dom implementation LS

To serialise the document I used this code:

DOMImplementationLS domImplLS = (DOMImplementationLS)
impl.getFeature("LS", "3.0");
LSSerializer serializer = domImplLS.createLSSerializer();

// create document doShotMap

LSOutput lso = domImplLS.createLSOutput();
FileOutputStream fos = new FileOutputStream(ShotMapFilePath);
lso.setByteStream(fos);
lso.setEncoding("UTF-8");
serializer.write(docShotMap, lso);

How can I achive to indent the result ?

I would like to keep the application portable.

Thanks a lot for your hints

Rolf
 

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

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,900
Latest member
Nell636132

Latest Threads

Top