views:

11

answers:

0

I already create a xml documnt by using Builder::XmlMarkup lib and add elements something like that

<sportVenueNextBookingConfigurations>

   <sportVenue id ='23'>
       <numberOfMonthsForBookings>
           <value type='staff'>8</value>
           <value type='normal'>7</value>
           <value type='booking_start_date'>2010-09-01</value>
       </numberOfMonthsForBookings>
   </sportVenue>

Now i want to add more sport_venue tags to root element(sportVenueNextBookingConfigurations) if somebody need. How can append new tags to existing root element. this is the code i have in ruby

if(File.exist?(CONFIG_SPORT_VENUE_BOOKINGS_MONTHS)) file = File.open(CONFIG_SPORT_VENUE_BOOKINGS_MONTHS, "a") x = Builder::XmlMarkup.new(:target=>file,:indent => 1) x.sportVenue("id"=>"#{sport_venue_id}"){ x.numberOfMonthsForBookings{ x.value("#{online_month}", "type" => "staff") x.value("#{staff_month}", "type" => "online") }

  }

end strong text