DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Saving A Nokogiri XML Document

02.04.2010
| 9001 views |
  • submit to reddit
        
require 'nokogiri'

Nokogiri.new()

buffer = File.open('deko6.svg','r').read
doc = Nokogiri::XML(buffer)
File.open('fudge.xml','w') {|f| doc.write_xml_to f}