<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2655.35">
<TITLE>RE: [jdom-interest] JDOM white space probelm</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=2>This is from the XMLOutputter documentation:</FONT>
</P>

<P><FONT SIZE=2>When a element has a xml:space attribute with the value of &quot;preserve&quot;,</FONT>
<BR><FONT SIZE=2>all formating is turned off and reverts back to the default until the</FONT>
<BR><FONT SIZE=2>element and it's contents have been printed. If a nested element</FONT>
<BR><FONT SIZE=2>contains another xml:space with the value &quot;default&quot; formatting is turned</FONT>
<BR><FONT SIZE=2>back on for the child element and then off for the remainder of the</FONT>
<BR><FONT SIZE=2>parent element.</FONT>
</P>

<P><FONT SIZE=2>Thus, set the xml:space=&quot;preserve&quot; on all elements where whitespace is critical.</FONT>
</P>

<P><FONT SIZE=2>Rolf</FONT>
</P>
<BR>

<P><FONT SIZE=2>-----Original Message-----</FONT>
<BR><FONT SIZE=2>From: Alexandre Gomes [<A HREF="mailto:xandegp@yahoo.com.br">mailto:xandegp@yahoo.com.br</A>]</FONT>
<BR><FONT SIZE=2>Sent: Monday, February 24, 2003 3:08 PM</FONT>
<BR><FONT SIZE=2>To: jdom-interest@jdom.org</FONT>
<BR><FONT SIZE=2>Subject: [jdom-interest] JDOM white space probelm</FONT>
</P>
<BR>

<P><FONT SIZE=2>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.</FONT></P>

<P><FONT SIZE=2>The problem is when i use īsetNewlines(true)ī my blank spaces are gone when i have a string composed with only blank spaces.</FONT></P>

<P><FONT SIZE=2>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).</FONT></P>

<P><FONT SIZE=2>i already tried this :</FONT>
<BR><FONT SIZE=2>XMLOutputter outputter = new XMLOutputter();</FONT>
<BR><FONT SIZE=2>outputter.setEncoding(&quot;UTF-8&quot;); </FONT>
<BR><FONT SIZE=2>outputter.setTextNormalize(false); </FONT>
<BR><FONT SIZE=2>outputter.setTextTrim(false);</FONT>
<BR><FONT SIZE=2>outputter.setTrimAllWhite(false);</FONT>
<BR><FONT SIZE=2>outputter.setNewlines(true);</FONT>
<BR><FONT SIZE=2>outputter.setIndent(&quot;\t&quot;);</FONT>
<BR><FONT SIZE=2>and it didnīt work.. </FONT>
<BR><FONT SIZE=2>Please help me somebody, what should i do?</FONT>
<BR><FONT SIZE=2>Iīll be very gratefull for any help!</FONT>
</P>
<BR>
<BR>
<BR>

<P><FONT SIZE=2>Busca Yahoo! </FONT>
<BR><FONT SIZE=2>O serviįo de busca mais completo da Internet. O que vocę pensar o Yahoo! encontra.</FONT>
</P>

</BODY>
</HTML>