Sorry for late reply.

Well. I dont get an error message. When I use the variable "csv" inside 
the block it seems as it just ignores it. so the result is as executing 
this:

[code]
require 'csv'
require 'builder'

File.open("testXML.xml","w"){|f|
  builder = Builder::XmlMarkup.new(:target => f, :indent => 2)
  builder.instruct!

  csv = CSV.open('mytest.csv','rb',:headers=>true)


  builder.statusinfo("date"=>"#{Time.now}", "count" =>
"#{csv.readlines.size}")
  builder.type("upgnr"=>"12345"){

  #Code removed

  }
}
[/code]

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