Skip to content

Instantly share code, notes, and snippets.

@trek
Created July 12, 2009 15:30
Show Gist options
  • Save trek/145670 to your computer and use it in GitHub Desktop.
Save trek/145670 to your computer and use it in GitHub Desktop.
<html xmlns="http://www.w3.org/HTML/1998/html4" xmlns:xdc="http://www.internet.com/custom">
<head></head>
<body>
<p></p>
<xdc:user id='11'>
<div></div>
<foo></foo>
<xdc:name />
</xdc:user>
<xdc:employees />
</body>
</html>
require 'rubygems'
require 'nokogiri'
require 'open-uri'
xml = Nokogiri::XML(open('http://gist.github.com/raw/145670/9c3eb4ec252a7b592b01f41fc8961e7547485d52/ns.html'))
nodes = xml.xpath('//xdc:*', {'xdc' => 'http://www.internet.com/custom'})
nodes.each do |node|
puts node.name
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment