Apply MPPDF-5 and MPPDF-6 form Arnaud Heritier

git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@114708 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
evenisse
2004-02-19 08:33:38 +00:00
parent 06be1a064b
commit 067127eb43
17 changed files with 1022 additions and 903 deletions

View File

@@ -1,153 +1,5 @@
<?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 -->
<!-- Style 'primitives' from which all others are descended -->
<xsl:attribute-set name="base.body.style">
<xsl:attribute name="font-family">Garamond,serif</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="base.heading.style">
<xsl:attribute name="font-family">Helvetica,sans-serif</xsl:attribute>
<xsl:attribute name="color">#000000</xsl:attribute>
<xsl:attribute name="keep-with-next">always</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="base.pre.style">
<xsl:attribute name="font-family">monospace</xsl:attribute>
</xsl:attribute-set>
<!-- Standard body and heading styles -->
<xsl:attribute-set name="body.text" use-attribute-sets="base.body.style">
<xsl:attribute name="font-size">11pt</xsl:attribute>
<xsl:attribute name="line-height">12pt</xsl:attribute>
<xsl:attribute name="white-space-collapse">true</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="body.pre" use-attribute-sets="base.pre.style">
<xsl:attribute name="font-size">10pt</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="body.source" use-attribute-sets="base.pre.style">
<xsl:attribute name="font-size">8pt</xsl:attribute>
<xsl:attribute name="wrap-option">wrap</xsl:attribute>
<xsl:attribute name="white-space-collapse">false</xsl:attribute>
<xsl:attribute name="color">black</xsl:attribute>
<xsl:attribute name="border-style">dotted</xsl:attribute>
<xsl:attribute name="border-width">0.5pt</xsl:attribute>
<xsl:attribute name="border-color"><xsl:value-of select="$colorMediumGray"/></xsl:attribute>
<xsl:attribute name="padding-before">1.0em</xsl:attribute>
<xsl:attribute name="padding-after">1.25em</xsl:attribute>
<xsl:attribute name="padding-start">0.75em</xsl:attribute>
<xsl:attribute name="padding-end">0.75em</xsl:attribute>
<xsl:attribute name="start-indent">inherited-property-value(start-indent) + 2.5em</xsl:attribute>
<xsl:attribute name="end-indent">inherited-property-value(end-indent) + 3em</xsl:attribute>
<xsl:attribute name="space-before">0.75em</xsl:attribute>
<xsl:attribute name="space-after">1em</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="body.strong">
<xsl:attribute name="font-family">Helvetica,sans-serif</xsl:attribute>
<xsl:attribute name="font-size">9.0pt</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="body.title" use-attribute-sets="base.heading.style">
<xsl:attribute name="font-size">16pt</xsl:attribute>
<xsl:attribute name="font-weight">bold</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="body.h1" use-attribute-sets="base.heading.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 name="space-after">6pt</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="body.h2" use-attribute-sets="base.heading.style">
<xsl:attribute name="font-size">9.5pt</xsl:attribute>
<xsl:attribute name="font-weight">bold</xsl:attribute>
<xsl:attribute name="space-before">18pt</xsl:attribute>
<xsl:attribute name="space-after">5pt</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="body.h3" use-attribute-sets="base.heading.style">
<xsl:attribute name="font-size">9.5pt</xsl:attribute>
<xsl:attribute name="space-before">15pt</xsl:attribute>
<xsl:attribute name="space-after">3pt</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="body.h4" use-attribute-sets="base.heading.style">
<xsl:attribute name="font-size">9.5pt</xsl:attribute>
<xsl:attribute name="space-before">9pt</xsl:attribute>
<xsl:attribute name="space-after">3pt</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="body.h5" use-attribute-sets="base.heading.style">
<xsl:attribute name="font-size">9.5pt</xsl:attribute>
<xsl:attribute name="font-style">italic</xsl:attribute>
<xsl:attribute name="space-after">3pt</xsl:attribute>
</xsl:attribute-set>
<!-- Chapter heading styles -->
<xsl:attribute-set name="chapter.title" use-attribute-sets="base.heading.style body.title">
<xsl:attribute name="line-height">10pt</xsl:attribute>
<xsl:attribute name="space-after">6pt</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="chapter.rule">
<xsl:attribute name="leader-length.optimum">100%</xsl:attribute>
<xsl:attribute name="leader-pattern">dots</xsl:attribute>
<xsl:attribute name="rule-thickness">1pt</xsl:attribute>
<xsl:attribute name="color"><xsl:value-of select="$colorDarkGray"/></xsl:attribute>
</xsl:attribute-set>
<!-- Outdented numbers -->
<xsl:attribute-set name="outdented.number.style" use-attribute-sets="base.heading.style">
<xsl:attribute name="font-size">9.5pt</xsl:attribute>
<xsl:attribute name="color"><xsl:value-of select="$colorDarkGray"/></xsl:attribute>
<xsl:attribute name="line-height">10pt</xsl:attribute>
<xsl:attribute name="text-align">right</xsl:attribute>
</xsl:attribute-set>
<!-- Page header/footer styles -->
<xsl:attribute-set name="footer.style">
<xsl:attribute name="letter-spacing">2pt</xsl:attribute>
<xsl:attribute name="font-family">Helvetica,sans-serif</xsl:attribute>
<xsl:attribute name="font-size">6pt</xsl:attribute>
<xsl:attribute name="color"><xsl:value-of select="$colorDarkGray"/></xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="header.style">
<xsl:attribute name="letter-spacing">2pt</xsl:attribute>
<xsl:attribute name="font-family">Helvetica,sans-serif</xsl:attribute>
<xsl:attribute name="font-size">6pt</xsl:attribute>
<xsl:attribute name="color"><xsl:value-of select="$colorDarkGray"/></xsl:attribute>
<xsl:attribute name="text-align">left</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="page.number">
<xsl:attribute name="font-family">Helvetica,sans-serif</xsl:attribute>
<xsl:attribute name="font-size">9.5pt</xsl:attribute>
<xsl:attribute name="text-align">right</xsl:attribute>
<xsl:attribute name="color">black</xsl:attribute>
</xsl:attribute-set>
<!-- Style for hyperlinks -->
<xsl:attribute-set name="href">
<xsl:attribute name="color">blue</xsl:attribute>
</xsl:attribute-set>
<!-- 'Normal' line-spacing styles for paragraph and pre elements -->
<xsl:attribute-set name="normal.paragraph" use-attribute-sets="base.body.style">
<xsl:attribute name="space-before">3pt</xsl:attribute>
<xsl:attribute name="space-after">6pt</xsl:attribute>
</xsl:attribute-set>
<!-- Styles for lists, list items, definition lists, etc. -->
<xsl:attribute-set name="list">
<xsl:attribute name="start-indent">inherited-property-value(start-indent)</xsl:attribute>
<xsl:attribute name="provisional-distance-between-starts">1em</xsl:attribute>
<xsl:attribute name="provisional-label-separation">1em</xsl:attribute>
</xsl:attribute-set>
<!-- 1pt before, 3pts after -->
<xsl:attribute-set name="list.item">
<xsl:attribute name="start-indent">inherited-property-value(start-indent) + .5em</xsl:attribute>
<xsl:attribute name="space-before">0.15em</xsl:attribute>
<xsl:attribute name="space-after">0.25em</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="dl" use-attribute-sets="body.text">
<xsl:attribute name="start-indent">1em</xsl:attribute>
<xsl:attribute name="end-indent">1em</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="dt" use-attribute-sets="base.body.style">
<xsl:attribute name="start-indent">1em</xsl:attribute>
<xsl:attribute name="end-indent">1em</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="dd" use-attribute-sets="base.body.style">
<xsl:attribute name="start-indent">1em</xsl:attribute>
<xsl:attribute name="end-indent">1em</xsl:attribute>
<xsl:attribute name="space-before">0.6em</xsl:attribute>
<xsl:attribute name="space-after">0.6em</xsl:attribute>
</xsl:attribute-set>
<!-- Templates for rendering headers, footers, and chapter headings -->
<xsl:template name="body-header">
<xsl:param name="headerText"/>
@@ -346,7 +198,7 @@
<xsl:template match="a[@href and (starts-with(@href, 'http') or starts-with(@href, 'mailto') or starts-with(@href, 'ftp'))]">
<xsl:param name="chapterNumber"/>
<fo:basic-link external-destination="{@href}">
<fo:inline xsl:use-attribute-sets="href">
<fo:inline xsl:use-attribute-sets="href.external">
<xsl:apply-templates>
<xsl:with-param name="chapterNumber">
<xsl:value-of select="$chapterNumber"/>
@@ -358,7 +210,7 @@
<xsl:template match="a[@href and starts-with(@href, '#')]">
<xsl:param name="chapterNumber"/>
<fo:basic-link internal-destination="{$chapterNumber}{@href}{generate-id()}">
<fo:inline xsl:use-attribute-sets="href">
<fo:inline xsl:use-attribute-sets="href.internal">
<xsl:apply-templates>
<xsl:with-param name="chapterNumber">
<xsl:value-of select="$chapterNumber"/>
@@ -370,7 +222,7 @@
<xsl:template match="a[@href and not(starts-with(@href, 'http')) and not(starts-with(@href, 'mailto')) and not(starts-with(@href, 'ftp')) and not(starts-with(@href, '#'))]">
<xsl:param name="chapterNumber"/>
<fo:basic-link internal-destination="{@href}{generate-id()}">
<fo:inline xsl:use-attribute-sets="href">
<fo:inline xsl:use-attribute-sets="href.internal">
<xsl:apply-templates>
<xsl:with-param name="chapterNumber">
<xsl:value-of select="$chapterNumber"/>

