This is on the right track (and +1 for contributing XSLT!) but we really
want to be sure we're removing only the test data. It's likely that
dc:contributor or dc:date will occur in other elements of the document,
and we don't also want to remove those.
(In fact I believe the intro may contain our names at some point, as
dc:contributors!)
Could you try matching a template on something more precise, like
"xccdf:Rule/xccdf:reference[@href='test_attestation']" ?
I'm not if I've got the XPath quite right (namespaces, attribute etc)...
On 05/07/2013 03:38 PM, David Smith wrote:
---
RHEL6/transforms/xccdf-removetested.xslt | 23 +++++++++++++++++++++++
1 files changed, 23 insertions(+), 0 deletions(-)
create mode 100644 RHEL6/transforms/xccdf-removetested.xslt
diff --git a/RHEL6/transforms/xccdf-removetested.xslt
b/RHEL6/transforms/xccdf-removetested.xslt
new file mode 100644
index 0000000..e94f3da
--- /dev/null
+++ b/RHEL6/transforms/xccdf-removetested.xslt
@@ -0,0 +1,23 @@
+<?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:dc="http://purl.org/dc/elements/1.1/"
+xmlns:xhtml="http://www.w3.org/1999/xhtml"
exclude-result-prefixes="xccdf">
+
+<!-- This transform removes test contributor information from the XCCDF document.
-->
+
+
+ <!-- remove the test contributor name from final output -->
+ <xsl:template match="dc:contributor">
+ </xsl:template>
+
+ <!-- remove the test contribution date from final output -->
+ <xsl:template match="dc:date">
+ </xsl:template>
+
+ <!-- copy everything else through to final output -->
+ <xsl:template match="@*|node()">
+ <xsl:copy>
+ <xsl:apply-templates select="@*|node()" />
+ </xsl:copy>
+ </xsl:template>
+
+</xsl:stylesheet>