diff options
Diffstat (limited to 'lib/python/nvd.py')
-rw-r--r-- | lib/python/nvd.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/python/nvd.py b/lib/python/nvd.py index e7f421a..d457e04 100644 --- a/lib/python/nvd.py +++ b/lib/python/nvd.py @@ -32,7 +32,7 @@ class _Parser(xml.sax.handler.ContentHandler): self.result = {} self.start_dispatcher = {} for x in ('entry', 'local', 'range', 'network', 'local_network', 'user_init', - 'avail', 'conf', 'int', 'sec_prot', 'prod'): + 'avail', 'conf', 'int', 'sec_prot', 'prod', 'ref'): self.start_dispatcher[x] = getattr(self, 'TAG_' + x) self.path = [] @@ -88,6 +88,8 @@ class _Parser(xml.sax.handler.ContentHandler): = self.loss_sec_prot_other = 0 self.product_name = self.product_vendor = None + + self.refs = [] def TAG_range(self, name, attrs): self.range_local = self.range_local_network = self.range_network = self.range_user_init = 0 @@ -129,6 +131,9 @@ class _Parser(xml.sax.handler.ContentHandler): self.product_vendor = self.product_vendor.encode('utf-8') except KeyError: pass + def TAG_ref(self, name, attrs): + if attrs.has_key('url'): + self.refs.append(attrs['url']) def endElement(self, name): if name == 'entry': @@ -149,7 +154,8 @@ class _Parser(xml.sax.handler.ContentHandler): 'loss_sec_prot_admin': self.loss_sec_prot_admin, 'loss_sec_prot_other': self.loss_sec_prot_other, 'product_name': self.product_name, - 'product_vendor': self.product_vendor} + 'product_vendor': self.product_vendor, + 'refs' : self.refs} del self.path[-1] def characters(self, content): |