From: Robert Klemme Date: 2010-08-02T04:06:52+09:00 Subject: Re: REXML - controlling whitespaces and inserting CR 2010/8/1 Charles Wel : > Hello All, > > I have an XML file containing this > >     >        Description de >        Description en >     >     >        Description de >        Description en >     > > > I made a code to add a new tag to each . > The part of code is: > > require "rexml/document" > include REXML > ... > ... >      pval = Element.new("value") >      pval.add_attribute("xml:lang","fr") >      pval.add_text("Description fr") >      fproperty.elements << pval > fproperty is the node object > > My final XML file looks like this: > > >   >    Description de >    Description en >    Description fr >   >    Description de >    Description en >    Description fr > > > One "TAB" is inserted for each 4 spaces which were in the original file. > How to avoid this? > And how to add a CR to the new element? > > Thanks for your help, I'm a very newby I think, you will have to create your own formatter - or use a different one for output. You'll find some explanation in the REXML documentation. Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/