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

Paul Libbrecht

2006-09-14

Replies:

J. McConnell wrote:
> On 9/13/06, Jason Hunter <jhunter@(protected):
>> J. McConnell wrote:
>> > On 9/13/06, Jason Hunter <jhunter@(protected):
>> >> I'd recommend xmlOutputter.outputString(mainelement.getContent()).
>> 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!

Can I ask whether DOM is better than SAX in this respect ?
Whether there's anything yet different better than that ?
(e.g. that would preserve whitespace inside tags)

thanks

paul

Attachment: smime.p7s
_______________________________________________
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.