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