Hi. I''m trying to create an XML file of the following schema: <data> <event start = "July 12 2007 " end="July 14 2007 "> Some description text here </event> <event start = "July 20 2007 " end="July 30 2007 "> Some description text here </event> </data> And I only managed to accomplish the following schema: <data> <event> <start>July 12 2007</start> <end>July 14 2007</end> <p> Some description text here </p> </event> <start>July 20 2007</start> <end>July 30 2007</end> <p> Some description text here </p> </data> using the following codes: xml.instruct! :xml, :version=>"1.0" xml.data{ for vac in @vacations xml.event do xml.start(vac.start_date.strftime"%B %d %Y" ) xml.end (vac.end_date.strftime"%B %d %Y" ) xml.p(vac.description) end end } Can someone help point out how I may accomplish that? Having the element in the format of <event start = "...." end="..." >Some text here </event> Thank you in advance for your help. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Hi,> I''m trying to create an XML file of the following schema: > <data> > > <event start = "July 12 2007 " end="July 14 2007 "> > Some description text here >you can pass the text of the tag as the first parameter and any attributes as a hash. xml.event ''Some description text'', :start=>''July 12 2007'', :end=>''July 14 2007'' regards, javier ramirez --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
It works great for me. Thank you SO much Javier for your help. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---