Hi List,

I have a problem with the SAXReader.setStripWhitespaceText() method.

I have the following method:
        public Document parse(String xml) throws DocumentException {
                SAXReader xmlReader = new SAXReader();
                xmlReader.setMergeAdjacentText(true);
                xmlReader.setStripWhitespaceText(true);
                Document document = xmlReader.read(new StringReader(xml));
                
                return document;
        }

and I have an XML file which has something like
<AAA>
  <BBB>
    <CCC>
        TEXT
    </CCC>
  </BBB>
</AAA>

But when I call 
String str = document.valueOf("//AAA/BBB/CCC");

I get "\n\tTEXT\n"

Any idea what am I doing wrong?

Thanks in advance,

Uri

-- 
Uri Shohet
Project Manager
AMS Advanced Maintenance Systems Ltd.
Science Based Industry Campus
POB 23838, Jerusalem 91237,  Israel

Tel.        : +972-2-541-7449   Cell        : +972-54-4259-850
Fax.        : +972-2-581-4448   US Toll-Free:  1-866-389-2001 X:449

Registered Linux User #166615 (http://counter.li.org)

-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
dom4j-user mailing list
dom4j-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dom4j-user

Reply via email to