View File

@@ -1,81 +1,117 @@
<?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">
<xsl:variable name="colWidth" select="$maxBodyWidth div 3"/>
<xsl:attribute-set name="cover.title">
<xsl:attribute name="font-family">Helvetica,sans-serif</xsl:attribute>
<xsl:attribute name="color">#000000</xsl:attribute>
<xsl:attribute name="keep-with-next">always</xsl:attribute>
<xsl:attribute name="font-size">16pt</xsl:attribute>
<xsl:attribute name="font-weight">bold</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="cover.subtitle">
<xsl:attribute name="font-family">Helvetica,sans-serif</xsl:attribute>
<xsl:attribute name="color">#000000</xsl:attribute>
<xsl:attribute name="keep-with-next">always</xsl:attribute>
<xsl:attribute name="font-size">12pt</xsl:attribute>
<xsl:attribute name="font-weight">bold</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="table.heading.rule">
<xsl:attribute name="leader-length.optimum">100%</xsl:attribute>
<xsl:attribute name="leader-pattern">rule</xsl:attribute>
<xsl:attribute name="rule-thickness">0.5pt</xsl:attribute>
<xsl:attribute name="color">black</xsl:attribute>
</xsl:attribute-set>
<xsl:variable name="colWidth2" select="$maxBodyWidth div 2"/>
<xsl:variable name="colWidth3" select="$maxBodyWidth div 3"/>
<xsl:variable name="maxTableHeight" select="$maxBodyHeight - $regionTopMargin"/>
<xsl:variable name="headerHeight">0.5</xsl:variable>
<xsl:variable name="footerHeight">0.3</xsl:variable>
<xsl:variable name="lineHeight">0.014</xsl:variable>
<xsl:variable name="middleHeight" select="$maxTableHeight - $headerHeight - $footerHeight - $lineHeight - $lineHeight - 0.5"/>
<xsl:template name="fo-cover">
<fo:page-sequence master-reference="cover-page">
<fo:flow flow-name="xsl-region-body">
<fo:block text-align="center">
<fo:table table-layout="fixed">
<fo:table-column column-width="{$colWidth}in"/>
<fo:table-column column-width="{$colWidth}in"/>
<fo:table-column column-width="{$colWidth}in"/>
<fo:table-column column-width="{$colWidth2}in"/>
<fo:table-column column-width="{$colWidth2}in"/>
<fo:table-body>
<fo:table-row>
<fo:table-row height="{$headerHeight}in">
<fo:table-cell>
<fo:block text-align="left" vertical-align="bottom">
<fo:external-graphic src="{normalize-space($companyLogo)}" height="0.5in" width="auto" content-height="0.5in" content-width="auto"/>
<fo:block text-align="left" vertical-align="top">
<xsl:variable name="source">
<xsl:choose>
<xsl:when test="substring(normalize-space($companyLogo),1,3) = '../'">
<xsl:value-of select="translate(substring-after(normalize-space($companyLogo),'../'),'\','/')"/>
</xsl:when>
<xsl:when test="substring(normalize-space($companyLogo),1,3) = '..\'">
<xsl:value-of select="translate(substring-after(normalize-space($companyLogo),'..\'),'\','/')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="normalize-space($companyLogo)"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<fo:external-graphic src="{$source}" height="{$headerHeight}in" width="auto" content-height="{$headerHeight}in" content-width="auto"/>
</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block/>
</fo:table-cell>
<fo:table-cell>
<fo:block text-align="right" vertical-align="bottom">
<fo:external-graphic src="{normalize-space($projectLogo)}" height="0.5in" width="auto" content-height="0.5in" content-width="auto"/>
<fo:block text-align="right" vertical-align="top">
<xsl:variable name="source">
<xsl:choose>
<xsl:when test="substring(normalize-space($projectLogo),1,3) = '../'">
<xsl:value-of select="translate(substring-after(normalize-space($projectLogo),'../'),'\','/')"/>
</xsl:when>
<xsl:when test="substring(normalize-space($companyLogo),1,3) = '..\'">
<xsl:value-of select="translate(substring-after(normalize-space($projectLogo),'..\'),'\','/')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="normalize-space($projectLogo)"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<fo:external-graphic src="{$source}" height="{$headerHeight}in" width="auto" content-height="{$headerHeight}in" content-width="auto"/>
</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row keep-with-previous="always">
<fo:table-cell padding-after="4.75pt" number-columns-spanned="3">
<fo:block line-height="1pt">
<fo:leader xsl:use-attribute-sets="table.heading.rule"/>
<fo:table-row keep-with-previous="always" height="{$lineHeight}in">
<fo:table-cell number-columns-spanned="2">
<fo:block line-height="{$lineHeight}in">
<fo:leader xsl:use-attribute-sets="chapter.rule"/>
</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-row height="{$middleHeight}in">
<fo:table-cell number-columns-spanned="3">
<fo:block xsl:use-attribute-sets="cover.subtitle" text-align="end" space-before="256pt" display-align="center">
<fo:table table-layout="fixed">
<fo:table-column column-width="{$colWidth3}in"/>
<fo:table-column column-width="{$colWidth3}in"/>
<fo:table-column column-width="{$colWidth3}in"/>
<fo:table-body>
<fo:table-row>
<fo:table-cell number-columns-spanned="2">
<fo:block space-before="{($middleHeight - 1) div 2}in">
</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell>
<fo:block space-after="0.5in"/>
</fo:table-cell>
<fo:table-cell number-columns-spanned="2" xsl:use-attribute-sets="cover.border.left">
<fo:block xsl:use-attribute-sets="cover.title" text-align="left" display-align="center" space-after="0.5in">
<xsl:value-of select="$coverProjectName"/> v.<xsl:value-of select="$coverVersion"/>
</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell>
<fo:block/>
</fo:table-cell>
<fo:table-cell number-columns-spanned="2" xsl:use-attribute-sets="cover.border.left.bottom">
<fo:block xsl:use-attribute-sets="cover.subtitle" text-align="left" display-align="center">
<xsl:value-of select="$coverType"/>
</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
</fo:table-cell>
</fo:table-row>
<fo:table-row height="{$lineHeight}in">
<fo:table-cell number-columns-spanned="2">
<fo:block line-height="{$lineHeight}in" space-after="0.2in">
<fo:leader xsl:use-attribute-sets="chapter.rule"/>
</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row height="{$footerHeight}in">
<fo:table-cell>
<fo:block xsl:use-attribute-sets="cover.subtitle" text-align="left" height="{$footerHeight}in">
<xsl:value-of select="$coverProjectCompany"/>
</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell number-columns-spanned="3">
<fo:block xsl:use-attribute-sets="cover.title" text-align="end" space-before="24pt" display-align="center">
<xsl:value-of select="$coverProjectName"/> v.<xsl:value-of select="$coverVersion"/>
</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell number-columns-spanned="3">
<fo:block xsl:use-attribute-sets="cover.subtitle" text-align="end" space-before="24pt" display-align="center">
<xsl:value-of select="$coverType"/>
</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell number-columns-spanned="3">
<fo:block xsl:use-attribute-sets="cover.subtitle" text-align="end" space-before="24pt" space-after="36pt" display-align="center">
<fo:table-cell>
<fo:block xsl:use-attribute-sets="cover.subtitle" text-align="right" height="{$footerHeight}in">
<xsl:value-of select="$coverDate"/>
</fo:block>
</fo:table-cell>

View File

