How to edit particular element value from list of xml elements using ruby

Hi friends,
I want to edit for particular elementin xml file.Am using rexml
I have the xml file like below in that i want to edit date for only
event name"New Year"


<?xml version="1.0" encoding="utf-8"?> ************************************************************** Can any help me how to do this

actually i need to read xml file.you have taken as xmlstring.anyway it’s
not a problem.But the thing i want how to edit file

Lucky Nl wrote in post #1064450:

actually i need to read xml file.you have taken as xmlstring.anyway it’s
not a problem.But the thing i want how to edit file

Well, after you’ve edited the XML node, you call the “write” method to
transform the document tree to a string an write it to the file:

Hi,

You could use XPath to select the element:

//event[@name=“birthday”]

I don’t know exactly how ReXML works, but in Nokogiri you would do
something like this:

#-------------------------
require ‘nokogiri’

xml_string = ’

<?xml version="1.0" encoding="utf-8"?> ' doc = Nokogiri::XML.parse xml_string selected = doc.xpath '//event[@name="birthday"]' #-------------------------