I understood that this feature is in the CVS. OutputFormat is not going to help you. The Serializer cannot guess that the space is redundant and strip it. If you're using SAX parser -> SAX serializer the whitespace will show as ignorable and pretty printing will work correctly.
If you're using DOM parser -> DOM serializer, you'll need to use this feature or otherwise exterminate all the spaces from the DOM tree. arkin > Greg Matthews wrote: > > > regarding the proposed/imminent feature... > > parser.setFeature( > "http://apache.org/xml/features/dom/include-ignorable-whitespace", true > | false ); > > is there a workaround to this in the meantime? > > > i'm trying to "pretty print" a Document. if that Document was created > by > reading the xml from a file then it appears almost the same as > entered in the file. > > e.g. > > if the file looks like this > > <a> <b>hello</b> </a> > > then i'd like it to print like this > > <a> > <b>hello</b> > </a> > > > i've played around with some of the settings in OutputFormat > but haven't been able to get the result i want. > > any help much appreciated, > greg.