@@ -9,28 +9,41 @@
</xsl:choose>
</xsl:variable>
<!-- Set the default page height, in inches -->
<xsl:variable name="pageHeight">11</xsl:variable>
<xsl:variable name="pageHeight">
<xsl:choose>
<xsl:when test="$paperType = 'US'">14</xsl:when>
<xsl:when test="$paperType = 'A4'">11.70</xsl:when>
<xsl:otherwise>14</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<!-- Set the max table width -->
<xsl:variable name="maxTableWidth" select="$maxBodyWidth"/>
<!-- Set the default left and right margin, in inches -->
<xsl:variable name="bodySideMargins">1</xsl:variable>
<xsl:variable name="maxBodyWidth" select="$pageWidth - (2 * $bodySideMargins)"/>
<xsl:variable name="maxTableWidth" select="$maxBodyWidth"/>
<!-- Set the default top and bottom margin, in inches -->
<xsl:variable name="bodyTopMargin">0.625</xsl:variable>
<xsl:variable name="bodyBottomMargin">0.6</xsl:variable>
<xsl:variable name="maxBodyHeight" select="$pageHeight - $bodyTopMargin - $bodyBottomMargin"/>
<xsl:variable name="regionTopMargin">0.7</xsl:variable>
<xsl:variable name="regionBottomMargin">0.8</xsl:variable>
<xsl:template name="fo-layouts">
<!-- Defines the layout set -->
<fo:layout-master-set>
<fo:simple-page-master master-name="cover-page" page-width="{$pageWidth}in" page-height="{$pageHeight}in" margin-top="0.2in" margin-bottom="0.2in" margin-left="{$bodySideMargins}in" margin-right="{$bodySideMargins}in">
<fo:region-body margin-top="0.7in"/>
<fo:simple-page-master master-name="cover-page" page-width="{$pageWidth}in" page-height="{$pageHeight}in" margin-top="{$bodyTopMargin}in" margin-bottom="{$bodyBottomMargin}in" margin-left="{$bodySideMargins}in" margin-right="{$bodySideMargins}in">
<fo:region-body margin-top="{$regionTopMargin}in"/>
</fo:simple-page-master>
<fo:simple-page-master master-name="cover-inside" page-width="{$pageWidth}in" page-height="{$pageHeight}in" margin-top="0in" margin-bottom="0in" margin-left="0in" margin-right="0in">
<fo:region-body margin-top="0in"/>
</fo:simple-page-master>
<fo:simple-page-master master-name="toc" page-width="{$pageWidth}in" page-height="{$pageHeight}in" margin-top="0.625in" margin-bottom="0.6in" margin-left="{$bodySideMargins}in" margin-right="{$bodySideMargins}in">
<fo:simple-page-master master-name="toc" page-width="{$pageWidth}in" page-height="{$pageHeight}in" margin-top="{$bodyTopMargin}in" margin-bottom="{$bodyBottomMargin}in" margin-left="{$bodySideMargins}in" margin-right="{$bodySideMargins}in">
<fo:region-before extent="0.35in"/>
<fo:region-body margin-top="0.7in" margin-bottom="0.8in"/>
<fo:region-body margin-top="{$regionTopMargin}in" margin-bottom="{$regionBottomMargin}in"/>
<fo:region-after extent="0.125in"/>
</fo:simple-page-master>
<fo:simple-page-master master-name="body" page-width="{$pageWidth}in" page-height="{$pageHeight}in" margin-top="0.625in" margin-bottom="0.6in" margin-left="{$bodySideMargins}in" margin-right="{$bodySideMargins}in">
<fo:simple-page-master master-name="body" page-width="{$pageWidth}in" page-height="{$pageHeight}in" margin-top="{$bodyTopMargin}in" margin-bottom="{$bodyBottomMargin}in" margin-left="{$bodySideMargins}in" margin-right="{$bodySideMargins}in">
<fo:region-before extent="0.35in"/>
<fo:region-body margin-top="0.7in" margin-bottom="0.8in"/>
<fo:region-body margin-top="{$regionTopMargin}in" margin-bottom="{$regionBottomMargin}in"/>
<fo:region-after extent="0.125in"/>
</fo:simple-page-master>
</fo:layout-master-set>

View File

