This has already been pushed, as it's a bugfix.
Jeffrey Blank (1):
bugfix for dropping SRGs (lacking Rules which reference them) from
flat table output
RHEL6/transforms/shorthand2xccdf.xslt | 2 +-
RHEL6/transforms/table-srgmap.xslt | 10 +++++-----
2 files changed, 6 insertions(+), 6 deletions(-)
Show replies by date
Signed-off-by: Jeffrey Blank <blank(a)eclipse.ncsc.mil>
---
RHEL6/transforms/shorthand2xccdf.xslt | 2 +-
RHEL6/transforms/table-srgmap.xslt | 10 +++++-----
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/RHEL6/transforms/shorthand2xccdf.xslt
b/RHEL6/transforms/shorthand2xccdf.xslt
index 4f71b53..708e593 100644
--- a/RHEL6/transforms/shorthand2xccdf.xslt
+++ b/RHEL6/transforms/shorthand2xccdf.xslt
@@ -151,7 +151,7 @@ exclude-result-prefixes="xccdf xhtml dc">
<xsl:value-of select="$disa-cciuri" />
</xsl:if>
</xsl:attribute>
- <xsl:value-of select="$refitem" />
+ <xsl:value-of select="normalize-space($refitem)" />
</reference>
</xsl:template>
diff --git a/RHEL6/transforms/table-srgmap.xslt b/RHEL6/transforms/table-srgmap.xslt
index 872adfc..8be0e55 100644
--- a/RHEL6/transforms/table-srgmap.xslt
+++ b/RHEL6/transforms/table-srgmap.xslt
@@ -7,7 +7,6 @@
"flat", then it will output a separate row for every Rule which satisfies
an SRG requirement. -->
<xsl:param name="flat" select="''"/>
-
<xsl:include href="constants.xslt"/>
<!-- expecting external variable "map-to-items", a filename to an XCCDF
document with Rules and Groups -->
@@ -33,7 +32,6 @@
</html>
</xsl:template>
-
<xsl:template match="cdf:Benchmark">
<style type="text/css">
table
@@ -72,10 +70,14 @@
</thead>
<xsl:for-each select=".//cdf:Rule">
<xsl:sort select="cdf:version"/>
+
+ <xsl:variable name="curr_cci"
select="string(number(substring-after(cdf:ident,'CCI-')))"/>
<xsl:choose>
- <xsl:when test="$flat">
+ <!-- output multiple rows if we're in flat mode and at least one ref exists
-->
+ <xsl:when test="$flat and $items/cdf:reference[@href=$disa-cciuri and
text()=$curr_cci]">
<xsl:call-template name="output-rows-flat"> <xsl:with-param
name="rule" select="."/> </xsl:call-template>
</xsl:when>
+ <!-- otherwise output a row with all (and possibly zero) Rules in nested tables
-->
<xsl:otherwise>
<xsl:call-template name="output-row-nested"> <xsl:with-param
name="rule" select="."/> </xsl:call-template>
</xsl:otherwise>
@@ -124,7 +126,6 @@
<!-- iterate over the items (everything with references) in the
(externally-provided) XCCDF document -->
<xsl:for-each select="$items">
<xsl:variable name="item" select="."/>
- <xsl:if test="cdf:reference[@href=$disa-cciuri]" >
<xsl:for-each select="cdf:reference[@href=$disa-cciuri]">
<xsl:variable name="cci_formatted"
select='format-number(self::node()[text()], "000000")' />
<xsl:variable name="cci_expanded" select="concat('CCI-',
$cci_formatted)" />
@@ -145,7 +146,6 @@
</tr>
</xsl:if>
</xsl:for-each>
- </xsl:if>
</xsl:for-each>
</xsl:template>
--
1.7.1