From: Noam P. <npo...@us...> - 2016-08-12 18:47:07
|
On Wed, Aug 10, 2016 at 9:36 AM, Gary Madarm <gm...@gm...> wrote: > I am trying to parse an XML file (https://static.nvd.nist.gov/ > feeds/xml/cve/nvdcve-2.0-2013.xml.gz) and access specific elements > (vuln:cve-id, cvss:score and cpe-lang:fact-ref). I've tried many different > variations of the command below but the result is always empty. How can I > access these values? There is a default namespace, see http://xmlstar.sourceforge.net/doc/UG/ch05.html Assuming a recent version of xmlstarlet (1.5+), you get the namespace definitions for free: xmlstarlet sel -t -v /_:nvd/_:entry/vuln:cve-id nvdcve-2.0-2013.xml |