[jdom-interest] XMLFormatter

Jason Hunter jhunter at xquery.com
Wed Apr 14 08:52:21 PDT 2004


You're telling the outputter to add newlines.  You're not giving it 
permission to remove old newlines.  With beta 10 you can use the 
getPrettyFormat() and then setIndent("") if you don't want any indents. 
  Before beta10 there were methods directly on the outputter itself.

-jh-

Srinivasan Pillai wrote:

> 
> 
> 
> Hi,
> 
> I am using XMLFormatter to beautify the xml file.
> 
> XMLOutputter outputter = new XMLOutputter("", true);
> 
> When the code creates a new file it works well. It creates new lines and
> the xml looks ok. But if I update the same file, it creates spaces between
> certain elements for example:
> 
> This is the file I created the first time
> 
> <codes>
> <code de="1109">
> <keys>
> <key>1234</key>
> <...>
> </keys>
> </code>
> </codes>
> 
> When I update the above file:
> 
> <codes>
> 
> <code de="1109">
> 
> <keys>
> <key>1234</key>
> <...>
> </keys>
> 
> </code>
> 
> </codes>
> 
> The space keeps increasing as the number of times I update the file. Can
> someone guide me with the proper action I should be taking to resolve this
> ?
> 
> Thanks,
> Srini
> 
> 
> ----------------------------------------------------------------------------------------
> 
> This is a PRIVATE message. If you are not the intended recipient, please
> delete without copying and kindly advise us by e-mail of the mistake in
> delivery. NOTE: Regardless of content, this e-mail shall not operate to
> bind CSC to any order or other contract unless pursuant to explicit written
> agreement or government initiative expressly permitting the use of e-mail
> for such purpose.
> ----------------------------------------------------------------------------------------
> 
> 
> _______________________________________________
> To control your jdom-interest membership:
> http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhost.com
> 



More information about the jdom-interest mailing list