Indent XML code

Hi,

I'm generating an xml file using Java (dom) and I need it to be idented. How can I do that ?

I'm using java 1.6 and I already have the line

transformer.setOutputProperty(OutputKeys.INDENT,"yes");

Is it possible without changing api? I think JDom does the indentation, but I can't change to it :-(

Please help.

Tnx in advance.

[404 byte] By [bbclonea] at [2007-11-27 9:39:50]
# 1

> > transformer.setOutputProperty(OutputKeys.INDENT,

> "yes");

>

> Is it possible without changing api? I think JDom

> does the indentation, but I can't change to it :-(

You can control the indentation by adding this property

transformer.setOutputProperty

("{http://xml.apache.org/xslt}indent-amount", "4");

--

http://www.rgagnon.com/howto.html

RealHowToa at 2007-7-12 23:16:00 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 2
Thx a lot !you're the best! here's 5 duke dollars for you :-)
bbclonea at 2007-7-12 23:16:00 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...