Fixed exec summary

This commit is contained in:
skyanth 2017-07-03 15:14:39 +02:00
parent d58d8afe90
commit 30c46e0a51
6 changed files with 30 additions and 20 deletions

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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&#160;<xsl:number

View File

@ -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&#160;<xsl:number

View File

@ -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&#160;<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&#160;<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}"/>