@@ -0,0 +1,344 @@
<?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 all templates -->
<!-- Style 'primitives' from which all others are descended -->
<xsl:attribute-set name="base.body.style">
<xsl:attribute name="font-family">Garamond,serif</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="base.heading.style">
<xsl:attribute name="font-family">Helvetica,sans-serif</xsl:attribute>
<xsl:attribute name="color">#000000</xsl:attribute>
<xsl:attribute name="keep-with-next">always</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="base.pre.style">
<xsl:attribute name="font-family">monospace</xsl:attribute>
</xsl:attribute-set>
<!-- Standard body and heading styles -->
<xsl:attribute-set name="body.text" use-attribute-sets="base.body.style">
<xsl:attribute name="font-size">11pt</xsl:attribute>
<xsl:attribute name="line-height">12pt</xsl:attribute>
<xsl:attribute name="white-space-collapse">true</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="body.pre" use-attribute-sets="base.pre.style">
<xsl:attribute name="font-size">10pt</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="body.source" use-attribute-sets="base.pre.style">
<xsl:attribute name="font-size">8pt</xsl:attribute>
<xsl:attribute name="wrap-option">wrap</xsl:attribute>
<xsl:attribute name="white-space-collapse">false</xsl:attribute>
<xsl:attribute name="color">black</xsl:attribute>
<xsl:attribute name="border-style">dotted</xsl:attribute>
<xsl:attribute name="border-width">0.5pt</xsl:attribute>
<xsl:attribute name="border-color"><xsl:value-of select="$colorMediumGray"/></xsl:attribute>
<xsl:attribute name="padding-before">1.0em</xsl:attribute>
<xsl:attribute name="padding-after">1.25em</xsl:attribute>
<xsl:attribute name="padding-start">0.75em</xsl:attribute>
<xsl:attribute name="padding-end">0.75em</xsl:attribute>
<xsl:attribute name="start-indent">inherited-property-value(start-indent) + 2.5em</xsl:attribute>
<xsl:attribute name="end-indent">inherited-property-value(end-indent) + 3em</xsl:attribute>
<xsl:attribute name="space-before">0.75em</xsl:attribute>
<xsl:attribute name="space-after">1em</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="body.strong">
<xsl:attribute name="font-family">Helvetica,sans-serif</xsl:attribute>
<xsl:attribute name="font-size">9.0pt</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="body.title" use-attribute-sets="base.heading.style">
<xsl:attribute name="font-size">16pt</xsl:attribute>
<xsl:attribute name="font-weight">bold</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="body.h1" use-attribute-sets="base.heading.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 name="space-after">6pt</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="body.h2" use-attribute-sets="base.heading.style">
<xsl:attribute name="font-size">9.5pt</xsl:attribute>
<xsl:attribute name="font-weight">bold</xsl:attribute>
<xsl:attribute name="space-before">18pt</xsl:attribute>
<xsl:attribute name="space-after">5pt</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="body.h3" use-attribute-sets="base.heading.style">
<xsl:attribute name="font-size">9.5pt</xsl:attribute>
<xsl:attribute name="space-before">15pt</xsl:attribute>
<xsl:attribute name="space-after">3pt</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="body.h4" use-attribute-sets="base.heading.style">
<xsl:attribute name="font-size">9.5pt</xsl:attribute>
<xsl:attribute name="space-before">9pt</xsl:attribute>
<xsl:attribute name="space-after">3pt</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="body.h5" use-attribute-sets="base.heading.style">
<xsl:attribute name="font-size">9.5pt</xsl:attribute>
<xsl:attribute name="font-style">italic</xsl:attribute>
<xsl:attribute name="space-after">3pt</xsl:attribute>
</xsl:attribute-set>
<!-- Chapter heading styles -->
<xsl:attribute-set name="chapter.title" use-attribute-sets="base.heading.style body.title">
<xsl:attribute name="line-height">10pt</xsl:attribute>
<xsl:attribute name="space-after">6pt</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="chapter.rule">
<xsl:attribute name="leader-length.optimum">100%</xsl:attribute>
<xsl:attribute name="leader-pattern">dots</xsl:attribute>
<xsl:attribute name="rule-thickness">1pt</xsl:attribute>
<xsl:attribute name="color"><xsl:value-of select="$colorDarkGray"/></xsl:attribute>
</xsl:attribute-set>
<!-- Outdented numbers -->
<xsl:attribute-set name="outdented.number.style" use-attribute-sets="base.heading.style">
<xsl:attribute name="font-size">9.5pt</xsl:attribute>
<xsl:attribute name="color"><xsl:value-of select="$colorDarkGray"/></xsl:attribute>
<xsl:attribute name="line-height">10pt</xsl:attribute>
<xsl:attribute name="text-align">right</xsl:attribute>
</xsl:attribute-set>
<!-- Page header/footer styles -->
<xsl:attribute-set name="footer.style">
<xsl:attribute name="letter-spacing">2pt</xsl:attribute>
<xsl:attribute name="font-family">Helvetica,sans-serif</xsl:attribute>
<xsl:attribute name="font-size">6pt</xsl:attribute>
<xsl:attribute name="color"><xsl:value-of select="$colorDarkGray"/></xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="header.style">
<xsl:attribute name="letter-spacing">2pt</xsl:attribute>
<xsl:attribute name="font-family">Helvetica,sans-serif</xsl:attribute>
<xsl:attribute name="font-size">6pt</xsl:attribute>
<xsl:attribute name="color"><xsl:value-of select="$colorDarkGray"/></xsl:attribute>
<xsl:attribute name="text-align">left</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="page.number">
<xsl:attribute name="font-family">Helvetica,sans-serif</xsl:attribute>
<xsl:attribute name="font-size">9.5pt</xsl:attribute>
<xsl:attribute name="text-align">right</xsl:attribute>
<xsl:attribute name="color">black</xsl:attribute>
</xsl:attribute-set>
<!-- Style for hyperlinks -->
<xsl:attribute-set name="href.internal">
<xsl:attribute name="color">blue</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="href.external">
<xsl:attribute name="color">green</xsl:attribute>
</xsl:attribute-set>
<!-- 'Normal' line-spacing styles for paragraph and pre elements -->
<xsl:attribute-set name="normal.paragraph" use-attribute-sets="base.body.style">
<xsl:attribute name="space-before">3pt</xsl:attribute>
<xsl:attribute name="space-after">6pt</xsl:attribute>
</xsl:attribute-set>
<!-- Styles for lists, list items, definition lists, etc. -->
<xsl:attribute-set name="list">
<xsl:attribute name="start-indent">inherited-property-value(start-indent)</xsl:attribute>
<xsl:attribute name="provisional-distance-between-starts">1em</xsl:attribute>
<xsl:attribute name="provisional-label-separation">1em</xsl:attribute>
</xsl:attribute-set>
<!-- 1pt before, 3pts after -->
<xsl:attribute-set name="list.item">
<xsl:attribute name="start-indent">inherited-property-value(start-indent) + .5em</xsl:attribute>
<xsl:attribute name="space-before">0.15em</xsl:attribute>
<xsl:attribute name="space-after">0.25em</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="dl" use-attribute-sets="body.text">
<xsl:attribute name="start-indent">1em</xsl:attribute>
<xsl:attribute name="end-indent">1em</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="dt" use-attribute-sets="base.body.style">
<xsl:attribute name="start-indent">1em</xsl:attribute>
<xsl:attribute name="end-indent">1em</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="dd" use-attribute-sets="base.body.style">
<xsl:attribute name="start-indent">1em</xsl:attribute>
<xsl:attribute name="end-indent">1em</xsl:attribute>
<xsl:attribute name="space-before">0.6em</xsl:attribute>
<xsl:attribute name="space-after">0.6em</xsl:attribute>
</xsl:attribute-set>
<!-- Error style -->
<xsl:attribute-set name="error.block" use-attribute-sets="base.block">
<xsl:attribute name="font-size">8pt</xsl:attribute>
<xsl:attribute name="font-weight">bold</xsl:attribute>
<xsl:attribute name="color">red</xsl:attribute>
<xsl:attribute name="border-style">solid</xsl:attribute>
<xsl:attribute name="border-width">0.5pt</xsl:attribute>
<xsl:attribute name="border-color">red</xsl:attribute>
<xsl:attribute name="padding">0.75em</xsl:attribute>
<xsl:attribute name="start-indent">inherited-property-value(start-indent) + 2.5em</xsl:attribute>
<xsl:attribute name="end-indent">inherited-property-value(end-indent) + 3em</xsl:attribute>
</xsl:attribute-set>
<!-- cover styles -->
<xsl:attribute-set name="cover.title">
<xsl:attribute name="font-family">Helvetica,sans-serif</xsl:attribute>
<xsl:attribute name="color">#000000</xsl:attribute>
<xsl:attribute name="keep-with-next">always</xsl:attribute>
<xsl:attribute name="font-size">16pt</xsl:attribute>
<xsl:attribute name="font-weight">bold</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="cover.subtitle">
<xsl:attribute name="font-family">Helvetica,sans-serif</xsl:attribute>
<xsl:attribute name="color">#000000</xsl:attribute>
<xsl:attribute name="keep-with-next">always</xsl:attribute>
<xsl:attribute name="font-size">12pt</xsl:attribute>
<xsl:attribute name="font-weight">bold</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="cover.border.left" use-attribute-sets="base.pre.style">
<xsl:attribute name="padding-start">0.2in</xsl:attribute>
<xsl:attribute name="border-left-style">dotted</xsl:attribute>
<xsl:attribute name="border-left-width">0.1pt</xsl:attribute>
<xsl:attribute name="border-left-color">#000000</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="cover.border.left.bottom" use-attribute-sets="cover.border.left">
<xsl:attribute name="padding-after">0.2in</xsl:attribute>
<xsl:attribute name="border-bottom-style">dotted</xsl:attribute>
<xsl:attribute name="border-bottom-width">0.1pt</xsl:attribute>
<xsl:attribute name="border-bottom-color">#000000</xsl:attribute>
</xsl:attribute-set>
<!-- Tables styles -->
<xsl:attribute-set name="table.heading.rule">
<xsl:attribute name="leader-length.optimum">100%</xsl:attribute>
<xsl:attribute name="leader-pattern">rule</xsl:attribute>
<xsl:attribute name="rule-thickness">0.5pt</xsl:attribute>
<xsl:attribute name="color">black</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="base.cell">
<xsl:attribute name="padding-start">2.5pt</xsl:attribute>
<xsl:attribute name="padding-end">5pt</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="base.block">
<xsl:attribute name="font-family">Helvetica,sans-serif</xsl:attribute>
<xsl:attribute name="line-height">1.2em</xsl:attribute>
</xsl:attribute-set>
<!-- Bumped padding down by 6 pts before & after -->
<xsl:attribute-set name="table.padding">
<xsl:attribute name="padding-before">9pt</xsl:attribute>
<xsl:attribute name="padding-after">12pt</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="table.title.row">
<xsl:attribute name="keep-together">always</xsl:attribute>
<xsl:attribute name="keep-with-next">always</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="table.title.cell" use-attribute-sets="base.cell">
<xsl:attribute name="border-after-style">solid</xsl:attribute>
<xsl:attribute name="border-after-width">0.5pt</xsl:attribute>
<xsl:attribute name="border-after-color">black</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="table.title.block" use-attribute-sets="base.block">
<xsl:attribute name="font-size">9.5pt</xsl:attribute>
<xsl:attribute name="font-weight">bold</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="table.footer.cell" use-attribute-sets="base.cell">
<xsl:attribute name="padding-before">5pt</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="table.footer.block" use-attribute-sets="base.block">
<xsl:attribute name="font-size">7pt</xsl:attribute>
<xsl:attribute name="font-style">italic</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="table.heading.cell" use-attribute-sets="base.cell">
<xsl:attribute name="padding-before">7pt</xsl:attribute>
<xsl:attribute name="display-align">after</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="table.heading.block" use-attribute-sets="base.block">
<xsl:attribute name="font-size">8pt</xsl:attribute>
<xsl:attribute name="font-weight">bold</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="table.heading.rule">
<xsl:attribute name="leader-length.optimum">100%</xsl:attribute>
<xsl:attribute name="leader-pattern">rule</xsl:attribute>
<xsl:attribute name="rule-thickness">0.5pt</xsl:attribute>
<xsl:attribute name="color">black</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="table.number.cell" use-attribute-sets="base.cell">
<xsl:attribute name="padding-before">6pt</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="table.number.block" use-attribute-sets="base.block">
<xsl:attribute name="font-size">7pt</xsl:attribute>
<xsl:attribute name="font-style">italic</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="table.subheading.row">
<xsl:attribute name="keep-together">always</xsl:attribute>
<xsl:attribute name="keep-with-next">always</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="table.subheading.cell" use-attribute-sets="base.cell">
<xsl:attribute name="padding-after">1pt</xsl:attribute>
<xsl:attribute name="background-color"><xsl:value-of select="$colorLightGray"/></xsl:attribute>
<xsl:attribute name="border-before-style">solid</xsl:attribute>
<xsl:attribute name="border-before-width">2.5pt</xsl:attribute>
<xsl:attribute name="border-before-color"><xsl:value-of select="$colorLightGray"/></xsl:attribute>
<xsl:attribute name="display-align">after</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="table.subheading.block" use-attribute-sets="base.block">
<xsl:attribute name="font-size">7pt</xsl:attribute>
<xsl:attribute name="font-weight">bold</xsl:attribute>
<xsl:attribute name="vertical-align">bottom</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="table.body.row">
<xsl:attribute name="keep-together">always</xsl:attribute>
<xsl:attribute name="keep-with-next">always</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="table.body.norule">
<xsl:attribute name="leader-length.optimum">100%</xsl:attribute>
<xsl:attribute name="leader-pattern">rule</xsl:attribute>
<xsl:attribute name="rule-thickness">1pt</xsl:attribute>
<xsl:attribute name="color">white</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="table.body.rule">
<xsl:attribute name="leader-length.optimum">100%</xsl:attribute>
<xsl:attribute name="leader-pattern">dots</xsl:attribute>
<xsl:attribute name="rule-thickness">0.5pt</xsl:attribute>
<xsl:attribute name="color"><xsl:value-of select="$colorMediumGray"/></xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="table.body.lastrule">
<xsl:attribute name="leader-length.optimum">100%</xsl:attribute>
<xsl:attribute name="leader-pattern">rule</xsl:attribute>
<xsl:attribute name="rule-thickness">0.5pt</xsl:attribute>
<xsl:attribute name="color">black</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="table.body.cell" use-attribute-sets="base.cell">
<!-- Bumped both down by 3 pts -->
<xsl:attribute name="padding-before">4pt</xsl:attribute>
<xsl:attribute name="padding-after">1.5pt</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="table.body.block" use-attribute-sets="base.block">
<xsl:attribute name="font-size">7pt</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="table.pre" use-attribute-sets="base.pre.style">
<xsl:attribute name="font-size">7pt</xsl:attribute>
</xsl:attribute-set>
<!-- Table of content styles -->
<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>
</xsl:stylesheet>

View File

