<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>RE: Line breaks after xml declaration</TITLE>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.2912" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=640202420-18072006><FONT face=Arial color=#0000ff size=2>You'll 
probably have to turn off the XML declaration when converting to a string, then 
add it manually like this...</FONT></SPAN></DIV>
<DIV><FONT face=Arial><FONT size=2><FONT color=#0000ff><FONT face=Arial 
color=#0000ff size=2><SPAN 
class=640202420-18072006></SPAN></FONT></FONT></FONT></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN class=640202420-18072006>Format 
fmt = Format.getCompactFormat();</SPAN></FONT></DIV>
<DIV><SPAN class=640202420-18072006></SPAN><FONT face=Arial color=#0000ff 
size=2>fmt.setOmitDeclaration(true);<BR>XMLOutputter outputter = new 
XMLOutputter(fmt);</FONT></DIV>
<DIV><SPAN class=640202420-18072006><FONT face=Arial color=#0000ff size=2>String 
declaration = "&lt;?xml version=\"1.0\" 
encoding=\"UTF-8\"?&gt;";</FONT></SPAN></DIV>
<DIV><FONT><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN 
class=640202420-18072006>String xml = declaration + 
</SPAN>outputter.outputString(doc);</FONT></FONT></FONT></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial><BR><FONT color=#0000ff size=2></FONT></FONT></DIV>
<BLOCKQUOTE>
  <DIV class=OutlookMessageHeader dir=ltr align=left><FONT face=Tahoma 
  size=2>-----Original Message-----<BR><B>From:</B> Heise, Robert 
  [mailto:Robert.Heise@Peopleclick.com]<BR><B>Sent:</B> Tuesday, July 18, 2006 
  3:14 PM<BR><B>To:</B> jdom-interest@jdom.org<BR><B>Subject:</B> 
  [jdom-interest] RE: Line breaks after xml declaration<BR><BR></FONT></DIV><!-- Converted from text/rtf format -->
  <UL>
    <P><FONT face=Arial size=2>I have a xml client that requires no line breaks 
    in the xml. Is there anyway to turn off, strip out, the line break after the 
    xml declaration when using Document?</FONT></P>
    <P><FONT face=Arial size=2>Thanks </FONT><BR><FONT face=Arial 
    size=2>Rob</FONT> </P></UL></BLOCKQUOTE></BODY></HTML>