[PATCH 5/7] added xslt template to automatically insert current date into XCCDF * easier than manually inserting date?

Jeffrey Blank blank at eclipse.ncsc.mil
Tue Sep 4 23:16:34 UTC 2012


Signed-off-by: Jeffrey Blank <blank at eclipse.ncsc.mil>
---
 RHEL6/transforms/shorthand2xccdf.xslt |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/RHEL6/transforms/shorthand2xccdf.xslt b/RHEL6/transforms/shorthand2xccdf.xslt
index 69de585..9d0c083 100644
--- a/RHEL6/transforms/shorthand2xccdf.xslt
+++ b/RHEL6/transforms/shorthand2xccdf.xslt
@@ -1,7 +1,7 @@
 <?xml version="1.0"?>
 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
 xmlns:xccdf="http://checklists.nist.gov/xccdf/1.1"
-xmlns:xhtml="http://www.w3.org/1999/xhtml"
+xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:date="http://exslt.org/dates-and-times" extension-element-prefixes="date"
 exclude-result-prefixes="xccdf xhtml">
 
 <xsl:include href="constants.xslt"/>
@@ -21,6 +21,13 @@ exclude-result-prefixes="xccdf xhtml">
     </xsl:copy>
   </xsl:template>
 
+  <!-- insert current date -->
+  <xsl:template match="Benchmark/status/@date">
+    <xsl:attribute name="date">
+       <xsl:value-of select="date:date()"/>
+    </xsl:attribute>
+  </xsl:template>
+
   <!-- hack for OpenSCAP validation quirk: must place reference after description/warning, but prior to others -->
   <xsl:template match="Rule">
     <xsl:copy>
-- 
1.7.1



More information about the scap-security-guide mailing list