Skip to content

Commit cfad5b2

Browse files
committed
fixing 'object does not exist' report template
1 parent cc40a14 commit cfad5b2

File tree

1 file changed

+28
-23
lines changed

1 file changed

+28
-23
lines changed

xsl/xccdf-report-oval-details.xsl

Lines changed: 28 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -146,23 +146,10 @@ Authors:
146146
</thead>
147147
<tbody>
148148
<tr>
149-
<xsl:variable name='variable_id' select='$object_info/*/@var_ref'/>
150-
<xsl:if test='$variable_id'>
151-
<td>
152-
<xsl:choose>
153-
<xsl:when test='count(ovalres:tested_variable)>1'>
154-
<table>
155-
<xsl:apply-templates mode='tableintable' select='ovalres:tested_variable'/>
156-
</table>
157-
</xsl:when>
158-
<xsl:when test='count(ovalres:tested_variable)=1'>
159-
<xsl:apply-templates mode='normal' select='ovalres:tested_variable'/>
160-
</xsl:when>
161-
</xsl:choose>
162-
<xsl:apply-templates mode='message' select='key("ovalsys-object",$object_id)'/>
163-
</td>
164-
</xsl:if>
165-
<xsl:apply-templates mode='object' select='$object_info[1]'/>
149+
<xsl:apply-templates mode='object' select='$object_info[1]'>
150+
<xsl:with-param name="tested_var" select="ovalres:tested_variable"/>
151+
<xsl:with-param name="object_id" select="$object_id"/>
152+
</xsl:apply-templates>
166153
</tr>
167154
</tbody>
168155
</table>
@@ -188,13 +175,31 @@ Authors:
188175
</xsl:template>
189176

190177
<xsl:template mode='object' match='*[starts-with(namespace-uri(), "http://oval.mitre.org/XMLSchema/oval-definitions") and contains(local-name(), "_object")]'>
178+
<xsl:param name="tested_var"/>
179+
<xsl:param name="object_id"/>
180+
191181
<xsl:for-each select='*'>
192-
<xsl:if test='not(*) and not(normalize-space()) and not(@var_ref)'><td>no value</td></xsl:if>
193-
<xsl:if test='* or normalize-space()'>
194-
<td>
195-
<xsl:value-of select='.'/>
196-
</td>
197-
</xsl:if>
182+
<td>
183+
<xsl:choose>
184+
<xsl:when test="@var_ref">
185+
<xsl:choose>
186+
<xsl:when test="count($tested_var) > 1">
187+
<table>
188+
<xsl:apply-templates mode='tableintable' select="$tested_var"/>
189+
</table>
190+
</xsl:when>
191+
<xsl:otherwise>
192+
<xsl:apply-templates mode='normal' select="$tested_var"/>
193+
</xsl:otherwise>
194+
</xsl:choose>
195+
<xsl:apply-templates mode='message' select='key("ovalsys-object", $object_id)'/>
196+
</xsl:when>
197+
198+
<xsl:otherwise>
199+
<xsl:value-of select="."/>
200+
</xsl:otherwise>
201+
</xsl:choose>
202+
</td>
198203
</xsl:for-each>
199204
</xsl:template>
200205

0 commit comments

Comments
 (0)