[jdom-interest] setTextTrim & setNewlines

Eric VERGNAUD eric.vergnaud at wanadoo.fr
Wed Dec 22 15:40:09 PST 2004


le 23/12/04 0:07, William Krick à wkrick at eio-online.com a écrit :

> I just recently upgraded to JDOM 1.0 from JDOM b9.  The code below no longer
> works because setTextTrim() & setNewlines() are no longer present.  What is
> the recommended way to perform these actions with the new API?
> 
> 
> // build a string from an XML document
> public static String docToString(Document doc) {
> XMLOutputter outputter = new XMLOutputter();
> outputter.setTextTrim(true);
> outputter.setNewlines(false);
> return outputter.outputString(doc);
> }
> 

XMLOutputter outputter = new XMLOutputter(Format.getPrettyFormat());

Eric
 





More information about the jdom-interest mailing list