Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » JDOM User »

RE: [jdom-interest] RE: Line breaks after xml declaration

William Krick

2006-07-18

Replies:

RE: Line breaks after xml declaration
You'll probably have to turn off the XML declaration when converting to a string, then add it manually like this...
 
Format fmt = Format.getCompactFormat();
fmt.setOmitDeclaration(true);
XMLOutputter outputter = new XMLOutputter(fmt);
String declaration = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
String xml = declaration + outputter.outputString(doc);
 
 
 

-----Original Message-----
From: Heise, Robert [mailto:Robert.Heise@Peopleclick.com]
Sent: Tuesday, July 18, 2006 3:14 PM
To: jdom-interest@jdom.org
Subject: [jdom-interest] RE: Line breaks after xml declaration

    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?

    Thanks
    Rob

_______________________________________________
To control your jdom-interest membership:
http://www.jdom.org/mailman/options/jdom-interest/youraddr@(protected)
©2008 junlu.com - Jax Systems, LLC, U.S.A.