[jdom-interest] retrieving the children of an element as text

J. McConnell jdotmc at gmail.com
Wed Sep 13 16:14:08 PDT 2006


On 9/13/06, Jason Hunter <jhunter at servlets.com> wrote:
> J. McConnell wrote:
> > On 9/13/06, Jason Hunter <jhunter at servlets.com> wrote:
> >> I'd recommend xmlOutputter.outputString(mainelement.getContent()).
> >
> > This won't satisfy the OP's goal of mainting the original formatting,
> > will it?
>
> I think it will, since getContent() includes the elements as well as the
> whitespace text nodes, and by default XMLOutputter doesn't alter source
> whitespace.

Huh, good to know.  Sorry for the confusion and thanks for the explanation!

- J.


More information about the jdom-interest mailing list