[jdom-interest] XMLOutputter

Corcos Igal CorcosI at BanqueLaurentienne.ca
Tue Feb 27 06:17:52 PST 2001


I guess there is a mistake in "Java and XML" by Brett McLaughlin or maybe
this was the default in the version of JDOM Brett refers to in his book.

Thanks for the info Steven.
Igal.



-----Original Message-----
From: Steven Gould [mailto:steven.gould at cgiusa.com]
Sent: Tuesday, February 27, 2001 4:42 AM
To: jdom-interest at jdom.org
Subject: Re: [jdom-interest] XMLOutputter


Igal,

The default XMLOutputter does not add any indentation or newlines, so the
results you
got are correct. The javadoc for the XMLOutputter default constructor
states:

>>>
This will create an XMLOutputter with no additional whitespace (indent or
new lines)
added;
<<<

Steve

---

Corcos Igal wrote:

> Has anyone used the XMLOutputter class without specifying any parameters
and
> found that the supposed default options are not enforced.?
>
> When I specify the following:
>
>         Document newDoc = new Document( elmRoot );
>
>             XMLOutputter fmt = new XMLOutputter();
>             fmt.output(newDoc, System.out);
>
> My XML gets output all on one line, but when I change the second to last
> line to:
>
>             XMLOutputter fmt = new XMLOutputter("  ", true);
>
> My XML gets output with the correct formatting (i.e. 2 space indent and
new
> line feeds on).
> Shouldn't it print this way without having to specify the parameters?
>
> Igal Corcos.
>
> _______________________________________________
> To control your jdom-interest membership:
>
http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhos
t.com

_______________________________________________
To control your jdom-interest membership:
http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhos
t.com



More information about the jdom-interest mailing list