[jdom-interest] getTextTrim() question

Mark J Laird Markl at waterford.org
Fri Apr 20 13:05:06 PDT 2001


Hi all,

I have a question about getTextTrim() in org.jdom.Element.  According to the documentation, it
will remove all external whitespace, and normalize all internal whitespace to one space.  Is
there any way to have it do external trimming only and leave internal content unchanged?  In
other words, if I have the following text:
        "  This   has   spaces.  "
Is there any way to get it to return:
        "This   has   spaces."
Rather than
        "This has spaces."

I am using XMLOutputter's "setTextTrim" method which invokes Element.getTextTrim(), and I would
like to be able to do external trimming only, if possible.

Thanks,

Mark




More information about the jdom-interest mailing list