libxslt 1.1.27 now (correctly) prohibits xsl:attribute with name="xmlns".
This change uses an explicit xsl:element with explicit namespace.
This change should be removed (in favor of just identity transform) when input document has desired explicit namespace declaration.
Gary Gapinski (1): Remove invalid attempt to use xsl:attribute to set xmlns. Replace with xsl:element with explicit namespace (namely, XCCDF 1.1). Note that this overrides any namespace set in input document. This should be removed when input document has explicit namespace declaration.
RHEL6/transforms/shorthand2xccdf.xslt | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)
Signed-off-by: Gary Gapinski gary@garygapinski.com --- RHEL6/transforms/shorthand2xccdf.xslt | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/RHEL6/transforms/shorthand2xccdf.xslt b/RHEL6/transforms/shorthand2xccdf.xslt index 507238e..59a0b53 100644 --- a/RHEL6/transforms/shorthand2xccdf.xslt +++ b/RHEL6/transforms/shorthand2xccdf.xslt @@ -15,12 +15,9 @@ exclude-result-prefixes="xccdf xhtml dc">
<!-- Content:template --> <xsl:template match="Benchmark"> - xsl:copy - <xsl:attribute name="xmlns"> - xsl:texthttp://checklists.nist.gov/xccdf/1.1</xsl:text> - </xsl:attribute> + <xsl:element name="Benchmark" namespace="http://checklists.nist.gov/xccdf/1.1%22%3E <xsl:apply-templates select="@*|node()" /> - </xsl:copy> + </xsl:element> </xsl:template>
<!-- insert current date -->
On 02/02/2013 04:24 AM, Gary Gapinski wrote:
libxslt 1.1.27 now (correctly) prohibits xsl:attribute with name="xmlns".
This change uses an explicit xsl:element with explicit namespace.
Sheesh.
I'm going to have to temporarily NACK this one as well.
I'm now looking at guide.xslt and shorthand2xccdf.xslt to figure out how to handle the abject absence of namespace declarations where at least a half dozen namespaces should have been used.
Had libxslt been correct prior to 1.1.27, this likely would have caused some regard to explicit namespace declaration. As it is, to paraphrase Twain on Cooper, the rules of XML namespace usage have been flung down and danced upon.
It also is not at all immediately obvious how XCCDF 1.2 (part of SCAP 1.2) can be accommodated, but it will undoubtedly require explicit namespacing at or prior to shorthand2xccdf.xslt.
I'm now looking at guide.xslt and shorthand2xccdf.xslt to figure out how to handle the abject absence of namespace declarations where at least a half dozen namespaces should have been used.
Had libxslt been correct prior to 1.1.27, this likely would have caused some regard to explicit namespace declaration. As it is, to paraphrase Twain on Cooper, the rules of XML namespace usage have been flung down and danced upon.
Ha! Not an inaccurate description of what I've done. I'm certainly open to other solutions which respect the goal of minimizing overhead on the content creator.
It also is not at all immediately obvious how XCCDF 1.2 (part of SCAP 1.2) can be accommodated, but it will undoubtedly require explicit namespacing at or prior to shorthand2xccdf.xslt.
I was thinking of the conversion to XCCDF 1.2 as an ultimate (and optional) step. I think the OpenSCAP guys have a script/transform to do it, in a fully automated fashion. Given what XCCDF 1.2 requires for the formatting of the Rule and Group id attribute, it'll have to be done per-output, using the $(ID) in the Makefile...
scap-security-guide@lists.fedorahosted.org