Skip to content

Instantly share code, notes, and snippets.

@sprsquish
Created May 17, 2009 22:43
Show Gist options
  • Save sprsquish/113199 to your computer and use it in GitHub Desktop.
Save sprsquish/113199 to your computer and use it in GitHub Desktop.
n = Nokogiri::XML::Node.new('root', Nokogiri::XML::Document.new)
n << Nokogiri::XML::Node.new('child', n.document)
n << (c = Nokogiri::XML::Node.new('child', n.document))
c.default_namespace = 'foo:bar'
n.search './child', {'xmlns' => 'foo:bar'}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment