[jdom-interest] JDOM white space probelm

Rolf Lear rlear at algorithmics.com
Mon Feb 24 12:11:37 PST 2003


This is from the XMLOutputter documentation:

When a element has a xml:space attribute with the value of "preserve",
all formating is turned off and reverts back to the default until the
element and it's contents have been printed. If a nested element
contains another xml:space with the value "default" formatting is turned
back on for the child element and then off for the remainder of the
parent element.

Thus, set the xml:space="preserve" on all elements where whitespace is
critical.

Rolf


-----Original Message-----
From: Alexandre Gomes [mailto:xandegp at yahoo.com.br]
Sent: Monday, February 24, 2003 3:08 PM
To: jdom-interest at jdom.org
Subject: [jdom-interest] JDOM white space probelm


Hello i´m having trouble with JDOM XMLOutputter. I don´t want to have blank
spaces removed from element´s text but always my xml file is recorded
without them.
The problem is when i use ´setNewlines(true)´ my blank spaces are gone when
i have a string composed with only blank spaces.
When i set newlines to false the problem is solved. But i can´t have my
recorded XML file messed, so i need to use setNewLines(true) with
setIndent(\t).
i already tried this :
XMLOutputter outputter = new XMLOutputter();
outputter.setEncoding("UTF-8"); 
outputter.setTextNormalize(false); 
outputter.setTextTrim(false);
outputter.setTrimAllWhite(false);
outputter.setNewlines(true);
outputter.setIndent("\t");
and it didn´t work.. 
Please help me somebody, what should i do?
I´ll be very gratefull for any help!




Busca Yahoo! 
O serviço de busca mais completo da Internet. O que você pensar o Yahoo!
encontra.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://jdom.org/pipermail/jdom-interest/attachments/20030224/20bc1e20/attachment.htm


More information about the jdom-interest mailing list