Hello, I'm trying to get started with making the latest clone from the git repository and I get the following error:
[bpm]$ git clone http://git.fedorahosted.org/git/scap-security-guide.gitscap-security-guide Cloning into 'scap-security-guide'... remote: Counting objects: 14016, done. remote: Compressing objects: 100% (5257/5257), done. remote: Total 14016 (delta 10574), reused 10664 (delta 7718) Receiving objects: 100% (14016/14016), 3.18 MiB | 2.17 MiB/s, done. Resolving deltas: 100% (10574/10574), done.
[bpm]$ cd scap-security-guide/RHEL6/
[bpm]$ make all xsltproc -o output/rhel6-shorthand.xml input/guide.xslt input/guide.xml xmllint --format --output output/rhel6-shorthand.xml output/rhel6-shorthand.xml xsltproc -o output/unlinked-noprofiles-rhel6-xccdf.xml transforms/shorthand2xccdf.xslt output/rhel6-shorthand.xml compilation error: file transforms/shorthand2xccdf.xslt line 19 element attribute xsl:attribute: The attribute name 'xmlns' is not allowed. make: *** [shorthand2xccdf] Error 5
I've a fedora 18 , x86_64 installation.
Any ideas?
Thanks.
On 1/30/13 10:45 AM, Gary Gapinski wrote:
On 01/30/2013 10:09 AM, Brian Millett wrote:
Hello, I'm trying to get started with making the latest clone from the git repository and I get the following error:
xsltproc -o output/unlinked-noprofiles-rhel6-xccdf.xml transforms/shorthand2xccdf.xslt output/rhel6-shorthand.xml compilation error: file transforms/shorthand2xccdf.xslt line 19 element attribute xsl:attribute: The attribute name 'xmlns' is not allowed.
The construct it's complaining about is
12 <xsl:template match="Benchmark"> 13 <xsl:copy> 14 <xsl:attribute name="xmlns"> 15 <xsl:text>http://checklists.nist.gov/xccdf/1.1</xsl:text> 16 </xsl:attribute> 17 <xsl:apply-templates select="@*|node()" /> 18 </xsl:copy> 19 </xsl:template>
That is a valid (use of) attribute.
I can't produce this error using current repo on Ubuntu 12.10 and xsltproc 1.1.26-14. Ditto using <oXygen/> XML Editor 14.1 and its inbuilt xsltproc.
Unable to reproduce on RHEL6 through libxslt 1.1.26-2. Seems like a potential bug within fedora, I would report it within the Fedora BugZilla: https://bugzilla.redhat.com/enter_bug.cgi?product=Fedora
(Also note that we make absolutely no promises the content will work with anything but RHEL6, to include the build system itself)
On Wed, 30 Jan 2013 13:36:13 -0500 Gary Gapinski gapinski@nasa.gov wrote:
On 01/30/2013 12:49 PM, Gary Gapinski wrote: I agree. There is nothing wrong with the usage.
I was wrong.
See https://mail.gnome.org/archives/xslt/2012-September/msg00002.html and https://mail.gnome.org/archives/commits-list/2012-September/msg02486.html.
http://www.w3.org/TR/xslt#creating-attributes prohibits this.
http://www.w3.org/TR/xslt20/#creating-attributes says the same thing (I think), though with a lot more words.
Saxon 9 throws the same error.
The following avoids the error (however, the resulting file does not validate, but I think that's the case anyway). gapinski@gr2186815:~/Projects/scap-security-guide/RHEL6$ git diff 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:text>http://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 -->
gapinski@gr2186815:~/Projects/scap-security-guide/RHEL6$ The template becomes just
<!-- Content:template -->
<xsl:template match="Benchmark"> <xsl:element name="Benchmark" namespace="http://checklists.nist.gov/xccdf/1.1%22%3E <xsl:apply-templates select="@*|node()" /> </xsl:element> </xsl:template>
Thanks!! That worked like a charm!
On 01/30/2013 07:36 PM, Gary Gapinski wrote:
On 01/30/2013 12:49 PM, Gary Gapinski wrote:
I agree. There is nothing wrong with the usage.
I was wrong.
See https://mail.gnome.org/archives/xslt/2012-September/msg00002.html and https://mail.gnome.org/archives/commits-list/2012-September/msg02486.html.
http://www.w3.org/TR/xslt#creating-attributes prohibits this.
http://www.w3.org/TR/xslt20/#creating-attributes says the same thing (I think), though with a lot more words.
Saxon 9 throws the same error.
The following avoids the error (however, the resulting file does not validate, but I think that's the case anyway).
It does not validate because it pushes only the <Benchmark> element to the XCCDF namespace. All other elements remain in an empty namespace.
There seems to be no simple (XSLT) way how to put all the elements to a given namespace. Basically, each element needs to be refined with the XCCDF namespace. I prefer to do this in a separate XSL transformation (see the last patch, or ticket 202).
gapinski@gr2186815:~/Projects/scap-security-guide/RHEL6$ git diff 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:text>http://checklists.nist.gov/xccdf/1.1</xsl:text> - </xsl:attribute> + <xsl:element name="Benchmark" namespace="http://checklists.nist.gov/xccdf/1.1"> <xsl:apply-templates select="@*|node()" /> - </xsl:copy> + </xsl:element> </xsl:template> <!-- insert current date --> gapinski@gr2186815:~/Projects/scap-security-guide/RHEL6$
The template becomes just
<!-- Content:template --> <xsl:template match="Benchmark"> <xsl:element name="Benchmark" namespace="http://checklists.nist.gov/xccdf/1.1"> <xsl:apply-templates select="@*|node()" /> </xsl:element> </xsl:template>
scap-security-guide mailing list scap-security-guide@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/scap-security-guide
scap-security-guide@lists.fedorahosted.org