[jdom-interest] b9 white space

John johnkie at pacbell.net
Mon May 5 08:31:34 PDT 2003


On Saturday 03 May 2003 05:38 pm, Bradley S. Huffman wrote:
> John writes:
> > XMLOutputter xout = new XMLOutputter("  ", true, "UTF-8");
>
> This indents all lines, even those that contain all whitespace. You
> probably also want to setTextTrim(true) to get to output the way you want.
>
> Brad

This works, and will mask the problem on output.  The real problem is on the 
input side, where the stand alone newline is treated as an element and not 
white space.  I specified:

    	builder.setIgnoringElementContentWhitespace(true);

and everything between the two elements is white space.

John




More information about the jdom-interest mailing list