Merge pull request #40 from radicallyopensecurity/execsummaryfix
Exec summary fix
This commit is contained in:
commit
9d1002ec6d
@ -56,7 +56,7 @@ the Free Software Foundation, either version 3 of the License, or
|
||||
help='overwrite output file if it already exists')
|
||||
parser.add_argument('-date', action='store',
|
||||
help='the invoice date')
|
||||
parser.add_argument('-execsummary', action='store',
|
||||
parser.add_argument('-execsummary', action='store_true',
|
||||
help="""create an executive summary as well as a report (true/false).
|
||||
Default: false """)
|
||||
parser.add_argument('--fop-config', action='store',
|
||||
@ -151,7 +151,7 @@ def to_fo(options):
|
||||
if options['date']:
|
||||
cmd.append('DATE=' + options['date'])
|
||||
if options['execsummary']:
|
||||
cmd.append('EXEC_SUMMARY=' + options['execsummary'])
|
||||
cmd.append('EXEC_SUMMARY=true')
|
||||
process = subprocess.Popen(cmd, stdout=PIPE, stderr=PIPE)
|
||||
stdout, stderr = process.communicate()
|
||||
print_output(stdout, stderr)
|
||||
@ -234,7 +234,7 @@ def main():
|
||||
except OSError as exception:
|
||||
print_exit('[-] ERR: {0}'.format(exception.strerror),
|
||||
exception.errno)
|
||||
if options['execsummary'] == 'true': # we're generating a summary as well as a report
|
||||
if options['execsummary'] == True: # we're generating a summary as well as a report
|
||||
report_output = options['output']
|
||||
verboseprint('generating additional executive summary')
|
||||
output_dir = os.path.dirname(options['output'])
|
||||
@ -260,4 +260,4 @@ def main():
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
main()
|
||||
@ -58,7 +58,9 @@
|
||||
<fo:root>
|
||||
|
||||
<xsl:call-template name="layout-master-set"/>
|
||||
<xsl:call-template name="Content"/>
|
||||
<xsl:call-template name="Content">
|
||||
<xsl:with-param name="execsummary" select="false()" tunnel="yes"/>
|
||||
</xsl:call-template>
|
||||
|
||||
</fo:root>
|
||||
</xsl:template>
|
||||
|
||||
@ -49,7 +49,9 @@
|
||||
<fo:root xsl:use-attribute-sets="root-common">
|
||||
|
||||
<xsl:call-template name="layout-master-set"/>
|
||||
<xsl:call-template name="Content"/>
|
||||
<xsl:call-template name="Content">
|
||||
<xsl:with-param name="execsummary" select="false()" tunnel="yes"/>
|
||||
</xsl:call-template>
|
||||
|
||||
</fo:root>
|
||||
</xsl:template>
|
||||
|
||||
@ -38,7 +38,9 @@
|
||||
<!-- Invoice is generated straight from offerte -->
|
||||
<fo:root>
|
||||
<xsl:call-template name="layout-master-set"/>
|
||||
<xsl:call-template name="Content"/>
|
||||
<xsl:call-template name="Content">
|
||||
<xsl:with-param name="execsummary" select="false()" tunnel="yes"/>
|
||||
</xsl:call-template>
|
||||
</fo:root>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
@ -69,7 +69,9 @@
|
||||
<fo:root>
|
||||
|
||||
<xsl:call-template name="layout-master-set"/>
|
||||
<xsl:call-template name="Content"/>
|
||||
<xsl:call-template name="Content">
|
||||
<xsl:with-param name="execsummary" select="false()" tunnel="yes"/>
|
||||
</xsl:call-template>
|
||||
|
||||
</fo:root>
|
||||
</xsl:template>
|
||||
|
||||
@ -59,7 +59,9 @@
|
||||
<!-- Invoice is generated straight from offerte -->
|
||||
<fo:root>
|
||||
<xsl:call-template name="layout-master-set"/>
|
||||
<xsl:call-template name="Content"/>
|
||||
<xsl:call-template name="Content">
|
||||
<xsl:with-param name="execsummary" select="false()" tunnel="yes"/>
|
||||
</xsl:call-template>
|
||||
</fo:root>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
@ -58,26 +58,28 @@
|
||||
<!-- ROOT -->
|
||||
<xsl:template match="/">
|
||||
|
||||
<xsl:choose>
|
||||
<xsl:when test="$EXEC_SUMMARY = true()">
|
||||
<xsl:if test="$EXEC_SUMMARY = true()">
|
||||
<xsl:result-document href="../target/execsummary.fo">
|
||||
<fo:root xsl:use-attribute-sets="root-common">
|
||||
|
||||
<xsl:call-template name="layout-master-set"/>
|
||||
<xsl:call-template name="Content"/>
|
||||
<xsl:call-template name="Content">
|
||||
<xsl:with-param name="execsummary" select="true()" tunnel="yes"/>
|
||||
</xsl:call-template>
|
||||
|
||||
</fo:root>
|
||||
</xsl:result-document>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
</xsl:if>
|
||||
<fo:root xsl:use-attribute-sets="root-common">
|
||||
|
||||
<xsl:call-template name="layout-master-set"/>
|
||||
<xsl:call-template name="Content"/>
|
||||
<xsl:call-template name="Content">
|
||||
<xsl:with-param name="execsummary" select="false()" tunnel="yes"/>
|
||||
</xsl:call-template>
|
||||
|
||||
</fo:root>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
|
||||
|
||||
</xsl:template>
|
||||
|
||||
|
||||
|
||||
@ -4,6 +4,7 @@
|
||||
xmlns:fo="http://www.w3.org/1999/XSL/Format" version="2.0">
|
||||
|
||||
<xsl:template match="a">
|
||||
<xsl:param name="execsummary" tunnel="yes"/>
|
||||
<xsl:variable name="destination">
|
||||
<xsl:choose>
|
||||
<xsl:when test="starts-with(@href, '#')">
|
||||
@ -20,7 +21,7 @@
|
||||
DOCUMENT</fo:inline>
|
||||
</xsl:when>
|
||||
<xsl:when
|
||||
test="(starts-with(@href, '#') and //*[@id = $destination][ancestor-or-self::*[@visibility = 'hidden']]) or (starts-with(@href, '#') and $EXEC_SUMMARY=true() and //*[@id = $destination][ancestor-or-self::*[not(@inexecsummary='yes')]])">
|
||||
test="(starts-with(@href, '#') and //*[@id = $destination][ancestor-or-self::*[@visibility = 'hidden']]) or (starts-with(@href, '#') and $execsummary=true() and //*[@id = $destination][ancestor-or-self::*[not(@inexecsummary='yes')]])">
|
||||
<fo:inline xsl:use-attribute-sets="errortext">WARNING: LINK TARGET IS
|
||||
HIDDEN</fo:inline>
|
||||
</xsl:when>
|
||||
|
||||
@ -5,6 +5,7 @@
|
||||
version="2.0">
|
||||
|
||||
<xsl:template match="meta">
|
||||
<xsl:param name="execsummary" tunnel="yes"/>
|
||||
<xsl:variable name="latestVersionNumber">
|
||||
<xsl:for-each select="version_history/version">
|
||||
<xsl:sort select="xs:dateTime(@date)" order="descending"/>
|
||||
@ -20,7 +21,7 @@
|
||||
</fo:block>
|
||||
<fo:block xsl:use-attribute-sets="title-0">
|
||||
<xsl:choose>
|
||||
<xsl:when test="$EXEC_SUMMARY=true()">
|
||||
<xsl:when test="$execsummary=true()">
|
||||
<xsl:text>PENETRATION TEST MANAGEMENT SUMMARY</xsl:text>
|
||||
</xsl:when>
|
||||
<xsl:otherwise><xsl:value-of select="upper-case(title)"/></xsl:otherwise>
|
||||
@ -61,6 +62,7 @@
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="DocProperties">
|
||||
<xsl:param name="execsummary" tunnel="yes"/>
|
||||
<xsl:variable name="latestVersionNumber">
|
||||
<xsl:for-each select="version_history/version">
|
||||
<xsl:sort select="xs:dateTime(@date)" order="descending"/>
|
||||
@ -96,7 +98,7 @@
|
||||
<fo:table-cell xsl:use-attribute-sets="td">
|
||||
<fo:block>
|
||||
<xsl:choose>
|
||||
<xsl:when test="$EXEC_SUMMARY=true()">
|
||||
<xsl:when test="$execsummary=true()">
|
||||
<xsl:text>PENETRATION TEST MANAGEMENT SUMMARY</xsl:text>
|
||||
</xsl:when>
|
||||
<xsl:otherwise><xsl:value-of select="upper-case(title)"/></xsl:otherwise>
|
||||
|
||||
@ -36,8 +36,9 @@
|
||||
<xsl:template
|
||||
match="section[not(@visibility = 'hidden')] | appendix[not(@visibility = 'hidden')]"
|
||||
mode="number">
|
||||
<xsl:param name="execsummary" tunnel="yes"/>
|
||||
<xsl:choose>
|
||||
<xsl:when test="$EXEC_SUMMARY = true()">
|
||||
<xsl:when test="$execsummary = true()">
|
||||
<xsl:choose>
|
||||
<xsl:when test="self::appendix">
|
||||
<fo:inline> Appendix <xsl:number
|
||||
|
||||
@ -4,9 +4,10 @@
|
||||
xmlns:fo="http://www.w3.org/1999/XSL/Format" version="2.0">
|
||||
|
||||
<xsl:template match="section | appendix | finding | non-finding | annex">
|
||||
<xsl:param name="execsummary" tunnel="yes"/>
|
||||
<xsl:if test="not(@visibility = 'hidden')">
|
||||
<xsl:choose>
|
||||
<xsl:when test="$EXEC_SUMMARY = true()">
|
||||
<xsl:when test="$execsummary = true()">
|
||||
<xsl:if test="ancestor-or-self::*/@inexecsummary = 'yes'">
|
||||
<fo:block xsl:use-attribute-sets="section">
|
||||
<xsl:if test="self::appendix or self::annex">
|
||||
@ -29,6 +30,7 @@
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="title[not(parent::biblioentry)]">
|
||||
<xsl:param name="execsummary" tunnel="yes"/>
|
||||
<xsl:variable name="LEVEL" select="count(ancestor::*) - 1"/>
|
||||
<xsl:variable name="CLASS">
|
||||
<!-- use title-x for all levels -->
|
||||
@ -41,7 +43,7 @@
|
||||
<xsl:with-param name="CLASS" select="$CLASS"/>
|
||||
</xsl:call-template>
|
||||
<xsl:choose>
|
||||
<xsl:when test="$EXEC_SUMMARY = true()">
|
||||
<xsl:when test="$execsummary = true()">
|
||||
<xsl:choose>
|
||||
<xsl:when test="self::title[parent::appendix]">
|
||||
<fo:inline> Appendix <xsl:number
|
||||
|
||||
@ -1,53 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xmlns:fo="http://www.w3.org/1999/XSL/Format" exclude-result-prefixes="xs" version="2.0">
|
||||
|
||||
|
||||
<xsl:import href="pages.xslt"/>
|
||||
<xsl:import href="summary.xslt"/>
|
||||
<xsl:import href="toc.xslt"/>
|
||||
<xsl:import href="structure.xslt"/>
|
||||
<xsl:import href="att-set.xslt"/>
|
||||
<xsl:import href="block.xslt"/>
|
||||
<xsl:import href="findings.xslt"/>
|
||||
<xsl:import href="auto.xslt"/>
|
||||
<xsl:import href="table.xslt"/>
|
||||
<xsl:import href="lists.xslt"/>
|
||||
<xsl:import href="inline.xslt"/>
|
||||
<xsl:import href="graphics.xslt"/>
|
||||
<xsl:import href="generic.xslt"/>
|
||||
<xsl:import href="numbering.xslt"/>
|
||||
|
||||
<xsl:include href="styles_rep.xslt"/>
|
||||
|
||||
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
|
||||
|
||||
|
||||
<!-- ****** AUTO_NUMBERING_FORMAT: value of the <xsl:number> element used for auto numbering -->
|
||||
<xsl:param name="AUTO_NUMBERING_FORMAT" select="'1.1.1'"/>
|
||||
|
||||
<xsl:key name="rosid" match="section|finding|appendix|non-finding" use="@id"/>
|
||||
|
||||
<xsl:variable name="CLASSES" select="document('../xslt/styles_rep.xslt')/*/xsl:attribute-set"/>
|
||||
|
||||
<xsl:variable name="latestVersionDate">
|
||||
<xsl:for-each select="/*/meta/version_history/version">
|
||||
<xsl:sort select="xs:dateTime(@date)" order="descending"/>
|
||||
<xsl:if test="position() = 1">
|
||||
<xsl:value-of select="format-dateTime(@date, '[MNn] [D1o], [Y]', 'en', (), ())"/>
|
||||
</xsl:if>
|
||||
</xsl:for-each>
|
||||
</xsl:variable>
|
||||
<!-- ROOT -->
|
||||
<xsl:template match="/">
|
||||
|
||||
<fo:root>
|
||||
<xsl:call-template name="layout-master-set"/>
|
||||
<xsl:call-template name="Content"/>
|
||||
|
||||
</fo:root>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
</xsl:stylesheet>
|
||||
@ -1,339 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
||||
exclude-result-prefixes="xs" xmlns:fo="http://www.w3.org/1999/XSL/Format"
|
||||
version="2.0">
|
||||
|
||||
<xsl:template match="meta">
|
||||
<xsl:variable name="latestVersionDate">
|
||||
<xsl:for-each select="version_history/version">
|
||||
<xsl:sort select="xs:dateTime(@date)" order="descending"/>
|
||||
<xsl:if test="position() = 1">
|
||||
<xsl:value-of select="format-dateTime(@date, '[MNn] [D1o], [Y]', 'en', (), ())"/>
|
||||
</xsl:if>
|
||||
</xsl:for-each>
|
||||
</xsl:variable>
|
||||
<xsl:variable name="latestVersionNumber">
|
||||
<xsl:for-each select="version_history/version">
|
||||
<xsl:sort select="xs:dateTime(@date)" order="descending"/>
|
||||
<xsl:if test="position() = 1">
|
||||
<xsl:call-template name="VersionNumber">
|
||||
<xsl:with-param name="number" select="@number"/>
|
||||
</xsl:call-template>
|
||||
</xsl:if>
|
||||
</xsl:for-each>
|
||||
</xsl:variable>
|
||||
<fo:block xsl:use-attribute-sets="graphics-block">
|
||||
<fo:external-graphic xsl:use-attribute-sets="logo"/>
|
||||
</fo:block>
|
||||
<fo:block xsl:use-attribute-sets="title-0">
|
||||
<xsl:value-of select="upper-case(title)"/>
|
||||
</fo:block>
|
||||
<fo:block xsl:use-attribute-sets="for">
|
||||
<xsl:text>for</xsl:text>
|
||||
</fo:block>
|
||||
<fo:block xsl:use-attribute-sets="title-client">
|
||||
<xsl:value-of select="client/full_name"/>
|
||||
</fo:block>
|
||||
<fo:block break-after="page">
|
||||
<fo:table width="100%" table-layout="fixed">
|
||||
<fo:table-column column-width="proportional-column-width(66)"/>
|
||||
<fo:table-column column-width="proportional-column-width(33)"/>
|
||||
<fo:table-body>
|
||||
<fo:table-row>
|
||||
<fo:table-cell>
|
||||
<fo:block/>
|
||||
</fo:table-cell>
|
||||
<fo:table-cell text-align="left">
|
||||
<fo:block> V<xsl:value-of select="$latestVersionNumber"/>
|
||||
</fo:block>
|
||||
<fo:block>
|
||||
<xsl:text>Amsterdam,</xsl:text>
|
||||
</fo:block>
|
||||
<fo:block>
|
||||
<xsl:value-of select="$latestVersionDate"/>
|
||||
</fo:block>
|
||||
</fo:table-cell>
|
||||
</fo:table-row>
|
||||
</fo:table-body>
|
||||
</fo:table>
|
||||
</fo:block>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="DocProperties">
|
||||
<xsl:variable name="latestVersionNumber">
|
||||
<xsl:for-each select="version_history/version">
|
||||
<xsl:sort select="xs:dateTime(@date)" order="descending"/>
|
||||
<xsl:if test="position() = 1">
|
||||
<xsl:call-template name="VersionNumber">
|
||||
<xsl:with-param name="number" select="@number"/>
|
||||
</xsl:call-template>
|
||||
</xsl:if>
|
||||
</xsl:for-each>
|
||||
</xsl:variable>
|
||||
<xsl:variable name="authors" select="version_history/version/v_author[not(.=../preceding::version/v_author)]" />
|
||||
<fo:block xsl:use-attribute-sets="title-4">Document Properties</fo:block>
|
||||
<fo:block margin-bottom="{$very-large-space}">
|
||||
<fo:table width="100%" table-layout="fixed" xsl:use-attribute-sets="borders">
|
||||
<fo:table-column column-width="proportional-column-width(25)"
|
||||
xsl:use-attribute-sets="bg-orange borders"/>
|
||||
<fo:table-column column-width="proportional-column-width(75)"/>
|
||||
<fo:table-body>
|
||||
<fo:table-row xsl:use-attribute-sets="borders">
|
||||
<fo:table-cell xsl:use-attribute-sets="td">
|
||||
<fo:block>Client</fo:block>
|
||||
</fo:table-cell>
|
||||
<fo:table-cell xsl:use-attribute-sets="td">
|
||||
<fo:block>
|
||||
<xsl:value-of select="client/full_name"/>
|
||||
</fo:block>
|
||||
</fo:table-cell>
|
||||
</fo:table-row>
|
||||
<fo:table-row xsl:use-attribute-sets="borders">
|
||||
<fo:table-cell xsl:use-attribute-sets="td">
|
||||
<fo:block>Title</fo:block>
|
||||
</fo:table-cell>
|
||||
<fo:table-cell xsl:use-attribute-sets="td">
|
||||
<fo:block>
|
||||
<xsl:value-of select="title"/>
|
||||
</fo:block>
|
||||
</fo:table-cell>
|
||||
</fo:table-row>
|
||||
<fo:table-row xsl:use-attribute-sets="borders">
|
||||
<fo:table-cell xsl:use-attribute-sets="td">
|
||||
<fo:block>Target<xsl:if test="targets/target[2]">s</xsl:if>
|
||||
</fo:block>
|
||||
</fo:table-cell>
|
||||
<fo:table-cell xsl:use-attribute-sets="td">
|
||||
<fo:block>
|
||||
<xsl:choose>
|
||||
<xsl:when test="targets/target[2]">
|
||||
<!-- more than one target -->
|
||||
<xsl:for-each select="targets/target">
|
||||
<fo:block>
|
||||
<xsl:value-of select="."/>
|
||||
</fo:block>
|
||||
</xsl:for-each>
|
||||
<!-- end list -->
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<!-- just the one -->
|
||||
<xsl:value-of select="targets/target"/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</fo:block>
|
||||
</fo:table-cell>
|
||||
</fo:table-row>
|
||||
<fo:table-row xsl:use-attribute-sets="borders">
|
||||
<fo:table-cell xsl:use-attribute-sets="td">
|
||||
<fo:block>Version</fo:block>
|
||||
</fo:table-cell>
|
||||
<fo:table-cell xsl:use-attribute-sets="td">
|
||||
<fo:block>
|
||||
<xsl:value-of select="$latestVersionNumber"/>
|
||||
</fo:block>
|
||||
</fo:table-cell>
|
||||
</fo:table-row>
|
||||
<fo:table-row xsl:use-attribute-sets="borders">
|
||||
<fo:table-cell xsl:use-attribute-sets="td">
|
||||
<fo:block>Pentester<xsl:if test="collaborators/pentesters/pentester[2]"
|
||||
>s</xsl:if></fo:block>
|
||||
</fo:table-cell>
|
||||
<fo:table-cell xsl:use-attribute-sets="td">
|
||||
<fo:block>
|
||||
<xsl:for-each select="collaborators/pentesters/pentester">
|
||||
<fo:inline>
|
||||
<xsl:value-of select="name"/>
|
||||
</fo:inline>
|
||||
<xsl:if test="following-sibling::pentester">
|
||||
<xsl:text>, </xsl:text>
|
||||
</xsl:if>
|
||||
</xsl:for-each>
|
||||
</fo:block>
|
||||
</fo:table-cell>
|
||||
</fo:table-row>
|
||||
<fo:table-row xsl:use-attribute-sets="borders">
|
||||
<fo:table-cell xsl:use-attribute-sets="td">
|
||||
<fo:block>Author<xsl:if test="$authors[2]"
|
||||
>s</xsl:if></fo:block>
|
||||
</fo:table-cell>
|
||||
<fo:table-cell xsl:use-attribute-sets="td">
|
||||
<fo:block>
|
||||
<xsl:for-each select="$authors">
|
||||
<xsl:if test="preceding::v_author">
|
||||
<xsl:text>, </xsl:text>
|
||||
</xsl:if>
|
||||
<fo:inline><xsl:value-of select="."/></fo:inline>
|
||||
</xsl:for-each>
|
||||
</fo:block>
|
||||
</fo:table-cell>
|
||||
</fo:table-row>
|
||||
<fo:table-row xsl:use-attribute-sets="borders">
|
||||
<fo:table-cell xsl:use-attribute-sets="td">
|
||||
<fo:block>Reviewed by</fo:block>
|
||||
</fo:table-cell>
|
||||
<fo:table-cell xsl:use-attribute-sets="td">
|
||||
<fo:block>
|
||||
<xsl:for-each select="collaborators/reviewers/reviewer">
|
||||
<fo:block>
|
||||
<xsl:value-of select="."/>
|
||||
</fo:block>
|
||||
</xsl:for-each>
|
||||
</fo:block>
|
||||
</fo:table-cell>
|
||||
</fo:table-row>
|
||||
<fo:table-row xsl:use-attribute-sets="borders">
|
||||
<fo:table-cell xsl:use-attribute-sets="td">
|
||||
<fo:block>Approved by</fo:block>
|
||||
</fo:table-cell>
|
||||
<fo:table-cell xsl:use-attribute-sets="td">
|
||||
<fo:block>
|
||||
<xsl:value-of select="collaborators/approver/name"/>
|
||||
</fo:block>
|
||||
</fo:table-cell>
|
||||
</fo:table-row>
|
||||
</fo:table-body>
|
||||
</fo:table>
|
||||
</fo:block>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="VersionControl">
|
||||
<xsl:variable name="versions" select="version_history/version"/>
|
||||
<fo:block xsl:use-attribute-sets="title-4">Version control</fo:block>
|
||||
<fo:block margin-bottom="{$very-large-space}">
|
||||
<fo:table width="100%" table-layout="fixed" xsl:use-attribute-sets="borders">
|
||||
<fo:table-column column-width="proportional-column-width(25)"
|
||||
xsl:use-attribute-sets="borders"/>
|
||||
<fo:table-column column-width="proportional-column-width(25)"
|
||||
xsl:use-attribute-sets="borders"/>
|
||||
<fo:table-column column-width="proportional-column-width(25)"
|
||||
xsl:use-attribute-sets="borders"/>
|
||||
<fo:table-column column-width="proportional-column-width(25)"
|
||||
xsl:use-attribute-sets="borders"/>
|
||||
<fo:table-body>
|
||||
<fo:table-row xsl:use-attribute-sets="bg-orange borders">
|
||||
<fo:table-cell xsl:use-attribute-sets="td">
|
||||
<fo:block>Version</fo:block>
|
||||
</fo:table-cell>
|
||||
<fo:table-cell xsl:use-attribute-sets="td">
|
||||
<fo:block>Date</fo:block>
|
||||
</fo:table-cell>
|
||||
<fo:table-cell xsl:use-attribute-sets="td">
|
||||
<fo:block>Author</fo:block>
|
||||
</fo:table-cell>
|
||||
<fo:table-cell xsl:use-attribute-sets="td">
|
||||
<fo:block>Description</fo:block>
|
||||
</fo:table-cell>
|
||||
</fo:table-row>
|
||||
<xsl:for-each select="$versions">
|
||||
<!-- todo: guard date format in schema -->
|
||||
<xsl:sort select="xs:dateTime(@date)" order="ascending"/>
|
||||
<fo:table-row xsl:use-attribute-sets="borders">
|
||||
<fo:table-cell xsl:use-attribute-sets="td">
|
||||
<fo:block>
|
||||
<xsl:call-template name="VersionNumber">
|
||||
<xsl:with-param name="number" select="@number"/>
|
||||
</xsl:call-template>
|
||||
</fo:block>
|
||||
</fo:table-cell>
|
||||
<fo:table-cell xsl:use-attribute-sets="td">
|
||||
<fo:block>
|
||||
<xsl:value-of
|
||||
select="format-dateTime(@date, '[MNn] [D1o], [Y]', 'en', (), ())"
|
||||
/>
|
||||
</fo:block>
|
||||
</fo:table-cell>
|
||||
<fo:table-cell xsl:use-attribute-sets="td">
|
||||
<fo:block>
|
||||
<xsl:for-each select="v_author">
|
||||
<fo:inline><xsl:value-of select="."/></fo:inline>
|
||||
<xsl:if test="following-sibling::v_author">
|
||||
<xsl:text>, </xsl:text>
|
||||
</xsl:if>
|
||||
</xsl:for-each>
|
||||
</fo:block>
|
||||
</fo:table-cell>
|
||||
<fo:table-cell xsl:use-attribute-sets="td">
|
||||
<fo:block>
|
||||
<xsl:value-of select="v_description"/>
|
||||
</fo:block>
|
||||
</fo:table-cell>
|
||||
</fo:table-row>
|
||||
</xsl:for-each>
|
||||
</fo:table-body>
|
||||
</fo:table>
|
||||
</fo:block>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="VersionNumber">
|
||||
<xsl:param name="number" select="@number"/>
|
||||
<xsl:choose>
|
||||
<!-- if value is auto, do some autonumbering magic -->
|
||||
<xsl:when test="string(@number)='auto'"> 0.<xsl:number count="version" level="multiple"
|
||||
format="{$AUTO_NUMBERING_FORMAT}"/>
|
||||
<!-- this is really unrobust :D - todo: follow fixed numbering if provided -->
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<!-- just plop down the value -->
|
||||
<!-- todo: guard numbering format in schema -->
|
||||
<xsl:value-of select="@number"/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="Contact">
|
||||
<fo:block xsl:use-attribute-sets="title-4">Contact</fo:block>
|
||||
<fo:block xsl:use-attribute-sets="p">For more information about this Document and its
|
||||
contents please contact Radically Open Security BV.</fo:block>
|
||||
<fo:block break-after="page">
|
||||
<fo:table width="100%" table-layout="fixed" xsl:use-attribute-sets="borders">
|
||||
<fo:table-column column-width="proportional-column-width(25)"
|
||||
xsl:use-attribute-sets="bg-orange borders"/>
|
||||
<fo:table-column column-width="proportional-column-width(75)"/>
|
||||
<fo:table-body xsl:use-attribute-sets="borders">
|
||||
<fo:table-row>
|
||||
<fo:table-cell xsl:use-attribute-sets="td">
|
||||
<fo:block>Name</fo:block>
|
||||
</fo:table-cell>
|
||||
<fo:table-cell xsl:use-attribute-sets="td">
|
||||
<fo:block>
|
||||
<xsl:value-of select="contact/name"/>
|
||||
</fo:block>
|
||||
</fo:table-cell>
|
||||
</fo:table-row>
|
||||
<fo:table-row xsl:use-attribute-sets="borders">
|
||||
<fo:table-cell xsl:use-attribute-sets="td">
|
||||
<fo:block>Address</fo:block>
|
||||
</fo:table-cell>
|
||||
<fo:table-cell xsl:use-attribute-sets="td">
|
||||
<fo:block>
|
||||
<xsl:apply-templates select="contact/address"/>
|
||||
</fo:block>
|
||||
</fo:table-cell>
|
||||
</fo:table-row>
|
||||
<fo:table-row xsl:use-attribute-sets="borders">
|
||||
<fo:table-cell xsl:use-attribute-sets="td">
|
||||
<fo:block>Phone</fo:block>
|
||||
</fo:table-cell>
|
||||
<fo:table-cell xsl:use-attribute-sets="td">
|
||||
<fo:block>
|
||||
<xsl:value-of select="contact/phone"/>
|
||||
</fo:block>
|
||||
</fo:table-cell>
|
||||
</fo:table-row>
|
||||
<fo:table-row xsl:use-attribute-sets="borders">
|
||||
<fo:table-cell xsl:use-attribute-sets="td">
|
||||
<fo:block>Email</fo:block>
|
||||
</fo:table-cell>
|
||||
<fo:table-cell xsl:use-attribute-sets="td">
|
||||
<fo:block>
|
||||
<xsl:value-of select="contact/email"/>
|
||||
</fo:block>
|
||||
</fo:table-cell>
|
||||
</fo:table-row>
|
||||
</fo:table-body>
|
||||
</fo:table>
|
||||
</fo:block>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
||||
@ -25,9 +25,9 @@
|
||||
<xsl:template
|
||||
match="section[not(@visibility = 'hidden')] | finding | appendix[not(@visibility = 'hidden')] | non-finding"
|
||||
mode="toc">
|
||||
|
||||
<xsl:param name="execsummary" tunnel="yes"/>
|
||||
<xsl:choose>
|
||||
<xsl:when test="$EXEC_SUMMARY = true()">
|
||||
<xsl:when test="$execsummary = true()">
|
||||
<xsl:if test="ancestor-or-self::*/@inexecsummary = 'yes'">
|
||||
<xsl:call-template name="ToC"/>
|
||||
</xsl:if>
|
||||
@ -40,6 +40,7 @@
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="ToC">
|
||||
<xsl:param name="execsummary" tunnel="yes"/>
|
||||
<fo:table-row>
|
||||
<fo:table-cell text-align-last="justify">
|
||||
<fo:block>
|
||||
@ -66,7 +67,7 @@
|
||||
</fo:table-cell>
|
||||
</fo:table-row>
|
||||
<xsl:choose>
|
||||
<xsl:when test="$EXEC_SUMMARY = true()">
|
||||
<xsl:when test="$execsummary = true()">
|
||||
<xsl:apply-templates
|
||||
select="section[not(@visibility = 'hidden')][not(../@visibility = 'hidden')][ancestor-or-self::*/@inexecsummary = 'yes']"
|
||||
mode="toc"/>
|
||||
@ -95,10 +96,11 @@
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="tocContent_Numbering">
|
||||
<xsl:param name="execsummary" tunnel="yes"/>
|
||||
<xsl:choose>
|
||||
<xsl:when test="self::appendix[not(@visibility = 'hidden')]">
|
||||
<xsl:choose>
|
||||
<xsl:when test="$EXEC_SUMMARY = true()">
|
||||
<xsl:when test="$execsummary = true()">
|
||||
<fo:inline> Appendix <xsl:number
|
||||
count="appendix[not(@visibility = 'hidden')][@inexecsummary = 'yes']"
|
||||
level="multiple" format="{$AUTO_NUMBERING_FORMAT}"/></fo:inline>
|
||||
@ -112,7 +114,7 @@
|
||||
</xsl:when>
|
||||
<xsl:when test="ancestor::appendix[not(@visibility = 'hidden')]">
|
||||
<xsl:choose>
|
||||
<xsl:when test="$EXEC_SUMMARY = true()">
|
||||
<xsl:when test="$execsummary = true()">
|
||||
<xsl:if test="ancestor::appendix[@inexecsummary = 'yes']">
|
||||
<fo:inline> App <xsl:number
|
||||
count="appendix[not(@visibility = 'hidden')][@inexecsummary = 'yes']"
|
||||
@ -134,7 +136,7 @@
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:choose>
|
||||
<xsl:when test="$EXEC_SUMMARY = true()">
|
||||
<xsl:when test="$execsummary = true()">
|
||||
<xsl:number
|
||||
count="section[not(@visibility = 'hidden')][ancestor-or-self::*/@inexecsummary = 'yes']"
|
||||
level="multiple" format="{$AUTO_NUMBERING_FORMAT}"/>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user