| 1 |
<?xml version="1.0" encoding="utf-8" ?> |
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
<xsl:stylesheet version="1.1" |
| 26 |
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" |
| 27 |
xmlns:cdf="http://checklists.nist.gov/xccdf/1.2" |
| 28 |
exclude-result-prefixes="xsl cdf"> |
| 29 |
|
| 30 |
<xsl:include href="xccdf-guide-impl.xsl" /> |
| 31 |
|
| 32 |
<xsl:param name="benchmark_id"/> |
| 33 |
<xsl:param name="profile_id"/> |
| 34 |
|
| 35 |
|
| 36 |
<xsl:template match="/"> |
| 37 |
<xsl:variable name="final_benchmark_id"> |
| 38 |
<xsl:choose> |
| 39 |
<xsl:when test="$benchmark_id"> |
| 40 |
<xsl:value-of select="$benchmark_id"/> |
| 41 |
</xsl:when> |
| 42 |
<xsl:otherwise> |
| 43 |
<xsl:if test="$verbosity"> |
| 44 |
<xsl:message>The 'benchmark_id' parameter was not supplied. Using the first cdf:Benchmark found!</xsl:message> |
| 45 |
</xsl:if> |
| 46 |
<xsl:value-of select="//cdf:Benchmark[1]/@id"/> |
| 47 |
</xsl:otherwise> |
| 48 |
</xsl:choose> |
| 49 |
</xsl:variable> |
| 50 |
|
| 51 |
<xsl:variable name="benchmark" select="//cdf:Benchmark[@id = $final_benchmark_id][1]"/> |
| 52 |
|
| 53 |
|
| 54 |
<xsl:if test="not($benchmark)"> |
| 55 |
<xsl:choose> |
| 56 |
<xsl:when test="$benchmark_id"> |
| 57 |
<xsl:message terminate="yes">No such cdf:Benchmark exists (with @id = "<xsl:value-of select="$benchmark_id"/>")</xsl:message> |
| 58 |
</xsl:when> |
| 59 |
<xsl:otherwise> |
| 60 |
<xsl:message terminate="yes">No cdf:Benchmark ID specified and no suitable candidate has been autodetected.</xsl:message> |
| 61 |
</xsl:otherwise> |
| 62 |
</xsl:choose> |
| 63 |
</xsl:if> |
| 64 |
|
| 65 |
<xsl:if test="$verbosity"> |
| 66 |
<xsl:message>Benchmark ID: <xsl:value-of select="$final_benchmark_id"/></xsl:message> |
| 67 |
<xsl:choose> |
| 68 |
<xsl:when test="$profile_id"> |
| 69 |
<xsl:message>Profile ID: <xsl:value-of select="$profile_id"/></xsl:message> |
| 70 |
</xsl:when> |
| 71 |
<xsl:otherwise> |
| 72 |
<xsl:message>Profile: (default)</xsl:message> |
| 73 |
</xsl:otherwise> |
| 74 |
</xsl:choose> |
| 75 |
</xsl:if> |
| 76 |
|
| 77 |
<xsl:call-template name="generate-guide"> |
| 78 |
<xsl:with-param name="benchmark" select="$benchmark"/> |
| 79 |
<xsl:with-param name="profile_id" select="$profile_id"/> |
| 80 |
</xsl:call-template> |
| 81 |
</xsl:template> |
| 82 |
|
| 83 |
</xsl:stylesheet> |