@@ -1,322 +1,7 @@
<?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 -->
<!-- Style 'primitives' from which all others are descended -->
<xsl:attribute-set name="base.cell">
<xsl:attribute name="padding-start">2.5pt</xsl:attribute>
<xsl:attribute name="padding-end">5pt</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="base.block">
<xsl:attribute name="font-family">Helvetica,sans-serif</xsl:attribute>
<xsl:attribute name="line-height">1.2em</xsl:attribute>
</xsl:attribute-set>
<!-- Table styles -->
<!-- Bumped padding down by 6 pts before & after -->
<xsl:attribute-set name="table.padding">
<xsl:attribute name="padding-before">9pt</xsl:attribute>
<xsl:attribute name="padding-after">12pt</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="table.title.row">
<xsl:attribute name="keep-together">always</xsl:attribute>
<xsl:attribute name="keep-with-next">always</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="table.title.cell" use-attribute-sets="base.cell">
<xsl:attribute name="border-after-style">solid</xsl:attribute>
<xsl:attribute name="border-after-width">0.5pt</xsl:attribute>
<xsl:attribute name="border-after-color">black</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="table.title.block" use-attribute-sets="base.block">
<xsl:attribute name="font-size">9.5pt</xsl:attribute>
<xsl:attribute name="font-weight">bold</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="table.footer.cell" use-attribute-sets="base.cell">
<xsl:attribute name="padding-before">5pt</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="table.footer.block" use-attribute-sets="base.block">
<xsl:attribute name="font-size">7pt</xsl:attribute>
<xsl:attribute name="font-style">italic</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="table.heading.cell" use-attribute-sets="base.cell">
<xsl:attribute name="padding-before">7pt</xsl:attribute>
<xsl:attribute name="display-align">after</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="table.heading.block" use-attribute-sets="base.block">
<xsl:attribute name="font-size">7pt</xsl:attribute>
<!--
<xsl:attribute name="font-weight">bold</xsl:attribute>
-->
</xsl:attribute-set>
<xsl:attribute-set name="table.heading.rule">
<xsl:attribute name="leader-length.optimum">100%</xsl:attribute>
<xsl:attribute name="leader-pattern">rule</xsl:attribute>
<!--
<xsl:attribute name="rule-thickness">1pt</xsl:attribute>
-->
<xsl:attribute name="rule-thickness">0.5pt</xsl:attribute>
<xsl:attribute name="color">black</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="table.number.cell" use-attribute-sets="base.cell">
<xsl:attribute name="padding-before">6pt</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="table.number.block" use-attribute-sets="base.block">
<xsl:attribute name="font-size">7pt</xsl:attribute>
<xsl:attribute name="font-style">italic</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="table.subheading.row">
<xsl:attribute name="keep-together">always</xsl:attribute>
<xsl:attribute name="keep-with-next">always</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="table.subheading.cell" use-attribute-sets="base.cell">
<xsl:attribute name="padding-after">1pt</xsl:attribute>
<xsl:attribute name="background-color"><xsl:value-of select="$colorLightGray"/></xsl:attribute>
<xsl:attribute name="border-before-style">solid</xsl:attribute>
<xsl:attribute name="border-before-width">2.5pt</xsl:attribute>
<xsl:attribute name="border-before-color"><xsl:value-of select="$colorLightGray"/></xsl:attribute>
<xsl:attribute name="display-align">after</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="table.subheading.block" use-attribute-sets="base.block">
<xsl:attribute name="font-size">7pt</xsl:attribute>
<xsl:attribute name="font-weight">bold</xsl:attribute>
<xsl:attribute name="vertical-align">bottom</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="table.body.row">
<xsl:attribute name="keep-together">always</xsl:attribute>
<xsl:attribute name="keep-with-next">always</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="table.body.norule">
<xsl:attribute name="leader-length.optimum">100%</xsl:attribute>
<xsl:attribute name="leader-pattern">rule</xsl:attribute>
<xsl:attribute name="rule-thickness">1pt</xsl:attribute>
<xsl:attribute name="color">white</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="table.body.rule">
<xsl:attribute name="leader-length.optimum">100%</xsl:attribute>
<xsl:attribute name="leader-pattern">dots</xsl:attribute>
<xsl:attribute name="rule-thickness">0.5pt</xsl:attribute>
<xsl:attribute name="color"><xsl:value-of select="$colorMediumGray"/></xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="table.body.lastrule">
<xsl:attribute name="leader-length.optimum">100%</xsl:attribute>
<xsl:attribute name="leader-pattern">rule</xsl:attribute>
<xsl:attribute name="rule-thickness">0.5pt</xsl:attribute>
<xsl:attribute name="color">black</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="table.body.cell" use-attribute-sets="base.cell">
<!-- Bumped both down by 3 pts -->
<xsl:attribute name="padding-before">4pt</xsl:attribute>
<xsl:attribute name="padding-after">1.5pt</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="table.body.block" use-attribute-sets="base.block">
<xsl:attribute name="font-size">7pt</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="table.pre" use-attribute-sets="base.pre.style">
<xsl:attribute name="font-size">7pt</xsl:attribute>
</xsl:attribute-set>
<!-- Table rendering -->
<!--
<xsl:template match="table[count(thead)=0]">
<fo:block xsl:use-attribute-sets="error.block">
Warning: the supplied &lt;table&gt; did not contain a &lt;thead&gt; element. It was excluded from the generated XSL:FO file.
</fo:block>
</xsl:template>
-->
<!-- HTML tables generation without THEAD and TBODY -->
<xsl:template match="table[count(thead)=0]" name="html-find-max-columns">
<!-- Before we do anything, we need to scan the table to find the maximum span -->
<xsl:param name="row">1</xsl:param>
<xsl:param name="maxColumns">1</xsl:param>
<!-- Get current row based on $row parameter -->
<xsl:variable name="currentRow" select="tr[position()=$row]"/>
<!-- Calculate the number of columns in this row. This will be the number
of th cells that don't have @colspan attributes, plus the sum of all
@colspan attributes in th cells that have them.
This algorithm isn't foolproof, because table headers with overlapping
rowspans could hose the counting under certain conditions.
-->
<xsl:variable name="nColumns" select="count($currentRow/th) + count($currentRow/tr) + sum($currentRow/th/@colspan) + sum($currentRow/tr/@colspan) - count($currentRow/th/@colspan) - count($currentRow/tr/@colspan)"/>
<xsl:variable name="newMaxColumns">
<xsl:choose>
<xsl:when test="$nColumns &gt; $maxColumns">
<xsl:value-of select="$nColumns"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$maxColumns"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<!-- Iterate through the template again if there are more rows -->
<xsl:choose>
<xsl:when test="tr[position()=$row+1]">
<xsl:call-template name="html-find-max-columns">
<xsl:with-param name="row" select="$row+1"/>
<xsl:with-param name="maxColumns" select="$newMaxColumns"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="html-print-table">
<xsl:with-param name="spacerSpanColumns" select="$newMaxColumns"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="table3" name="html-print-table">
<xsl:param name="spacerSpanColumns">1</xsl:param>
<xsl:comment> :::::: New table :::::: </xsl:comment>
<fo:block xsl:use-attribute-sets="table.padding">
<fo:table table-layout="fixed" table-omit-footer-at-break="false">
<!-- The next template calculates table column widths e.g.,...
<fo:table-column column-width="1.25in"/>
<fo:table-column column-width="5.0in"/>
-->
<xsl:call-template name="html-calculate-column-widths"/>
<fo:table-header>
<!-- If there is a 'title' attribute, output a title row -->
<xsl:if test="@title">
<xsl:comment> This table has a @title, so add a row for it </xsl:comment>
<fo:table-row keep-together="always" keep-with-next="always">
<fo:table-cell number-columns-spanned="{$spacerSpanColumns}" xsl:use-attribute-sets="table.title.cell">
<fo:block xsl:use-attribute-sets="table.title.block">
<xsl:value-of select="@title"/>
</fo:block>
</fo:table-cell>
</fo:table-row>
</xsl:if>
</fo:table-header>
<!-- If there is a caption element, output a table-footer -->
<fo:table-footer>
<!-- If there is a caption, add it -->
<xsl:if test="caption">
<xsl:comment> This table has a caption, so add a row for it </xsl:comment>
<fo:table-row>
<fo:table-cell number-columns-spanned="{$spacerSpanColumns}" xsl:use-attribute-sets="table.footer.cell">
<fo:block xsl:use-attribute-sets="table.footer.block">
<xsl:value-of select="caption"/>
</fo:block>
</fo:table-cell>
</fo:table-row>
</xsl:if>
<!-- Put in a sequential table number -->
<!--
<fo:table-row>
<fo:table-cell number-columns-spanned="{$spacerSpanColumns}" xsl:use-attribute-sets="table.number.cell">
<fo:block xsl:use-attribute-sets="table.number.block">
Table <xsl:value-of select="count(preceding-sibling::table) + 1"/>
</fo:block>
</fo:table-cell>
</fo:table-row>
-->
</fo:table-footer>
<!-- Process any tbody/tr or tr records -->
<fo:table-body>
<xsl:apply-templates select="tr" mode="html-table">
<xsl:with-param name="spacerSpanColumns" select="$spacerSpanColumns"/>
</xsl:apply-templates>
</fo:table-body>
</fo:table>
</fo:block>
</xsl:template>
<xsl:template match="tr[th]" mode="html-table">
<xsl:comment> ::: Subheading row ::: </xsl:comment>
<!-- Changed from table.body.row (a bug!) -->
<fo:table-row xsl:use-attribute-sets="table.subheading.row">
<xsl:apply-templates select="th|td" mode="html-table"/>
</fo:table-row>
</xsl:template>
<xsl:template match="tr[last()]" mode="html-table">
<xsl:param name="spacerSpanColumns">1</xsl:param>
<xsl:variable name="nColumns" select="count(th|td) + sum(th/@colspan|td/@colspan) - count(th/@colspan|td/@colspan)"/>
<!-- Format the table row -->
<xsl:comment> ::: Table body row <xsl:value-of select="position()"/> (<xsl:value-of select="$nColumns"/> columns) ::: </xsl:comment>
<fo:table-row xsl:use-attribute-sets="table.body.row">
<xsl:apply-templates select="th|td" mode="html-table"/>
</fo:table-row>
<!-- Add a spacer/border row: last row rule -->
<xsl:comment> ::: Table row spacer for last row ::: </xsl:comment>
<fo:table-row keep-with-previous="always">
<fo:table-cell padding-after="3pt" number-columns-spanned="{$spacerSpanColumns}">
<fo:block line-height="1pt">
<xsl:comment> Ending border (solid rule) </xsl:comment>
<fo:leader xsl:use-attribute-sets="table.body.lastrule"/>
</fo:block>
</fo:table-cell>
</fo:table-row>
</xsl:template>
<xsl:template match="tr" mode="html-table">
<xsl:param name="spacerSpanColumns">1</xsl:param>
<xsl:param name="nextRow" select="following-sibling::tr[1]"/>
<xsl:variable name="nColumns" select="count($nextRow/th | $nextRow/td)
+ sum($nextRow/th/@colspan |$nextRow/td/@colspan)
- count($nextRow/th/@colspan | $nextRow/td/@colspan)"/>
<!-- Table body rows work as follows:
- If the current row is not followed by a 'subheading' row,
add a bottom border
- If the current row is also the last row, add a
'final' bottom border, otherwise a 'normal' bottom border
- Otherwise, do not add a bottom border
- Process the row by building table cells one at a time
-->
<!-- Format the table row -->
<xsl:comment> ::: Table body row <xsl:value-of select="position()"/> (<xsl:value-of select="$nColumns"/> columns) ::: </xsl:comment>
<fo:table-row xsl:use-attribute-sets="table.body.row">
<xsl:apply-templates select="th|td" mode="html-table"/>
</fo:table-row>
<!-- Add in a spacer/border row -->
<xsl:comment> ::: Table row spacer for row <xsl:value-of select="position()"/> ::: </xsl:comment>
<fo:table-row keep-with-previous="always">
<fo:table-cell padding-after="3pt" number-columns-spanned="{$nColumns}">
<fo:block line-height="1pt">
<xsl:choose>
<!-- If next row contains a th; no border, 2pt padding, 1pt white rule -->
<xsl:when test="following-sibling::tr[1]/th">
<xsl:comment> Spacer only </xsl:comment>
<fo:leader xsl:use-attribute-sets="table.body.norule"/>
</xsl:when>
<!-- If a row follows; regular border -->
<xsl:when test="following-sibling::tr[1]">
<xsl:comment> Regular border (rule) </xsl:comment>
<fo:leader xsl:use-attribute-sets="table.body.rule"/>
</xsl:when>
<!-- Last row border -->
<xsl:otherwise>
<xsl:comment> Ending border (rule) </xsl:comment>
<fo:leader xsl:use-attribute-sets="table.body.lastrule"/>
</xsl:otherwise>
</xsl:choose>
</fo:block>
</fo:table-cell>
</fo:table-row>
</xsl:template>
<xsl:template match="th" mode="html-table">
<xsl:comment> : Table subheading cell : </xsl:comment>
<fo:table-cell xsl:use-attribute-sets="table.subheading.cell">
<xsl:apply-templates select="@colspan|@rowspan|@align" mode="html-table"/>
<fo:block xsl:use-attribute-sets="table.subheading.block">
<xsl:apply-templates/>
</fo:block>
</fo:table-cell>
</xsl:template>
<xsl:template match="td" mode="html-table">
<xsl:comment> : Table body cell <xsl:value-of select="position()"/> : </xsl:comment>
<fo:table-cell xsl:use-attribute-sets="table.body.cell">
<xsl:apply-templates select="@colspan|@rowspan|@align" mode="html-table"/>
<xsl:apply-templates select="*" mode="table"/>
<fo:block xsl:use-attribute-sets="table.body.block">
<xsl:apply-templates/>
</fo:block>
</fo:table-cell>
</xsl:template>
<xsl:template match="@align" mode="html-table">
<xsl:attribute name="text-align"><xsl:value-of select="."/></xsl:attribute>
</xsl:template>
<xsl:template match="@colspan" mode="html-table">
<xsl:attribute name="number-columns-spanned"><xsl:value-of select="number(.)"/></xsl:attribute>
</xsl:template>
<xsl:template match="@rowspan" mode="html-table">
<xsl:attribute name="number-rows-spanned"><xsl:value-of select="number(.)"/></xsl:attribute>
</xsl:template>
<!-- HTML tables generation with THEAD and TBODY -->
<!-- Generation for tables with THEAD and TBODY -->
<xsl:template match="table" name="find-max-columns">
<!-- Before we do anything, we need to scan the table to find the maximum span -->
<xsl:param name="row">1</xsl:param>
@@ -355,15 +40,15 @@
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="table2" name="print-table">
<xsl:template name="print-table">
<xsl:param name="spacerSpanColumns">1</xsl:param>
<xsl:comment> :::::: New table :::::: </xsl:comment>
<fo:block xsl:use-attribute-sets="table.padding">
<fo:table table-layout="fixed" table-omit-footer-at-break="false">
<!-- The next template calculates table column widths e.g.,...
<fo:table-column column-width="1.25in"/>
<fo:table-column column-width="5.0in"/>
-->
<fo:table-column column-width="1.25in"/>
<fo:table-column column-width="5.0in"/>
-->
<xsl:call-template name="calculate-column-widths"/>
<fo:table-header>
<!-- If there is a 'title' attribute, output a title row -->
@@ -378,7 +63,7 @@
</fo:table-row>
</xsl:if>
<!-- Process any thead elements -->
<xsl:apply-templates select="thead" mode="table-head">
<xsl:apply-templates select="thead">
<xsl:with-param name="spacerSpanColumns" select="$spacerSpanColumns"/>
</xsl:apply-templates>
</fo:table-header>
@@ -395,93 +80,124 @@
</fo:table-cell>
</fo:table-row>
</xsl:if>
<!-- Put in a sequential table number -->
<!--
<fo:table-row>
<fo:table-cell number-columns-spanned="{$spacerSpanColumns}" xsl:use-attribute-sets="table.number.cell">
<fo:block xsl:use-attribute-sets="table.number.block">
Table <xsl:value-of select="count(preceding-sibling::table) + 1"/>
</fo:block>
</fo:table-cell>
</fo:table-row>
-->
</fo:table-footer>
<!-- Process any tbody/tr or tr records -->
<fo:table-body>
<xsl:apply-templates select="tbody/tr|tr" mode="table-body">
<xsl:apply-templates select="tbody/tr | tr">
<xsl:with-param name="spacerSpanColumns" select="$spacerSpanColumns"/>
</xsl:apply-templates>
</fo:table-body>
</fo:table>
</fo:block>
</xsl:template>
<xsl:template match="thead" mode="table-head">
<!-- Generation for tables without THEAD and TBODY -->
<xsl:template match="table[count(thead)=0]" name="html-find-max-columns">
<!-- Before we do anything, we need to scan the table to find the maximum span -->
<xsl:param name="row">1</xsl:param>
<xsl:param name="maxColumns">1</xsl:param>
<!-- Get current row based on $row parameter -->
<xsl:variable name="currentRow" select="tr[position()=$row]"/>
<!-- Calculate the number of columns in this row. This will be the number
of th cells that don't have @colspan attributes, plus the sum of all
@colspan attributes in th cells that have them.
This algorithm isn't foolproof, because table headers with overlapping
rowspans could hose the counting under certain conditions.
-->
<xsl:variable name="nColumns" select="count($currentRow/th) + count($currentRow/tr) + sum($currentRow/th/@colspan) + sum($currentRow/tr/@colspan) - count($currentRow/th/@colspan) - count($currentRow/tr/@colspan)"/>
<xsl:variable name="newMaxColumns">
<xsl:choose>
<xsl:when test="$nColumns &gt; $maxColumns">
<xsl:value-of select="$nColumns"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$maxColumns"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<!-- Iterate through the template again if there are more rows -->
<xsl:choose>
<xsl:when test="tr[position()=$row+1]">
<xsl:call-template name="html-find-max-columns">
<xsl:with-param name="row" select="$row+1"/>
<xsl:with-param name="maxColumns" select="$newMaxColumns"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="html-print-table">
<xsl:with-param name="spacerSpanColumns" select="$newMaxColumns"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="html-print-table">
<xsl:param name="spacerSpanColumns">1</xsl:param>
<!-- Process any tr elements -->
<xsl:apply-templates select="tr" mode="table-head"/>
<!-- Add a spacer: 4 pt total, 1 pt black line -->
<xsl:comment> Table heading bottom spacer </xsl:comment>
<fo:table-row keep-with-previous="always">
<fo:table-cell padding-after="4.75pt" number-columns-spanned="{$spacerSpanColumns}">
<fo:block line-height="1pt">
<fo:leader xsl:use-attribute-sets="table.heading.rule"/>
</fo:block>
</fo:table-cell>
</fo:table-row>
<xsl:comment> :::::: New table :::::: </xsl:comment>
<fo:block xsl:use-attribute-sets="table.padding">
<fo:table table-layout="fixed" table-omit-footer-at-break="false">
<!-- The next template calculates table column widths e.g.,...
<fo:table-column column-width="1.25in"/>
<fo:table-column column-width="5.0in"/>
-->
<xsl:call-template name="html-calculate-column-widths"/>
<fo:table-header>
<!-- If there is a 'title' attribute, output a title row -->
<xsl:if test="@title">
<xsl:comment> This table has a @title, so add a row for it </xsl:comment>
<fo:table-row keep-together="always" keep-with-next="always">
<fo:table-cell number-columns-spanned="{$spacerSpanColumns}" xsl:use-attribute-sets="table.title.cell">
<fo:block xsl:use-attribute-sets="table.title.block">
<xsl:value-of select="@title"/>
</fo:block>
</fo:table-cell>
</fo:table-row>
</xsl:if>
<!-- if the first row is only made of table headers cells (th)
then we will simulate that this row is the table header.
(As if there was a thead block
-->
<xsl:if test="tr[1][count(*)=count(th)]">
<!-- Process any tr elements -->
<xsl:apply-templates select="tr[1][count(*)=count(th)]"/>
<!-- Add a spacer: 4 pt total, 1 pt black line -->
<xsl:comment> Table heading bottom spacer </xsl:comment>
<fo:table-row keep-with-previous="always">
<fo:table-cell padding-after="4.75pt" number-columns-spanned="{$spacerSpanColumns}">
<fo:block line-height="1pt">
<fo:leader xsl:use-attribute-sets="table.heading.rule"/>
</fo:block>
</fo:table-cell>
</fo:table-row>
</xsl:if>
</fo:table-header>
<!-- If there is a caption element, output a table-footer -->
<fo:table-footer>
<!-- If there is a caption, add it -->
<xsl:if test="caption">
<xsl:comment> This table has a caption, so add a row for it </xsl:comment>
<fo:table-row>
<fo:table-cell number-columns-spanned="{$spacerSpanColumns}" xsl:use-attribute-sets="table.footer.cell">
<fo:block xsl:use-attribute-sets="table.footer.block">
<xsl:value-of select="caption"/>
</fo:block>
</fo:table-cell>
</fo:table-row>
</xsl:if>
</fo:table-footer>
<!-- Process any tbody/tr or tr records -->
<fo:table-body>
<xsl:apply-templates select="tr[position()!=1][count(*)!=count(th)]">
<xsl:with-param name="spacerSpanColumns" select="$spacerSpanColumns"/>
</xsl:apply-templates>
</fo:table-body>
</fo:table>
</fo:block>
</xsl:template>
<xsl:template match="tr" mode="table-head">
<xsl:comment> ::: Table heading row <xsl:value-of select="position()"/> ::: </xsl:comment>
<fo:table-row xsl:use-attribute-sets="table.title.row">
<!-- Process any th or td elements -->
<xsl:apply-templates select="th|td" mode="table-head"/>
</fo:table-row>
</xsl:template>
<xsl:template match="th|td" mode="table-head">
<xsl:comment> : Table heading cell <xsl:value-of select="position()"/> : </xsl:comment>
<fo:table-cell xsl:use-attribute-sets="table.heading.cell">
<xsl:if test="@colspan">
<xsl:attribute name="border-after-style">solid</xsl:attribute>
<xsl:attribute name="border-after-width">0.75pt</xsl:attribute>
<xsl:attribute name="border-after-color">black</xsl:attribute>
</xsl:if>
<xsl:apply-templates select="@colspan|@rowspan|@align" mode="table-head"/>
<fo:block xsl:use-attribute-sets="table.heading.block">
<xsl:apply-templates/>
</fo:block>
</fo:table-cell>
</xsl:template>
<xsl:template match="tr[th]" mode="table-body">
<xsl:comment> ::: Subheading row ::: </xsl:comment>
<!-- Changed from table.body.row (a bug!) -->
<fo:table-row xsl:use-attribute-sets="table.subheading.row">
<xsl:apply-templates select="th|td" mode="table-body"/>
</fo:table-row>
</xsl:template>
<xsl:template match="tr[last()]" mode="table-body">
<!-- body table row -->
<xsl:template match="table/tr | table/tbody/tr">
<xsl:param name="spacerSpanColumns">1</xsl:param>
<xsl:variable name="nColumns" select="count(th|td) + sum(th/@colspan|td/@colspan) - count(th/@colspan|td/@colspan)"/>
<!-- Format the table row -->
<xsl:comment> ::: Table body row <xsl:value-of select="position()"/> (<xsl:value-of select="$nColumns"/> columns) ::: </xsl:comment>
<fo:table-row xsl:use-attribute-sets="table.body.row">
<xsl:apply-templates select="th|td" mode="table-body"/>
</fo:table-row>
<!-- Add a spacer/border row: last row rule -->
<xsl:comment> ::: Table row spacer for last row ::: </xsl:comment>
<fo:table-row keep-with-previous="always">
<fo:table-cell padding-after="3pt" number-columns-spanned="{$spacerSpanColumns}">
<fo:block line-height="1pt">
<xsl:comment> Ending border (solid rule) </xsl:comment>
<fo:leader xsl:use-attribute-sets="table.body.lastrule"/>
</fo:block>
</fo:table-cell>
</fo:table-row>
</xsl:template>
<xsl:template match="tr" mode="table-body">
<xsl:param name="spacerSpanColumns">1</xsl:param>
<xsl:param name="nextRow" select="following-sibling::tr[1]"/>
<xsl:variable name="nColumns" select="count($nextRow/th | $nextRow/td)
+ sum($nextRow/th/@colspan |$nextRow/td/@colspan)
- count($nextRow/th/@colspan | $nextRow/td/@colspan)"/>
<xsl:variable name="nColumns" select="count(th | td)
+ sum(th/@colspan |td/@colspan)
- count(th/@colspan | td/@colspan)"/>
<!-- Table body rows work as follows:
- If the current row is not followed by a 'subheading' row,
add a bottom border
@@ -489,11 +205,11 @@
'final' bottom border, otherwise a 'normal' bottom border
- Otherwise, do not add a bottom border
- Process the row by building table cells one at a time
-->
-->
<!-- Format the table row -->
<xsl:comment> ::: Table body row <xsl:value-of select="position()"/> (<xsl:value-of select="$nColumns"/> columns) ::: </xsl:comment>
<fo:table-row xsl:use-attribute-sets="table.body.row">
<xsl:apply-templates select="th|td" mode="table-body"/>
<xsl:apply-templates select="th|td"/>
</fo:table-row>
<!-- Add in a spacer/border row -->
<xsl:comment> ::: Table row spacer for row <xsl:value-of select="position()"/> ::: </xsl:comment>
@@ -521,46 +237,111 @@
</fo:table-cell>
</fo:table-row>
</xsl:template>
<xsl:template match="th" mode="table-body">
<!-- a row containing at least a head cell -->
<xsl:template match="table/tbody/tr[th] | table/tr[th]">
<xsl:comment> ::: Subheading row ::: </xsl:comment>
<!-- Changed from table.body.row (a bug!) -->
<fo:table-row xsl:use-attribute-sets="table.subheading.row">
<xsl:apply-templates select="th|td"/>
</fo:table-row>
</xsl:template>
<!-- The last row -->
<xsl:template match="table/tbody/tr[last()] | table/tr[last()]">
<xsl:param name="spacerSpanColumns">1</xsl:param>
<xsl:variable name="nColumns" select="count(th|td) + sum(th/@colspan|td/@colspan) - count(th/@colspan|td/@colspan)"/>
<!-- Format the table row -->
<xsl:comment> ::: Table body row <xsl:value-of select="position()"/> (<xsl:value-of select="$nColumns"/> columns) ::: </xsl:comment>
<fo:table-row xsl:use-attribute-sets="table.body.row">
<xsl:apply-templates select="th|td"/>
</fo:table-row>
<!-- Add a spacer/border row: last row rule -->
<xsl:comment> ::: Table row spacer for last row ::: </xsl:comment>
<fo:table-row keep-with-previous="always">
<fo:table-cell padding-after="3pt" number-columns-spanned="{$spacerSpanColumns}">
<fo:block line-height="1pt">
<xsl:comment> Ending border (solid rule) </xsl:comment>
<fo:leader xsl:use-attribute-sets="table.body.lastrule"/>
</fo:block>
</fo:table-cell>
</fo:table-row>
</xsl:template>
<!-- the table head -->
<xsl:template match="thead">
<xsl:param name="spacerSpanColumns">1</xsl:param>
<!-- Process any tr elements -->
<xsl:apply-templates select="tr"/>
<!-- Add a spacer: 4 pt total, 1 pt black line -->
<xsl:comment> Table heading bottom spacer </xsl:comment>
<fo:table-row keep-with-previous="always">
<fo:table-cell padding-after="4.75pt" number-columns-spanned="{$spacerSpanColumns}">
<fo:block line-height="1pt">
<fo:leader xsl:use-attribute-sets="table.heading.rule"/>
</fo:block>
</fo:table-cell>
</fo:table-row>
</xsl:template>
<!-- Table heading rows -->
<xsl:template match="table/tr[1][count(*)=count(th)] | thead/tr">
<xsl:comment> ::: Table heading row <xsl:value-of select="position()"/> ::: </xsl:comment>
<fo:table-row xsl:use-attribute-sets="table.title.row">
<!-- Process any th or td elements -->
<xsl:apply-templates select="th|td"/>
</fo:table-row>
</xsl:template>
<!-- Table heading cell -->
<xsl:template match="table/tbody/tr/th | table/tr/th">
<xsl:comment> : Table subheading cell : </xsl:comment>
<fo:table-cell xsl:use-attribute-sets="table.subheading.cell">
<xsl:apply-templates select="@colspan|@rowspan|@align" mode="table-body"/>
<xsl:apply-templates select="@rowspan"/>
<xsl:apply-templates select="@colspan|@align"/>
<fo:block xsl:use-attribute-sets="table.subheading.block">
<xsl:apply-templates/>
</fo:block>
</fo:table-cell>
</xsl:template>
<xsl:template match="td" mode="table-body">
<!-- A heading cell -->
<xsl:template match="table/tr[1][count(*)=count(th)]/th | table/thead/tr/th | table/thead/tr/td">
<xsl:comment> : Table heading cell <xsl:value-of select="position()"/> : </xsl:comment>
<fo:table-cell xsl:use-attribute-sets="table.heading.cell">
<xsl:if test="@colspan">
<xsl:attribute name="border-after-style">solid</xsl:attribute>
<xsl:attribute name="border-after-width">0.75pt</xsl:attribute>
<xsl:attribute name="border-after-color">black</xsl:attribute>
</xsl:if>
<xsl:apply-templates select="@colspan|@rowspan|@align"/>
<fo:block xsl:use-attribute-sets="table.heading.block">
<xsl:apply-templates/>
</fo:block>
</fo:table-cell>
</xsl:template>
<!-- A table cell -->
<xsl:template match="td">
<xsl:comment> : Table body cell <xsl:value-of select="position()"/> : </xsl:comment>
<fo:table-cell xsl:use-attribute-sets="table.body.cell">
<xsl:apply-templates select="@colspan|@rowspan|@align" mode="table-body"/>
<xsl:apply-templates select="*" mode="table"/>
<xsl:apply-templates select="@colspan|@align|@rowspan"/>
<fo:block xsl:use-attribute-sets="table.body.block">
<xsl:apply-templates/>
</fo:block>
</fo:table-cell>
</xsl:template>
<!-- align and spanning attributes -->
<xsl:template match="@align">
<xsl:attribute name="text-align"><xsl:value-of select="."/></xsl:attribute>
</xsl:template>
<xsl:template match="@colspan">
<xsl:attribute name="number-columns-spanned"><xsl:value-of select="number(.)"/></xsl:attribute>
</xsl:template>
<!-- cell rowspan attribute -->
<xsl:template match="@rowspan">
<xsl:attribute name="number-rows-spanned"><xsl:value-of select="number(.) * 2 - 1"/></xsl:attribute>
</xsl:template>
<xsl:template match="@rowspan[ancestor::thead]">
<xsl:attribute name="number-rows-spanned"><xsl:value-of select="number(.)"/></xsl:attribute>
</xsl:template>
<!-- html tt tag or code tag in a table -->
<xsl:template match="tt|code[ancestor::table]">
<fo:inline xsl:use-attribute-sets="table.pre">
<xsl:apply-templates/>
</fo:inline>
</xsl:template>
<xsl:template match="@align" mode="table-head">
<xsl:attribute name="text-align"><xsl:value-of select="."/></xsl:attribute>
</xsl:template>
<xsl:template match="@align" mode="table-body">
<xsl:attribute name="text-align"><xsl:value-of select="."/></xsl:attribute>
</xsl:template>
<xsl:template match="@colspan" mode="table-head">
<xsl:attribute name="number-columns-spanned"><xsl:value-of select="number(.)"/></xsl:attribute>
</xsl:template>
<xsl:template match="@rowspan" mode="table-head">
<xsl:attribute name="number-rows-spanned"><xsl:value-of select="number(.)"/></xsl:attribute>
</xsl:template>
<xsl:template match="@colspan" mode="table-body">
<xsl:attribute name="number-columns-spanned"><xsl:value-of select="number(.)"/></xsl:attribute>
</xsl:template>
<xsl:template match="@rowspan" mode="table-body">
<xsl:attribute name="number-rows-spanned"><xsl:value-of select="number(.) * 2 - 1"/></xsl:attribute>
</xsl:template>
</xsl:stylesheet>
</xsl:stylesheet>

View File

@@ -1,46 +1,5 @@
<?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">

View File

@@ -1,5 +1,6 @@
<?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" xmlns:svg="http://www.w3.org/TR/2001/REC-SVG-20010904" version="1.0">
<xsl:include href="fo-styles.xslt"/>
<xsl:include href="fo-layouts.xslt"/>
<xsl:include href="fo-cover.xslt"/>
<xsl:include href="fo-toc.xslt"/>
@@ -24,29 +25,13 @@
<xsl:variable name="lc">abcdefghijklmnopqrstuvwxyz</xsl:variable>
<xsl:variable name="uc">ABCDEFGHIJKLMNOPQRSTUVWXYZ</xsl:variable>
<xsl:variable name="footerText">&#169;<xsl:value-of select="$publicationYear"/>
<xsl:value-of select="concat(' ',$companyIncName)"/> &#8226; All rights reserved
<xsl:if test="$confidential = 'true'">
&#8226; Proprietary and Confidential
</xsl:if>
<xsl:value-of select="concat(' ',$companyIncName)"/> &#8226; All rights reserved<xsl:if test="$confidential = 'true'">&#8226; Proprietary and Confidential</xsl:if>
</xsl:variable>
<xsl:variable name="colorDarkGray">#454545</xsl:variable>
<xsl:variable name="colorMediumGray">#A9A9A9</xsl:variable>
<xsl:variable name="colorLightGray">#D3D3D3</xsl:variable>
<!-- <xsl:variable name="colorWarmGrey11">#504b42</xsl:variable> -->
<xsl:variable name="colorWarmGrey11">#4b4542</xsl:variable>
<xsl:output method="xml" encoding="UTF-8" indent="yes" omit-xml-declaration="no"/>
<!-- Error style -->
<xsl:attribute-set name="error.block" use-attribute-sets="base.block">
<xsl:attribute name="font-size">8pt</xsl:attribute>
<xsl:attribute name="font-weight">bold</xsl:attribute>
<xsl:attribute name="color">red</xsl:attribute>
<xsl:attribute name="border-style">solid</xsl:attribute>
<xsl:attribute name="border-width">0.5pt</xsl:attribute>
<xsl:attribute name="border-color">red</xsl:attribute>
<xsl:attribute name="padding">0.75em</xsl:attribute>
<xsl:attribute name="start-indent">inherited-property-value(start-indent) + 2.5em</xsl:attribute>
<xsl:attribute name="end-indent">inherited-property-value(end-indent) + 3em</xsl:attribute>
</xsl:attribute-set>
<!-- Templates -->
<xsl:template match="/">
<xsl:apply-templates select="project"/>
@@ -58,9 +43,7 @@
</fo:root>
</xsl:template>
<xsl:template match="project/body">
<!-- Custom cover pages will be included in a future version -->
<xsl:call-template name="fo-cover"/>
<!-- <xsl:call-template name="fo-cover-inside" /> -->
<xsl:call-template name="fo-toc"/>
<xsl:apply-templates/>
</xsl:template>
@@ -110,51 +93,64 @@
<!-- Renders the xml xdoc document -->
<!-- Retrieve the xdoc file relative to the basePath;
the name is the href, but substitute .xml as the suffix -->
<xsl:variable name="href" select="@href"/>
<xsl:variable name="documentName" select="substring-before( @href, '.html' )"/>
<xsl:variable name="documentPath" select="concat($basePath, $documentName, '.xml')"/>
<xsl:if test="normalize-space(@href)">
<xsl:if test="$debug = 'true'">
<xsl:message>Creating XSL:FO for <xsl:value-of select="$documentPath"/>
</xsl:message>
</xsl:if>
<fo:page-sequence master-reference="body" initial-page-number="{$pageStart}">
<!-- Render the header and footer -->
<xsl:call-template name="body-header">
<xsl:with-param name="headerText" select="concat($chapterNumber, ' ', translate(@name, $lc, $uc))"/>
<xsl:variable name="href">
<xsl:choose>
<!-- If :
- the href isn't a complete url (http://)
- and the href isn't already starting with / -->
<xsl:when test="not(starts-with(normalize-space(@href),'http')) and not(starts-with(normalize-space(@href),'/'))">
<xsl:text>/</xsl:text>
<xsl:value-of select="normalize-space(@href)"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="normalize-space(@href)"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="documentName" select="substring-before( $href, '.html' )"/>
<fo:page-sequence master-reference="body" initial-page-number="{$pageStart}">
<!-- Render the header and footer -->
<xsl:call-template name="body-header">
<xsl:with-param name="headerText" select="concat($chapterNumber, ' ', translate(@name, $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:value-of select="$chapterNumber"/>
</xsl:with-param>
<xsl:with-param name="chapter">
<xsl:value-of select="@name"/>
</xsl:with-param>
</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:value-of select="$chapterNumber"/>
</xsl:with-param>
<xsl:with-param name="chapter">
<xsl:value-of select="@name"/>
</xsl:with-param>
</xsl:call-template>
<!-- Render the associated xdoc -->
<fo:block id="{@href}{generate-id()}">
<xsl:if test="not(starts-with($href, 'http'))">
<!-- Render the associated xdoc -->
<fo:block id="{@href}{generate-id()}">
<xsl:choose>
<xsl:when test="not(starts-with($href, 'http'))">
<xsl:variable name="documentPath" select="concat(normalize-space($basePath),normalize-space( $documentName), '.xml')"/>
<xsl:if test="$debug = 'true'">
<xsl:message>Creating XSL:FO for <xsl:value-of select="$documentPath"/>
</xsl:message>
</xsl:if>
<xsl:apply-templates select="document($documentPath)/document/body">
<xsl:with-param name="chapterNumber">
<xsl:value-of select="$chapterNumber"/>
</xsl:with-param>
</xsl:apply-templates>
</xsl:if>
<xsl:if test="starts-with($href, 'http')">
<fo:basic-link external-destination="{@href}">
<fo:inline xsl:use-attribute-sets="href">
</xsl:when>
<xsl:otherwise>
<fo:basic-link external-destination="{$href}">
<fo:inline xsl:use-attribute-sets="href.external">
<xsl:value-of select="$href"/>
</fo:inline>
</fo:basic-link>
</xsl:if>
</fo:block>
</fo:flow>
</fo:page-sequence>
</xsl:if>
</xsl:otherwise>
</xsl:choose>
</fo:block>
</fo:flow>
</fo:page-sequence>
</xsl:template>
</xsl:stylesheet>