Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » JDOM User »

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

J. McConnell

2006-09-13

Replies:

On 9/13/06, Jason Hunter <jhunter@(protected):
> 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.
_______________________________________________
To control your jdom-interest membership:
http://www.jdom.org/mailman/options/jdom-interest/youraddr@(protected)
©2008 junlu.com - Jax Systems, LLC, U.S.A.