AW: [jdom-interest] SAXBuilder inserts unwanted carriage return
markw at wilsoncom.de
Tue Oct 30 04:09:10 PST 2001
I had a similar problem and somebody pointed me to an example in
Look at DataFormatFilter.java and DataUnformatFilter.java.
Hope it helps.
> When you create a document using SAXBuilder.build(), it seems that a
> carriage return is inserted at each end of line. And when you output the
> loaded document, it leads to ugly indentation.
> This is particularly true on script elements where
> is inserted on EACH line.
> Here is a small code that shows the problem
> public void showError()
> InputStream input;
> Document document;
> SAXBuilder builder;
> XMLOutputter outputter;
> outputter = new XMLOutputter(" ", true);
> builder = new SAXBuilder();
> // Use your own xml file defining a script
> document = builder.build(new File("myDocument.xml"));
> outputter.output(document, System.out);
> catch(Exception e)
> It is not a big deal, but if you want to use templates to generate your
> final XML files, then you got badly indented files and human unreadable
> Can the wonderful jdom team try to fix that for the next release?
> Philippe Converset
> To control your jdom-interest membership:
dr at yourhost.com
More information about the jdom-interest