Created
June 4, 2010 22:25
-
-
Save anonymous/426022 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'nokogiri' | |
doc = Nokogiri::XML(open("news.rss")) | |
content_tag = Nokogiri::XML::Node.new "content", doc | |
content_tag.content = doc.create_cdata("<<<<") | |
doc.at("//item/description").add_next_sibling(content_tag) | |
doc.to_xml # CDATA gets converted to entities |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment