Sxml-Drill

(sxml-drill test ...) -> sxml or null.

SXML-Drill is a way to replicate 'query' functions.

Each test is applied to the result of the test before it.

With the following tests defined:

 (define (is-ip? sxml)
   (has-sxml-tag? sxml 'IP))

 (define (is-vulns? sxml)
       (has-sxml-tag? sxml 'VULNS))

 (define (is-cat? sxml)
   (has-sxml-tag? sxml 'CAT))

 (define (is-vuln? sxml)
       (has-sxml-tag? sxml 'VULN))

The tests are used like so:

(sxml-drill host-sxml is-vulns? is-cat? is-vuln?)

At the first level of host-sxml, is-vulns? is applied. This returns a list of SXML elements which have the VULNS tag, which is then passed to is-cat? -- which then returns a list of SXML elements that have the 'CAT tag. And so on, until we finally end up with a list of elements that have the 'VULN tag, whose parents have the CAT, VULNS, and IP tag consecutively. If any of the parents do not have these tags, it is not going to be returned.

See s-xml