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

J. McConnell jdotmc at gmail.com
Wed Sep 13 13:21:43 PDT 2006


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?

Other than recommending that the requirement to keep the original
formatting be reconsidered, I would think that regular text
manipulation using things like String::indexOf() and
String::substring() might be the best bet.  It doesn't sound like DOM
is the tool for this job.

- J.


More information about the jdom-interest mailing list