@@ -99,16 +99,21 @@ Authors:
99
99
<table class =" table table-striped table-bordered" >
100
100
<!-- table head (possibly item-type-specific) -->
101
101
<thead >
102
- <xsl : apply-templates mode =' item-head' select =' key("oval-items", $items[1]/@item_id)' />
102
+ <xsl : apply-templates mode =' item-head' select =' key("oval-items", $items[1]/@item_id)' >
103
+ <xsl : with-param name =' resultColumn' select =' "true"' />
104
+ </xsl : apply-templates >
103
105
</thead >
104
106
105
107
<!-- table body (possibly item-type-specific) -->
106
108
<!-- limited to 100 lines -->
107
109
<tbody >
108
110
<xsl : for-each select =' $items' >
109
111
<xsl : if test =" not(position() > 100)" >
112
+ <xsl : variable name =" currentResult" select =" @result" />
110
113
<xsl : for-each select =' key("oval-items", @item_id)' >
111
- <xsl : apply-templates select =' .' mode =' item-body' />
114
+ <xsl : apply-templates select =' .' mode =' item-body' >
115
+ <xsl : with-param name =" result" select =" $currentResult" />
116
+ </xsl : apply-templates >
112
117
</xsl : for-each >
113
118
</xsl : if >
114
119
</xsl : for-each >
@@ -217,7 +222,9 @@ Authors:
217
222
<!-- generic item visualisation -->
218
223
219
224
<xsl : template mode =' item-head' match =' *' >
225
+ <xsl : param name =" resultColumn" select =" false" />
220
226
<tr >
227
+ <xsl : if test =' $resultColumn="true"' ><th >Result of item-state comparison</th ></xsl : if >
221
228
<xsl : for-each select =' *' >
222
229
<xsl : variable name =' label' select =' translate(local-name(), "_", " ")' />
223
230
<xsl : variable name =' first_letter' select =' translate(substring($label,1,1), "abcdefghijklmnopqrstuvwxyz", "ABCDEFGHIJKLMNOPQRSTUVWXYZ")' />
@@ -228,7 +235,22 @@ Authors:
228
235
</xsl : template >
229
236
230
237
<xsl : template mode =' item-body' match =' *' >
238
+ <xsl : param name =" result" />
231
239
<tr >
240
+ <td >
241
+ <xsl : choose >
242
+ <xsl : when test =" $result='true'" >
243
+ <span class =" label label-success" >
244
+ <xsl : value-of select =" $result" />
245
+ </span >
246
+ </xsl : when >
247
+ <xsl : otherwise >
248
+ <span class =" label label-danger" >
249
+ <xsl : value-of select =" $result" />
250
+ </span >
251
+ </xsl : otherwise >
252
+ </xsl : choose >
253
+ </td >
232
254
<xsl : for-each select =' *' >
233
255
<td >
234
256
<xsl : if test =' @datatype="int" or @datatype="boolean"' ><xsl : attribute name =' role' >num</xsl : attribute ></xsl : if >
@@ -241,12 +263,27 @@ Authors:
241
263
<!-- UNIX file item visualisation -->
242
264
243
265
<xsl : template mode =' item-head' match =' ovalunixsc:file_item' >
244
- <tr ><th >Path</th ><th >Type</th ><th >UID</th ><th >GID</th ><th >Size (B)</th ><th >Permissions</th ></tr >
266
+ <tr ><th >Result of item-state comparison</ th >< th > Path</th ><th >Type</th ><th >UID</th ><th >GID</th ><th >Size (B)</th ><th >Permissions</th ></tr >
245
267
</xsl : template >
246
268
247
269
<xsl : template mode =' item-body' match =' ovalunixsc:file_item' >
270
+ <xsl : param name =" result" />
248
271
<xsl : variable name =' path' select =' concat(ovalunixsc:path, "/", ovalunixsc:filename)' />
249
272
<tr >
273
+ <td >
274
+ <xsl : choose >
275
+ <xsl : when test =" $result='true'" >
276
+ <span class =" label label-success" >
277
+ <xsl : value-of select =" $result" />
278
+ </span >
279
+ </xsl : when >
280
+ <xsl : otherwise >
281
+ <span class =" label label-danger" >
282
+ <xsl : value-of select =" $result" />
283
+ </span >
284
+ </xsl : otherwise >
285
+ </xsl : choose >
286
+ </td >
250
287
<td ><xsl : value-of select =' $path' /></td >
251
288
<td ><xsl : value-of select =' ovalunixsc:type' /></td >
252
289
<td ><xsl : value-of select =' ovalunixsc:user_id' /></td >
@@ -289,12 +326,29 @@ Authors:
289
326
<!-- textfilecontent visualisation -->
290
327
291
328
<xsl : template mode =' item-head' match =' ovalindsc:textfilecontent_item' >
292
- <tr ><th >Path</th ><th >Content</th ></tr >
329
+ <tr ><th >Result of item-state comparison</ th >< th > Path</th ><th >Content</th ></tr >
293
330
</xsl : template >
294
331
295
332
<xsl : template mode =' item-body' match =' ovalindsc:textfilecontent_item' >
333
+ <xsl : param name =" result" />
296
334
<xsl : variable name =' path' select =' concat(ovalindsc:path, "/", ovalindsc:filename)' />
297
- <tr ><td ><xsl : value-of select =' $path' /></td ><td ><xsl : value-of select =' ovalindsc:text' /></td ></tr >
335
+ <tr >
336
+ <td >
337
+ <xsl : choose >
338
+ <xsl : when test =" $result='true'" >
339
+ <span class =" label label-success" >
340
+ <xsl : value-of select =" $result" />
341
+ </span >
342
+ </xsl : when >
343
+ <xsl : otherwise >
344
+ <span class =" label label-danger" >
345
+ <xsl : value-of select =" $result" />
346
+ </span >
347
+ </xsl : otherwise >
348
+ </xsl : choose >
349
+ </td >
350
+ <td ><xsl : value-of select =' $path' /></td ><td ><xsl : value-of select =' ovalindsc:text' /></td >
351
+ </tr >
298
352
</xsl : template >
299
353
300
354
</xsl : stylesheet >
0 commit comments