From: Dan Thomas Date: 2011-01-20T14:27:06+09:00 Subject: Re: edit xml file. Josh, Thank you for that unbelievably helpful and in-depth reply. The "editing xml" section of Nokogiri, is helpful, and I will experiment with that. So now that I am a little more clear I can ask better questions. Are you saying that in my post block, I should do something like: #this is defined globally $script = File.read("public/script.xml") post "/" do @xml = Nokogiri::XML($script) # read the nokogiri tutorial to learn how to search for the # thing that i want to change, and modify it, # i don't know how to do this yet @xml.blah # assume that worked and the Nokogiri object got modified # Save it back to the xml file. # I saw something like this, looks like it may save over the # original xml? @xml.to_xml # now that i've changed the xml, diplay the page again erb :index end OR, in an index_post erb file, should I be trying to change values sorta like this: <% current code %> <% animation_url =dialogue.search("property[name=animationUrl]").first.andand["value"]%> <% # my additional code suggestion. change the value based on user input dialogue.search("property[name=animationUrl]").first.andand["value"] = "some new value entered by user"%> and then somehow write this back to the xml? Again, thanks a ton. Hope this makes sense. -- Posted via http://www.ruby-forum.com/.