git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@114611 13f79535-47bb-0310-9956-ffa450edef68
196 lines
10 KiB
HTML
196 lines
10 KiB
HTML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" version="1.0">
|
|
<!-- These attribute-sets are treated as 'styles,'
|
|
and are referenced in the templates below -->
|
|
<xsl:attribute-set name="toc.cell">
|
|
<xsl:attribute name="display-align">after</xsl:attribute>
|
|
</xsl:attribute-set>
|
|
<xsl:attribute-set name="toc.base.style">
|
|
<xsl:attribute name="font-family">Helvetica,sans-serif</xsl:attribute>
|
|
<xsl:attribute name="line-height">16pt</xsl:attribute>
|
|
<xsl:attribute name="text-align-last">start</xsl:attribute>
|
|
<xsl:attribute name="wrap-option">no-wrap</xsl:attribute>
|
|
</xsl:attribute-set>
|
|
<xsl:attribute-set name="toc.leader.style">
|
|
<xsl:attribute name="leader-pattern">dots</xsl:attribute>
|
|
<xsl:attribute name="leader-pattern-width">5pt</xsl:attribute>
|
|
<xsl:attribute name="color"><xsl:value-of select="$colorDarkGray"/></xsl:attribute>
|
|
</xsl:attribute-set>
|
|
<xsl:attribute-set name="toc.number.style">
|
|
<xsl:attribute name="font-size">9.5pt</xsl:attribute>
|
|
<xsl:attribute name="text-align">end</xsl:attribute>
|
|
<xsl:attribute name="color"><xsl:value-of select="$colorMediumGray"/></xsl:attribute>
|
|
<xsl:attribute name="line-height">16pt</xsl:attribute>
|
|
<xsl:attribute name="end-indent">6pt</xsl:attribute>
|
|
</xsl:attribute-set>
|
|
<xsl:attribute-set name="toc.h1.style" use-attribute-sets="toc.base.style">
|
|
<xsl:attribute name="font-size">12pt</xsl:attribute>
|
|
<xsl:attribute name="font-weight">bold</xsl:attribute>
|
|
<xsl:attribute name="space-before">18pt</xsl:attribute>
|
|
</xsl:attribute-set>
|
|
<xsl:attribute-set name="toc.h2.style" use-attribute-sets="toc.base.style">
|
|
<xsl:attribute name="font-size">9.5pt</xsl:attribute>
|
|
<xsl:attribute name="space-before">15pt</xsl:attribute>
|
|
<xsl:attribute name="space-before">3pt</xsl:attribute>
|
|
</xsl:attribute-set>
|
|
<xsl:attribute-set name="toc.h3.style" use-attribute-sets="toc.base.style">
|
|
<xsl:attribute name="font-size">9.5pt</xsl:attribute>
|
|
<xsl:attribute name="space-before">4pt</xsl:attribute>
|
|
</xsl:attribute-set>
|
|
<xsl:attribute-set name="toc.h4.style" use-attribute-sets="toc.base.style">
|
|
<xsl:attribute name="font-size">9.5pt</xsl:attribute>
|
|
<xsl:attribute name="space-before">4pt</xsl:attribute>
|
|
</xsl:attribute-set>
|
|
<!-- Templates for handling the TOC -->
|
|
<xsl:template name="fo-toc">
|
|
<fo:page-sequence master-reference="toc" initial-page-number="1" format="i">
|
|
<!-- Render the header and footer -->
|
|
<xsl:call-template name="body-header">
|
|
<xsl:with-param name="headerText" select="translate('Table of Contents', $lc, $uc)"/>
|
|
</xsl:call-template>
|
|
<xsl:call-template name="body-footer">
|
|
<xsl:with-param name="footerText" select="translate($footerText, $lc, $uc)"/>
|
|
</xsl:call-template>
|
|
<fo:flow flow-name="xsl-region-body">
|
|
<!-- Render the chapter heading -->
|
|
<xsl:call-template name="body-chapter-heading">
|
|
<xsl:with-param name="chapterNumber"/>
|
|
<xsl:with-param name="chapter">Table of Contents</xsl:with-param>
|
|
</xsl:call-template>
|
|
<fo:table table-layout="fixed">
|
|
<fo:table-column column-width="0.25in"/>
|
|
<fo:table-column column-width="0.4in"/>
|
|
<fo:table-column column-width="0.4in"/>
|
|
<fo:table-column column-width="{$maxBodyWidth - 1.25}in"/>
|
|
<fo:table-body>
|
|
<xsl:apply-templates mode="toc"/>
|
|
</fo:table-body>
|
|
</fo:table>
|
|
</fo:flow>
|
|
</fo:page-sequence>
|
|
</xsl:template>
|
|
<xsl:template match="project/body/menu" mode="toc">
|
|
<fo:table-row keep-with-next="always">
|
|
<fo:table-cell xsl:use-attribute-sets="toc.cell">
|
|
<fo:block xsl:use-attribute-sets="toc.number.style">
|
|
<xsl:number level="any" format="1" count="menu"/>
|
|
</fo:block>
|
|
</fo:table-cell>
|
|
<fo:table-cell xsl:use-attribute-sets="toc.cell" number-columns-spanned="3">
|
|
<xsl:choose>
|
|
<xsl:when test="normalize-space(@href)">
|
|
<fo:block xsl:use-attribute-sets="toc.h1.style" text-align-last="justify">
|
|
<fo:basic-link internal-destination="{@href}{generate-id()}">
|
|
<xsl:apply-templates select="@name"/>
|
|
</fo:basic-link>
|
|
<fo:leader xsl:use-attribute-sets="toc.leader.style"/>
|
|
<fo:inline xsl:use-attribute-sets="page.number">
|
|
<fo:page-number-citation ref-id="{@href}{generate-id()}"/>
|
|
</fo:inline>
|
|
</fo:block>
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
<fo:block xsl:use-attribute-sets="toc.h1.style">
|
|
<xsl:apply-templates select="@name"/>
|
|
</fo:block>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
</fo:table-cell>
|
|
</fo:table-row>
|
|
<xsl:apply-templates mode="toc"/>
|
|
</xsl:template>
|
|
<xsl:template match="project/body/menu/item" mode="toc">
|
|
<fo:table-row keep-with-next="always">
|
|
<fo:table-cell xsl:use-attribute-sets="toc.cell">
|
|
<fo:block xsl:use-attribute-sets="toc.number.style">
|
|
<xsl:number count="menu"/>.<xsl:number count="menu/item"/>
|
|
</fo:block>
|
|
</fo:table-cell>
|
|
<fo:table-cell xsl:use-attribute-sets="toc.cell" number-columns-spanned="3">
|
|
<xsl:choose>
|
|
<xsl:when test="normalize-space(@href)">
|
|
<fo:block xsl:use-attribute-sets="toc.h2.style" text-align-last="justify">
|
|
<fo:basic-link internal-destination="{@href}{generate-id()}">
|
|
<xsl:apply-templates select="@name"/>
|
|
</fo:basic-link>
|
|
<fo:leader xsl:use-attribute-sets="toc.leader.style"/>
|
|
<fo:inline xsl:use-attribute-sets="page.number">
|
|
<fo:page-number-citation ref-id="{@href}{generate-id()}"/>
|
|
</fo:inline>
|
|
</fo:block>
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
<fo:block xsl:use-attribute-sets="toc.h2.style">
|
|
<xsl:apply-templates select="@name"/>
|
|
</fo:block>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
</fo:table-cell>
|
|
</fo:table-row>
|
|
<xsl:apply-templates mode="toc"/>
|
|
</xsl:template>
|
|
<xsl:template match="project/body/menu/item/item" mode="toc">
|
|
<fo:table-row>
|
|
<fo:table-cell/>
|
|
<fo:table-cell xsl:use-attribute-sets="toc.cell">
|
|
<fo:block xsl:use-attribute-sets="toc.number.style">
|
|
<xsl:number count="menu"/>.<xsl:number count="menu/item"/>.<xsl:number count="menu/item/item"/>
|
|
</fo:block>
|
|
</fo:table-cell>
|
|
<fo:table-cell xsl:use-attribute-sets="toc.cell" number-columns-spanned="2">
|
|
<xsl:choose>
|
|
<xsl:when test="normalize-space(@href)">
|
|
<fo:block xsl:use-attribute-sets="toc.h3.style" text-align-last="justify">
|
|
<fo:basic-link internal-destination="{@href}{generate-id()}">
|
|
<xsl:apply-templates select="@name"/>
|
|
</fo:basic-link>
|
|
<fo:leader xsl:use-attribute-sets="toc.leader.style"/>
|
|
<fo:inline xsl:use-attribute-sets="page.number">
|
|
<fo:page-number-citation ref-id="{@href}{generate-id()}"/>
|
|
</fo:inline>
|
|
</fo:block>
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
<fo:block xsl:use-attribute-sets="toc.h3.style">
|
|
<xsl:apply-templates select="@name"/>
|
|
</fo:block>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
</fo:table-cell>
|
|
</fo:table-row>
|
|
<xsl:apply-templates mode="toc"/>
|
|
</xsl:template>
|
|
<xsl:template match="project/body/menu/item/item/item" mode="toc">
|
|
<fo:table-row>
|
|
<fo:table-cell/>
|
|
<fo:table-cell/>
|
|
<fo:table-cell xsl:use-attribute-sets="toc.cell">
|
|
<fo:block xsl:use-attribute-sets="toc.number.style">
|
|
<xsl:number count="menu"/>.<xsl:number count="menu/item"/>.<xsl:number count="menu/item/item"/>.<xsl:number count="menu/item/item/item"/>
|
|
</fo:block>
|
|
</fo:table-cell>
|
|
<fo:table-cell xsl:use-attribute-sets="toc.cell">
|
|
<xsl:choose>
|
|
<xsl:when test="normalize-space(@href)">
|
|
<fo:block xsl:use-attribute-sets="toc.h3.style" text-align-last="justify">
|
|
<fo:basic-link internal-destination="{@href}{generate-id()}">
|
|
<xsl:apply-templates select="@name"/>
|
|
</fo:basic-link>
|
|
<fo:leader xsl:use-attribute-sets="toc.leader.style"/>
|
|
<fo:inline xsl:use-attribute-sets="page.number">
|
|
<fo:page-number-citation ref-id="{@href}{generate-id()}"/>
|
|
</fo:inline>
|
|
</fo:block>
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
<fo:block xsl:use-attribute-sets="toc.h3.style">
|
|
<xsl:apply-templates select="@name"/>
|
|
</fo:block>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
</fo:table-cell>
|
|
</fo:table-row>
|
|
<xsl:apply-templates mode="toc"/>
|
|
</xsl:template>
|
|
</xsl:stylesheet>
|