tamouse m. wrote in post #1126383:
> On Nov 4, 2013, at 2:51 AM, Rochit Sen <lists / ruby-forum.com> wrote:
>
>> x.comment! "A test xml for test cases"
>>
>> OR what could be another approach to generate an xml file?
>>
>> Thanks
>>
>
> You are already telling builder to write to $stdout, you shouldnt even
> have a File.open in there. Also, the builder object x is not YAMLizable
> with that target, per se.
>
> What you probably (?) want to be doing is more like this:
>
>    f = File.new('dump.xml','w')
>    x = Builder::XmlMarkup.new(:target => f, :indent => 1)
>    ...
>    f.close

Thanks Tamouse. Dont know why that didnt trigger to me before. Able to 
generate a xml now.

Thanks

-- 
Posted via http://www.ruby-forum.com/.