From: Robert Klemme Date: 2009-09-15T18:45:54+09:00 Subject: Re: Formatting REXML 2009/9/15 Charles Roper : > On 15/09/2009 08:55, Robert Klemme wrote: >> >> >> http://www.germane-software.com/software/XML/rexml/doc/classes/REXML/Formatters.html >> >> robert > > Hi Robert, thanks for the link. I have already spent quite some time looking > over these formatters and I just can't seem to get the formatting I want. > It's probably me being stupid, but I can't see how to get the result I want. > > I want the last 3 lines to look like this: > >  gutter >  #282828 > > > But I can only get this: > > gutter#282828 > > or this: > >   >    gutter >   >   >    #282828 >   > Bte, your XML is invalid. The opening tag is missing. And, apparently you did not read the docs properly: irb(main):143:0> d = REXML::Document.new "gutter#282828" => ... irb(main):144:0> f=REXML::Formatters::Pretty.new => # irb(main):145:0> f.compact=true => true irb(main):146:0> puts f.write(d.root,"") gutter #282828 => nil irb(main):147:0> Cheers robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/