Skip to content

Instantly share code, notes, and snippets.

@johnlinvc
Created March 9, 2016 07:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save johnlinvc/8fa67def1cbbfbd470ac to your computer and use it in GitHub Desktop.
Save johnlinvc/8fa67def1cbbfbd470ac to your computer and use it in GitHub Desktop.
require 'nokogiri'
str = <<END
<cve xmlns:xsi="xxx">
<member>yyy</member>
</cve>
END
doc = Nokogiri::XML(str)
cve = doc.xpath("//cve")[0]
namespaces = cve.namespaces
p namespaces["xmlns:xsi"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment