commons-configuration XMLConfiguration save pretty-printed

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

commons-configuration XMLConfiguration save pretty-printed

christian
Hello,

is there a way of saving a XMLConfiguration "pretty-printed", i.e. with
indentions, without empty lines...? I think i could get the Document and
then save it by myself using e.g. an jdom XMLOutputter, but i would be
interested to know if there is a "XMLConfiguration native" way of archieving
this.

thanks & regards,
christian!
Reply | Threaded
Open this post in threaded view
|

Re: commons-configuration XMLConfiguration save pretty-printed

Oliver Heger-3
Christian Migowski schrieb:

> Hello,
>
> is there a way of saving a XMLConfiguration "pretty-printed", i.e. with
> indentions, without empty lines...? I think i could get the Document and
> then save it by myself using e.g. an jdom XMLOutputter, but i would be
> interested to know if there is a "XMLConfiguration native" way of archieving
> this.
>
> thanks & regards,
> christian!
>

I am afraid, there is no native way of saving an XMLConfiguration in a
pretty-printed way.

In the very early days, before the first release, we had used dom4j for
handling XML documents. But then we decided to drop this dependency
because it did not gain us such a big benefit, and our dependency list
was already pretty long.

So in short I think, your suggestion to apply an external formatter to
the wrapped Document is a good strategy.

Oliver

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]