Signed-off-by: Jeffrey Blank <blank(a)eclipse.ncsc.mil>
---
RHEL6/transforms/table-add-vulnids.xslt | 10 +++++++++-
1 files changed, 9 insertions(+), 1 deletions(-)
diff --git a/RHEL6/transforms/table-add-vulnids.xslt
b/RHEL6/transforms/table-add-vulnids.xslt
index 5beb5cd..92f51e0 100644
--- a/RHEL6/transforms/table-add-vulnids.xslt
+++ b/RHEL6/transforms/table-add-vulnids.xslt
@@ -1,9 +1,17 @@
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:xhtml="http://www.w3.org/1999/xhtml">
<!-- this transform inserts a counter into the first column, as Vuln-ID placeholder
-->
+<!-- a unique Vuln-ID is assigned on a per-description basis (td[5]) -->
+
+<xsl:key name="rows-by-title" match="tr" use="td[5]"
/>
<xsl:template match="table/tr/td[1]" >
- <td>V-<xsl:value-of
select="count(../preceding-sibling::*)"/></td>
+ <!-- this (possibly witchcraft) will go away as soon as oscap's xccdf resolve
works -->
+ <!-- see
stackoverflow.com question 941662 for explanation -->
+ <td>V-<xsl:value-of select="count(
+ (.. | ../preceding-sibling::tr)[
+ count(. | key('rows-by-title', td[5])[1]) = 1
+ ])" /> </td>
</xsl:template>
--
1.7.1