XML Element attributes


#1

Hi.

I’m trying to create an XML file of the following schema:

Some description text here Some description text here

And I only managed to accomplish the following schema:

July 12 2007 July 14 2007

Some description text here

July 20 2007 July 30 2007

Some description text here

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
Some text here

Thank you in advance for your help.


#2

Hi,

I’m trying to create an XML file of the following schema:

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


#3

It works great for me.
Thank you SO much Javier for your help.