I have a script that I run for some vulnerability reports that parses and filters XML information into a handy table. I have used it for Nessus data in the past without issues. However, now we are utilizing Retina Vulnerability scanners that export an XML structure a little different.
I manipulated the XSL file to accomodate the XML for Retina, BUT, I am having issues displaying the correct data. For instance, I used to have an XML node called "<severity>" that was numerical (1 through 3). Now, with the new XML structure, the equivalent is called "<pciLevel>" and is not numeric but instead is like this "3 (High)". I was thinking that perhaps I should utilize the "<risk>" node instead to filter it, but then again, it is not numerical which I am used to.
I had a sort function working with just the numeric version, but with the alpha numeric result the sort function doesn't seem to want to display anything.
I have an IF statement in place "<xsl:if test="pciLevel > 1 (Low)">" which I assume is the culprit. But, then again, I have another field that filters a little more like this:
why don't you filter out everything that is not numerical from the pciLevel element
you can do that with a simple translate
translate(pciLevel, translate(picLevel, '0123456789', ''), '')
now all non numeric characters are removed
(high and low seem redundant to me)
and you can use the pciLevel element, exactly the same way as you did before with severity
well, your test should become
<xsl:if test="number(translate(pciLevel, translate(picLevel, '0123456789', ''), '')) > 1">
(simply ignore the "low")
and the sort
<xsl:sort select="number(translate(pciLevel, translate(picLevel, '0123456789', ''), '')) "/>
0
There are many ways to learn to code these days. From coding bootcamps like Flatiron School to online courses to totally free beginner resources. The best way to learn to code depends on many factors, but the most important one is you. See what course is best for you.
well, I assume you know better then I do where you want to sort based on the numerics in pciLevel
and I assume that you know better than I do where you need to test for a numeric in the pciLevel to be > 1
Preface
In the first article: A Better Website Login System (http://www.experts-exchange.com/A_2902.html) I introduced the EE Collaborative Login System and its intended purpose.
In this article I will discuss some of the design consideratio…
Originally, this post was published on Monitis Blog, you can check it
here
.
In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
The viewer will receive an overview of the basics of CSS showing inline styles.
In the head tags set up your style tags:
(CODE)
Reference the nav tag and set your properties.: (CODE)
Set the reference for the UL element and styles for it to ensu…
The viewer will learn the basics of jQuery, including how to invoke it on a web page.
Reference your jQuery libraries: (CODE)
Include your new external js/jQuery file: (CODE)
Write your first lines of code to setup your site for jQuery.: (CODE)