Skip to content

Instantly share code, notes, and snippets.

@mperham
Created September 4, 2009 18:40
Show Gist options
  • Save mperham/181031 to your computer and use it in GitHub Desktop.
Save mperham/181031 to your computer and use it in GitHub Desktop.
Nokogiri::XML::Builder.new(:encoding => 'UTF-8') do |xml|
osa = xml.add_namespace_declaration('osa', "http://www.onespot.com/Atom/Extensions/1.0")
xml.feed :xmlns=>'http://www.w3.org/2005/Atom' do
xml.div :xmlns=>'http://www.w3.org/1999/xhtml', :class=>'info' do
xml.text "This is an Atom formatted XML site feed. It is intended to be viewed in a Newsreader or syndicated to another site."
end
xml.title 'feed title', :type=>"html"
xml.entry do
xml.title 'entry title', :type => "html"
xml.score 0.50, :namespace => osa ##### Want this to be an <osa:score> element
end
end
end.to_xml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment