Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unused XSLT xccdf2table-profileanssirefs.xslt #9659

Merged
merged 1 commit into from
Oct 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
122 changes: 2 additions & 120 deletions docs/manual/developer/03_creating_content.md
Original file line number Diff line number Diff line change
Expand Up @@ -525,125 +525,7 @@ cat << EOF >> $NEW_PRODUCT/transforms/xccdf2table-cce.xslt
EOF
```

14. Create a new file under `transforms` directory called `xccdf2table-profileanssirefs.xslt `:
```
cat << EOF >> $NEW_PRODUCT/transforms/xccdf2table-profileanssirefs.xslt
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cdf="http://checklists.nist.gov/xccdf/1.1" xmlns:xhtml="http://www.w3.org/1999/xhtml">

<!-- this style sheet expects parameter $profile, which is the id of the Profile to be shown -->

<xsl:include href="constants.xslt"/>
<xsl:include href="table-style.xslt"/>

<xsl:template match="/">
<html>
<head>
<title><xsl:value-of select="/cdf:Benchmark/cdf:Profile[@id=$profile]/cdf:title" /></title>
</head>
<body>
<br/>
<br/>
<div style="text-align: center; font-size: x-large; font-weight:bold"><xsl:value-of select="/cdf:Benchmark/cdf:Profile[@id=$profile]/cdf:title" /></div>
<br/>
<br/>
<xsl:apply-templates select="cdf:Benchmark"/>
</body>
</html>
</xsl:template>


<xsl:template match="cdf:Benchmark">
<xsl:call-template name="table-style" />

<table>
<thead>
<td>Rule Title</td>
<td>Description</td>
<td>Rationale</td>
<td>Variable Setting</td>
<td>ANSSI Best practice Mapping</td>
</thead>
<xsl:for-each select="/cdf:Benchmark/cdf:Profile[@id=$profile]/cdf:select">
<xsl:variable name="idrefer" select="@idref" />
<xsl:variable name="enabletest" select="@selected" />
<xsl:for-each select="//cdf:Rule">
<xsl:call-template name="ruleplate">
<xsl:with-param name="idreference" select="$idrefer" />
<xsl:with-param name="enabletest" select="$enabletest" />
</xsl:call-template>
</xsl:for-each>
</xsl:for-each>

</table>
</xsl:template>


<xsl:template match="cdf:Rule" name="ruleplate">
<xsl:param name="idreference" />
<xsl:param name="enabletest" />
<xsl:if test="@id=$idreference and $enabletest='true'">
<tr>
<td> <xsl:value-of select="cdf:title" /></td>
<td> <xsl:apply-templates select="cdf:description"/> </td>
<!-- call template to grab text and also child nodes (which should all be xhtml) -->
<td> <xsl:apply-templates select="cdf:rationale"/> </td>
<!-- need to resolve <sub idref=""> here -->
<td> <!-- TODO: print refine-value from profile associated with rule --> </td>
<td>
<xsl:for-each select="cdf:reference[@href=$anssiuri]">
<xsl:value-of select="text()"/>
<br/>
</xsl:for-each>
</td>
</tr>
</xsl:if>
</xsl:template>


<xsl:template match="cdf:check">
<xsl:for-each select="cdf:check-export">
<xsl:variable name="rulevar" select="@value-id" />
<!--<xsl:value-of select="$rulevar" />:-->
<xsl:for-each select="/cdf:Benchmark/cdf:Profile[@id=$profile]/cdf:refine-value">
<xsl:if test="@idref=$rulevar">
<xsl:value-of select="@selector" />
</xsl:if>
</xsl:for-each>
</xsl:for-each>
</xsl:template>


<!-- getting rid of XHTML namespace -->
<xsl:template match="xhtml:*">
<xsl:element name="{local-name()}">
<xsl:apply-templates select="node()|@*"/>
</xsl:element>
</xsl:template>

<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>

<xsl:template match="cdf:description">
<!-- print all the text and children (xhtml elements) of the description -->
<xsl:apply-templates select="@*|node()" />
</xsl:template>

<xsl:template match="cdf:rationale">
<!-- print all the text and children (xhtml elements) of the description -->
<xsl:apply-templates select="@*|node()" />
</xsl:template>



</xsl:stylesheet>
EOF
```

15. Create a new file under `transforms` directory called `xccdf2table-profileccirefs.xslt`:
14. Create a new file under `transforms` directory called `xccdf2table-profileccirefs.xslt`:
```
cat << EOF >> $NEW_PRODUCT/transforms/xccdf2table-profileccirefs.xslt
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
Expand All @@ -658,7 +540,7 @@ cat << EOF >> $NEW_PRODUCT/transforms/xccdf2table-profileccirefs.xslt
EOF
```

16. Create a new file under `shared/checks/oval` directory called `installed_OS_is_custom6.xml`:
15. Create a new file under `shared/checks/oval` directory called `installed_OS_is_custom6.xml`:
```
cat << EOF >> shared/checks/oval/installed_OS_is_$NEW_PRODUCT.xml
<def-group>
Expand Down
112 changes: 0 additions & 112 deletions products/alinux2/transforms/xccdf2table-profileanssirefs.xslt