[jdom-interest] Problem with XMLOutputter beta7#4
stephan.segschneider at snellwilcox.com
stephan.segschneider at snellwilcox.com
Wed Jul 4 01:56:40 PDT 2001
Hi all
The formatting options for the XMLOutputter doesn't seem to work.
The indentation for opening tags is always four spaces no matter what I set via
setIndentSize(int) or setIndent(String). The indentation effects only the
closing tags but
they are set randomly (something between 2 and n spaces) an do not align with
the opening tags.
The only possible setup to get a proper output is to set the outputter something
like this:
FileWriter fileWriter;
fileWriter = new FileWriter(location);
XMLOutputter outputter = new XMLOutputter();
outputter.setTextNormalize(false);
outputter.setLineSeparator(System.getProperty("line.separator"));
outputter.setExpandEmptyElements(false);
outputter.output(doc, fileWriter);
but this will always default to four spaces. That's actually fine for me but to
have the options would be even greater.
I have tried every setting forward and backwards but I cant get it to work. It
worked fine in beta 6.
Cheers,
Stephan
PS: Thanks Jason for fixing the setAttribute bug.
-----------------------------------------------------------------
Stephan Segschneider
Durford Mill
Voice : +44 (0)1730 818 747
EMail : stephan.segschneider at snellwilcox.com (office)
EMail : stephan.segschneider at cwcom.net (private)
-----------------------------------------------------------------
----------------------------------------------------------------------
The contents of this communication are confidential to the normal user of
the email address to which it was sent. If you have received this email
in error, any use, dissemination, forwarding, printing or copying of this
email is strictly prohibited. If this is the case, please notify the sender
and delete this message.
----------------------------------------------------------------------
More information about the jdom-interest
mailing list