105 lines
5.4 KiB
HTML
105 lines
5.4 KiB
HTML
<?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="section | appendix | finding | non-finding | annex">
|
|
<xsl:if test="not(@visibility = 'hidden')">
|
|
<xsl:choose>
|
|
<xsl:when test="$EXEC_SUMMARY = true()">
|
|
<xsl:if test="ancestor-or-self::*/@inexecsummary = 'yes'">
|
|
<fo:block xsl:use-attribute-sets="section">
|
|
<xsl:if test="self::appendix or self::annex">
|
|
<xsl:attribute name="break-before">page</xsl:attribute>
|
|
</xsl:if>
|
|
<xsl:apply-templates select="@* | node()"/>
|
|
</fo:block>
|
|
</xsl:if>
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
<fo:block xsl:use-attribute-sets="section">
|
|
<xsl:if test="self::appendix or self::annex">
|
|
<xsl:attribute name="break-before">page</xsl:attribute>
|
|
</xsl:if>
|
|
<xsl:apply-templates select="@* | node()"/>
|
|
</fo:block>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
</xsl:if>
|
|
</xsl:template>
|
|
|
|
<xsl:template match="title[not(parent::biblioentry)]">
|
|
<xsl:variable name="LEVEL" select="count(ancestor::*) - 1"/>
|
|
<xsl:variable name="CLASS">
|
|
<!-- use title-x for all levels -->
|
|
<xsl:text>title-</xsl:text>
|
|
<xsl:value-of select="$LEVEL"/>
|
|
</xsl:variable>
|
|
|
|
<fo:block>
|
|
<xsl:call-template name="use-att-set">
|
|
<xsl:with-param name="CLASS" select="$CLASS"/>
|
|
</xsl:call-template>
|
|
<xsl:choose>
|
|
<xsl:when test="$EXEC_SUMMARY = true()">
|
|
<xsl:choose>
|
|
<xsl:when test="self::title[parent::appendix]">
|
|
<fo:inline> Appendix <xsl:number
|
|
count="appendix[not(@visibility = 'hidden')][@inexecsummary = 'yes']"
|
|
level="multiple" format="{$AUTO_NUMBERING_FORMAT}"/>
|
|
</fo:inline>
|
|
</xsl:when>
|
|
<xsl:when test="ancestor::appendix and not(self::title[parent::appendix])">
|
|
<fo:inline> App <xsl:number
|
|
count="appendix[not(@visibility = 'hidden')][@inexecsummary = 'yes']"
|
|
level="multiple" format="{$AUTO_NUMBERING_FORMAT}"/>.<xsl:number
|
|
count="section[ancestor::appendix][not(@visibility = 'hidden')][@inexecsummary = 'yes']"
|
|
level="multiple" format="{$AUTO_NUMBERING_FORMAT}"/>
|
|
</fo:inline>
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
<fo:inline>
|
|
<xsl:number
|
|
count="section[not(@visibility = 'hidden')][ancestor-or-self::*/@inexecsummary = 'yes'] | finding | non-finding"
|
|
level="multiple" format="{$AUTO_NUMBERING_FORMAT}"/>
|
|
</fo:inline>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
<xsl:choose>
|
|
<xsl:when test="self::title[parent::appendix]">
|
|
<fo:inline> Appendix <xsl:number
|
|
count="appendix[not(@visibility = 'hidden')]" level="multiple"
|
|
format="{$AUTO_NUMBERING_FORMAT}"/>
|
|
</fo:inline>
|
|
</xsl:when>
|
|
<xsl:when test="ancestor::appendix and not(self::title[parent::appendix])">
|
|
<fo:inline> App <xsl:number
|
|
count="appendix[not(@visibility = 'hidden')]" level="multiple"
|
|
format="{$AUTO_NUMBERING_FORMAT}"/>.<xsl:number
|
|
count="section[ancestor::appendix][not(@visibility = 'hidden')]"
|
|
level="multiple" format="{$AUTO_NUMBERING_FORMAT}"/>
|
|
</fo:inline>
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
<fo:inline>
|
|
<xsl:number
|
|
count="section[not(@visibility = 'hidden')] | finding | non-finding"
|
|
level="multiple" format="{$AUTO_NUMBERING_FORMAT}"/>
|
|
</fo:inline>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
<xsl:text>   </xsl:text>
|
|
<xsl:call-template name="prependNumber"/>
|
|
<xsl:apply-templates/>
|
|
</fo:block>
|
|
<xsl:if test="parent::finding">
|
|
<xsl:apply-templates select=".." mode="meta"/>
|
|
</xsl:if>
|
|
</xsl:template>
|
|
|
|
</xsl:stylesheet>
|