Re: [dom4j-user] setStripWhitespaceText problem

2008-01-11 Thread Edwin Dankert
SAXReader.setStripWhitespaceText only strips full Text nodes which consist
solely of white-space and no other characters.

The following white-space Text Node will be 'stripped':





The method does not remove any leading or trailing white-space from text nodes.

Kind regards,
Edwin
-- 
http://www.edankert.com/

-
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/dom4j-user


[dom4j-user] setStripWhitespaceText problem

2007-12-18 Thread Uri Shohet
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

  

TEXT

  


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
[email protected]
https://lists.sourceforge.net/lists/listinfo/dom4j-user