From: Michael Fellinger Date: 2007-12-12T11:32:52+09:00 Subject: Re: REXml help - Insert newlines into large xml file On Dec 11, 2007 10:50 PM, Jari Williamsson wrote: > Michael Fellinger wrote: > > > Sure, i've tried for quite some time to get REXML to a point where it > > really pretty-prints any document, but apart from implementing a whole > > streamlistener that keeps track of indentation and width there doesn't > > seem to be any. The new REXML works a bit better but inserts lots of > > whitespace at the wrong places. > > [] > > > > REXML::VERSION > > # "3.1.6" > > Don'tunderstand what you mean by "new REXML", since you seem to be using > an old one. I'm on 3.1.7.1, and here you do, for example: By new i mean 3.1.7 - which has formatters. But the one that ships with ruby is still 3.1.6 - if i require a dependency then i can just use tidy instead, no? > formatter = REXML::Formatters::Pretty.new( 3 ) > formatter.compact = true > formatter.write( doc, $stdout)