We will make this smoother soon, but right now you have to manually parse your new xml as a Nokogiri XML Document and then put the Nokogiri Document in the datastream’s ng_xml attribute.
Example (you will have to change the path to point to the xml file you want)
my_path = "../om/spec/fixtures/mods_articles/hydrangea_article1.xml" f = File.new(my_path) xml = Nokogiri::XML::Document.parse(f) ha = HydrangeaArticle.new ha.datastreams["descMetadata"].to_xml ha.datastreams["descMetadata"].ng_xml = xml ha.datastreams["descMetadata"].to_xml
In order to make sure that your updated datastream is saved to fedora, call .save on the datastream. If you call .save on the object, the changes you’ve made to the datastream might not be saved.
ha.datastreams["descMetadata"].save