MAVEN-MPPDF-1. Completely re-writte of the PDF plug-in. It solves most of the thorniest issues, such as table formatting, more levels in the table of contents, and image sizing. The graphic design is also dramatically improved.
git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@114586 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
1 parent
e22afcb573
commit
4b9b58b7ec
18 files changed
+1793
-494
No files matched your search
+99
-41
@@ -1,14 +1,47 @@
|
||||
<?xml version="1.0"?>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<project xmlns:j="jelly:core" xmlns:u="jelly:util">
|
||||
<project xmlns:j="jelly:core">
|
||||
|
||||
<goal
|
||||
<goal
|
||||
name="pdf:init"
|
||||
prereqs="xdoc:init">
|
||||
|
||||
<j:set var="docsDest" value="${maven.docs.dest}"/>
|
||||
<j:set var="docsSrc" value="${maven.docs.src}"/>
|
||||
|
||||
<j:set var="docsXdocSrc"
|
||||
value="${pom.getPluginContext('maven-xdoc-plugin').getVariable('maven.docs.src')}"/>
|
||||
<j:set var="docsGenSrc"
|
||||
value="${pom.getPluginContext('maven-xdoc-plugin').getVariable('maven.gen.docs')}"/>
|
||||
<j:set var="docsPdf"
|
||||
value="${maven.build.dir}/pdf"/>
|
||||
<j:set var="docsToc"
|
||||
value="${pom.getPluginContext('maven-xdoc-plugin').getVariable('maven.docs.src')}/navigation.xml"/>
|
||||
<j:set var="confidential"
|
||||
value="${pom.getPluginContext('maven-pdf-plugin').getVariable('maven.pdf.confidential')}"/>
|
||||
<j:set var="paperType"
|
||||
value="${pom.getPluginContext('maven-pdf-plugin').getVariable('maven.pdf.paperType')}"/>
|
||||
<j:set var="companyName"
|
||||
value="${pom.getPluginContext('maven-pdf-plugin').getVariable('maven.pdf.companyName')}"/>
|
||||
<j:set var="companyIncName"
|
||||
value="${pom.getPluginContext('maven-pdf-plugin').getVariable('maven.pdf.companyIncName')}"/>
|
||||
<j:set var="publicationYear"
|
||||
value="${pom.getPluginContext('maven-pdf-plugin').getVariable('maven.pdf.copyrightYear')}"/>
|
||||
<j:set var="coverProjectCompany"
|
||||
value="${pom.getPluginContext('maven-pdf-plugin').getVariable('maven.pdf.cover.projectCompany')}"/>
|
||||
<j:set var="coverProjectName"
|
||||
value="${pom.getPluginContext('maven-pdf-plugin').getVariable('maven.pdf.cover.projectName')}"/>
|
||||
<j:set var="coverType"
|
||||
value="${pom.getPluginContext('maven-pdf-plugin').getVariable('maven.pdf.cover.type')}"/>
|
||||
<j:set var="coverVersion"
|
||||
value="${pom.getPluginContext('maven-pdf-plugin').getVariable('maven.pdf.cover.version')}"/>
|
||||
<j:set var="coverDate"
|
||||
value="${pom.getPluginContext('maven-pdf-plugin').getVariable('maven.pdf.cover.date')}"/>
|
||||
<j:set var="projectLogo"
|
||||
value="${docsPdf}/images/${pom.getPluginContext('maven-pdf-plugin').getVariable('maven.pdf.projectLogo')}"/>
|
||||
<j:set var="companyLogo"
|
||||
value="${docsPdf}/images/${pom.getPluginContext('maven-pdf-plugin').getVariable('maven.pdf.companyLogo')}"/>
|
||||
<j:set var="imageDpi"
|
||||
value="${pom.getPluginContext('maven-pdf-plugin').getVariable('maven.pdf.imageDpi')}"/>
|
||||
<j:set var="debug"
|
||||
value="${pom.getPluginContext('maven-pdf-plugin').getVariable('maven.pdf.debug')}"/>
|
||||
<mkdir dir="${docsPdf}"/>
|
||||
</goal>
|
||||
|
||||
<goal
|
||||
@@ -16,62 +49,87 @@
|
||||
prereqs="fo:fo"
|
||||
description="Generate XSL:FO project documentation"/>
|
||||
|
||||
<goal name="fo:fo"
|
||||
prereqs="pdf:init"
|
||||
<goal name="fo:fo"
|
||||
prereqs="pdf:prepare"
|
||||
description="Generate XSL:FO project documentation">
|
||||
|
||||
<echo>Generating ${docsDest}/project.fo ...</echo>
|
||||
<available file="${docsSrc}/navigation.xml"
|
||||
<available file="${docsToc}"
|
||||
property="maven.fo.navigation.available"/>
|
||||
<fail message="PDF generation cannot complete as ${docsSrc}/navigation.xml is missing"
|
||||
<fail message="PDF generation cannot complete as ${docsToc} is missing"
|
||||
unless="maven.fo.navigation.available"/>
|
||||
<u:file name="${plugin.resources}/project2fo.xslt" var="stylesheetFile" />
|
||||
<u:file name="${docsSrc}/navigation.xml" var="navigationFile" />
|
||||
<java classname="org.apache.xalan.xslt.Process" fork="yes" failonerror="true">
|
||||
<classpath>
|
||||
<pathelement location="${plugin.getDependencyPath('xerces')}"/>
|
||||
<pathelement location="${plugin.getDependencyPath('xml-apis')}"/>
|
||||
<pathelement location="${plugin.getDependencyPath('xalan')}"/>
|
||||
</classpath>
|
||||
<sysproperty key="user.language" value="en"/>
|
||||
<arg value="-in"/>
|
||||
<arg value="${navigationFile.toURL().toExternalForm()}"/>
|
||||
<arg value="-out"/>
|
||||
<arg value="${docsDest}/project.fo"/>
|
||||
<arg value="-xsl"/>
|
||||
<arg value="${stylesheetFile.toURL().toExternalForm()}"/>
|
||||
<arg value="-param"/>
|
||||
<arg value="basePath"/>
|
||||
<arg value="${docsSrc}"/>
|
||||
</java>
|
||||
|
||||
<!-- 'Major hack.' Stolen from the Latka plugin.jelly. All of this could be avoided by putting
|
||||
xalan into $MAVEN_HOME/lib/endorsed directory in the distribution, but never mind -->
|
||||
${systemScope.setProperty('javax.xml.transform.TransformerFactory','org.apache.xalan.processor.TransformerFactoryImpl')}
|
||||
<style in="${docsToc}" out="${docsPdf}/project.fo" style="${plugin.resources}/project2fo.xslt" force="true">
|
||||
<param name="basePath" expression="${docsPdf}"/>
|
||||
<param name="confidential" expression="${confidential}"/>
|
||||
<param name="paperType" expression="${paperType}"/>
|
||||
<param name="companyName" expression="${companyName}"/>
|
||||
<param name="companyIncName" expression="${companyIncName}"/>
|
||||
<param name="publicationYear" expression="${publicationYear}"/>
|
||||
<param name="coverProjectCompany" expression="${coverProjectCompany}"/>
|
||||
<param name="coverProjectName" expression="${coverProjectName}"/>
|
||||
<param name="coverType" expression="${coverType}"/>
|
||||
<param name="coverVersion" expression="${coverVersion}"/>
|
||||
<param name="coverDate" expression="${coverDate}"/>
|
||||
<param name="companyLogo" expression="${companyLogo}"/>
|
||||
<param name="projectLogo" expression="${projectLogo}"/>
|
||||
<param name="imageDpi" expression="${imageDpi}"/>
|
||||
<param name="debug" expression="${debug}"/>
|
||||
</style>
|
||||
</goal>
|
||||
|
||||
<goal
|
||||
name="pdf"
|
||||
prereqs="pdf:pdf"
|
||||
prereqs="fo:fo,pdf:prepare,pdf:pdf"
|
||||
description="Generate PDF project documentation"/>
|
||||
|
||||
<goal name="pdf:pdf" description="Generate PDF project documentation"
|
||||
prereqs="pdf:init, fo">
|
||||
<goal
|
||||
name="pdf:prepare"
|
||||
prereqs="pdf:init"
|
||||
description="Stages all files needed to generate the PDF">
|
||||
<!-- First, copy all of the generated xdocs -->
|
||||
<copy todir="${docsPdf}">
|
||||
<fileset dir="${docsGenSrc}" force="true">
|
||||
<include name="**/*.*"/>
|
||||
</fileset>
|
||||
</copy>
|
||||
<!-- Then, copy all of the user-supplied xdocs -->
|
||||
<copy todir="${docsPdf}" force="true">
|
||||
<fileset dir="${docsXdocSrc}">
|
||||
<include name="**/*.*"/>
|
||||
</fileset>
|
||||
</copy>
|
||||
<!-- Finally, copy the FOP config file and all of the fonts -->
|
||||
<copy todir="${docsPdf}" force="true">
|
||||
<fileset dir="${plugin.resources}">
|
||||
<include name="userconfig.xml"/>
|
||||
<include name="fonts/*.*"/>
|
||||
</fileset>
|
||||
</copy>
|
||||
</goal>
|
||||
|
||||
<echo>Generating ${docsDest}/project.pdf ...</echo>
|
||||
<java classname="org.apache.fop.apps.Fop" fork="yes" failonerror="true">
|
||||
<goal name="pdf:pdf" description="Generate PDF project documentation"
|
||||
prereqs="pdf:prepare">
|
||||
<echo>Generating ${docsPdf}/project.pdf ...</echo>
|
||||
<echo>Config file: ${docsPdf}/userconfig.xml</echo>
|
||||
<java classname="org.apache.fop.apps.Fop" fork="yes" failonerror="true" maxmemory="500m">
|
||||
<classpath>
|
||||
<pathelement location="${plugin.getDependencyPath('fop')}"/>
|
||||
<pathelement location="${plugin.getDependencyPath('batik')}"/>
|
||||
<pathelement location="${plugin.getDependencyPath('logkit')}"/>
|
||||
<pathelement location="${plugin.getDependencyPath('avalon-framework')}"/>
|
||||
<pathelement location="${plugin.getDependencyPath('xerces')}"/>
|
||||
<pathelement location="${plugin.getDependencyPath('xml-apis')}"/>
|
||||
</classpath>
|
||||
<arg value="-c" />
|
||||
<arg value="${docsPdf}/userconfig.xml" />
|
||||
<arg value="-d" />
|
||||
<arg value="-fo" />
|
||||
<arg value="${docsDest}/project.fo" />
|
||||
<arg value="${docsPdf}/project.fo" />
|
||||
<arg value="-pdf" />
|
||||
<arg value="${docsDest}/project.pdf"/>
|
||||
<arg value="${docsPdf}/project.pdf"/>
|
||||
<sysproperty key="javax.xml.transform.TransformerFactory" value="org.apache.xalan.processor.TransformerFactoryImpl"/>
|
||||
</java>
|
||||
|
||||
</goal>
|
||||
|
||||
</project>
|
||||
+15
-1
@@ -3,4 +3,18 @@
|
||||
# -------------------------------------------------------------------
|
||||
# PDF plugin.
|
||||
# -------------------------------------------------------------------
|
||||
|
||||
maven.pdf.confidential=false
|
||||
maven.pdf.paperType=US
|
||||
maven.pdf.companyName=Apache Software Foundation
|
||||
maven.pdf.companyIncName=Apache Software Foundation, Inc.
|
||||
maven.pdf.copyrightYear=2003
|
||||
maven.pdf.imageDpi=150
|
||||
maven.pdf.debug=false
|
||||
# Reserved for future use...
|
||||
maven.pdf.cover.projectCompany=Apache Software Foundation
|
||||
maven.pdf.cover.projectName=Microsoft Windows Server 2003 with .NET Framework and IBM WebSphere
|
||||
maven.pdf.cover.type=Research Report
|
||||
maven.pdf.cover.version=1.0
|
||||
maven.pdf.cover.date=June 2, 2003
|
||||
maven.pdf.projectLogo=project_logo.gif
|
||||
maven.pdf.companyLogo=company_logo.gif
|
||||
@@ -2,6 +2,6 @@
|
||||
# P R O J E C T P R O P E R T I E S
|
||||
# -------------------------------------------------------------------
|
||||
maven.xdoc.date=left
|
||||
## maven.xdoc.version=${pom.currentVersion}
|
||||
maven.license.licenseFile=${basedir}/../LICENSE.txt
|
||||
maven.xdoc.version=${pom.currentVersion}
|
||||
maven.license.licenseFile=${basedir}/../../../LICENSE.txt
|
||||
|
||||
+26
-21
@@ -1,15 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<project>
|
||||
<extend>../project.xml</extend>
|
||||
<extend>${basedir}/../project.xml</extend>
|
||||
<pomVersion>3</pomVersion>
|
||||
<id>maven-pdf-plugin</id>
|
||||
<groupId>maven</groupId>
|
||||
<artifactId>maven-pdf-plugin</artifactId>
|
||||
<name>Maven PDF Plug-in</name>
|
||||
<currentVersion>1.2</currentVersion>
|
||||
<currentVersion>2.0-SNAPSHOT</currentVersion>
|
||||
<description/>
|
||||
<shortDescription>Create PDF version of site docs</shortDescription>
|
||||
<shortDescription>Java Project Management Tools</shortDescription>
|
||||
<url>http://maven.apache.org/reference/plugins/pdf/</url>
|
||||
<siteDirectory>/www/maven.apache.org/reference/plugins/pdf/</siteDirectory>
|
||||
<issueTrackingUrl>http://jira.codehaus.org/secure/BrowseProject.jspa?id=10356</issueTrackingUrl>
|
||||
<repository>
|
||||
<connection>scm:cvs:pserver:anoncvs@cvs.apache.org:/home/cvspublic:maven-plugins/pdf/</connection>
|
||||
<url>http://cvs.apache.org/viewcvs/maven-plugins/pdf/</url>
|
||||
@@ -34,47 +36,50 @@
|
||||
<role>Release Manager</role>
|
||||
</roles>
|
||||
</developer>
|
||||
<developer>
|
||||
<name>Andrew Jaquith</name>
|
||||
<id>arjaquith</id>
|
||||
<email>arjaquith@mindspring.com</email>
|
||||
<organization>freshcookies.org</organization>
|
||||
<roles>
|
||||
<role>Architect</role>
|
||||
<role>Documentation</role>
|
||||
</roles>
|
||||
</developer>
|
||||
</developers>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>fop</groupId>
|
||||
<artifactId>fop</artifactId>
|
||||
<version>0.20.5rc2</version>
|
||||
<id>fop</id>
|
||||
<version>0.20.5</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>batik</groupId>
|
||||
<artifactId>batik</artifactId>
|
||||
<version>1.1.1</version>
|
||||
<id>batik</id>
|
||||
<version>1.5-fop-0.20-5</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>logkit</groupId>
|
||||
<artifactId>logkit</artifactId>
|
||||
<id>logkit</id>
|
||||
<version>1.0.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>avalon-framework</groupId>
|
||||
<artifactId>avalon-framework</artifactId>
|
||||
<id>avalon-framework</id>
|
||||
<version>4.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>xerces</groupId>
|
||||
<artifactId>xerces</artifactId>
|
||||
<version>2.4.0</version>
|
||||
<id>xerces</id>
|
||||
<version>2.3.0</version>
|
||||
<properties>
|
||||
<classloader>root</classloader>
|
||||
</properties>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>xml-apis</groupId>
|
||||
<artifactId>xml-apis</artifactId>
|
||||
<id>xml-apis</id>
|
||||
<version>1.0.b2</version>
|
||||
<properties>
|
||||
<classloader>root</classloader>
|
||||
</properties>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>xalan</groupId>
|
||||
<artifactId>xalan</artifactId>
|
||||
<id>xalan</id>
|
||||
<version>2.4.1</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
@@ -0,0 +1,488 @@
|
||||
<?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">black</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"></xsl:param>
|
||||
<xsl:param name="pageNumber"></xsl:param>
|
||||
<xsl:variable name="leftCol" select="0.9 * $maxBodyWidth"/>
|
||||
<xsl:variable name="rightCol" select="0.1 * $maxBodyWidth"/>
|
||||
<fo:static-content flow-name="xsl-region-before">
|
||||
<fo:table table-layout="fixed">
|
||||
<fo:table-column column-width="{$leftCol}in"/>
|
||||
<fo:table-column column-width="{$rightCol}in"/>
|
||||
<fo:table-body>
|
||||
<fo:table-row>
|
||||
<fo:table-cell>
|
||||
<fo:block xsl:use-attribute-sets="header.style">
|
||||
<xsl:value-of select="normalize-space($headerText)"/>
|
||||
</fo:block>
|
||||
</fo:table-cell>
|
||||
<fo:table-cell>
|
||||
<fo:block xsl:use-attribute-sets="page.number">
|
||||
<fo:page-number />
|
||||
</fo:block>
|
||||
</fo:table-cell>
|
||||
</fo:table-row>
|
||||
</fo:table-body>
|
||||
</fo:table>
|
||||
</fo:static-content>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="body-footer">
|
||||
<xsl:param name="footerText"></xsl:param>
|
||||
<fo:static-content flow-name="xsl-region-after">
|
||||
<fo:block xsl:use-attribute-sets="footer.style">
|
||||
<xsl:value-of select="normalize-space($footerText)"/>
|
||||
</fo:block>
|
||||
</fo:static-content>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="body-chapter-heading">
|
||||
<xsl:param name="chapterNumber"></xsl:param>
|
||||
<xsl:param name="chapter"></xsl:param>
|
||||
<xsl:variable name="gutter">0.125</xsl:variable>
|
||||
<xsl:variable name="leftMargin"><xsl:value-of select="$bodySideMargins"/></xsl:variable>
|
||||
<xsl:variable name="rightMargin"><xsl:value-of select="$bodySideMargins"/></xsl:variable>
|
||||
<xsl:variable name="bodyWidth"><xsl:value-of select="$maxBodyWidth"/></xsl:variable>
|
||||
<fo:block>
|
||||
<fo:list-block provisional-distance-between-starts="{$leftMargin}in" provisional-label-separation="{$gutter}in">
|
||||
<fo:list-item>
|
||||
<fo:list-item-label end-indent="{$bodyWidth + $gutter}in">
|
||||
<fo:block xsl:use-attribute-sets="outdented.number.style">
|
||||
<xsl:value-of select="normalize-space($chapterNumber)"/>
|
||||
</fo:block>
|
||||
</fo:list-item-label>
|
||||
<fo:list-item-body>
|
||||
<fo:block xsl:use-attribute-sets="chapter.title">
|
||||
<xsl:value-of select="normalize-space($chapter)"/>
|
||||
</fo:block>
|
||||
</fo:list-item-body>
|
||||
</fo:list-item>
|
||||
</fo:list-block>
|
||||
</fo:block>
|
||||
<fo:block space-after.optimum="5em">
|
||||
<!-- Add a rule underneath -->
|
||||
<fo:leader xsl:use-attribute-sets="chapter.rule"/>
|
||||
</fo:block>
|
||||
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<!-- Templates for rendering xdoc tags -->
|
||||
<xsl:template match="document/body">
|
||||
<xsl:apply-templates />
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="section">
|
||||
<fo:block xsl:use-attribute-sets="body.h1">
|
||||
<xsl:value-of select="@name" />
|
||||
</fo:block>
|
||||
<fo:block xsl:use-attribute-sets="body.text">
|
||||
<xsl:apply-templates />
|
||||
</fo:block>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="subsection">
|
||||
<fo:block xsl:use-attribute-sets="body.h2">
|
||||
<xsl:value-of select="@name" />
|
||||
</fo:block>
|
||||
<fo:block xsl:use-attribute-sets="body.text">
|
||||
<xsl:apply-templates />
|
||||
</fo:block>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="p[@style='h3']">
|
||||
<fo:block xsl:use-attribute-sets="body.h3">
|
||||
<xsl:value-of select="normalize-space(.)"/>
|
||||
</fo:block>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="p[@style='h4']">
|
||||
<fo:block xsl:use-attribute-sets="body.h4">
|
||||
<xsl:value-of select="normalize-space(.)"/>
|
||||
</fo:block>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="p[@style='h5']">
|
||||
<fo:block xsl:use-attribute-sets="body.h5">
|
||||
<xsl:value-of select="normalize-space(.)"/>
|
||||
</fo:block>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="p">
|
||||
<fo:block xsl:use-attribute-sets="body.text normal.paragraph">
|
||||
<xsl:apply-templates />
|
||||
</fo:block>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="source">
|
||||
<fo:block xsl:use-attribute-sets="body.source">
|
||||
<xsl:apply-templates/>
|
||||
</fo:block>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="img[@src]">
|
||||
<xsl:variable name="source">
|
||||
<xsl:choose>
|
||||
<xsl:when test="substring(normalize-space(@src),1,3) = '../'">
|
||||
<xsl:value-of select="translate(substring-after(normalize-space(@src),'../'),'\','/')"/>
|
||||
</xsl:when>
|
||||
<xsl:when test="substring(normalize-space(@src),1,3) = '..\'">
|
||||
<xsl:value-of select="translate(substring-after(normalize-space(@src),'..\'),'\','/')"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="@src"/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
<xsl:variable name="width">
|
||||
<xsl:value-of select="substring-before(concat(normalize-space(@width),'p'),'p') div $imageDpi"/>
|
||||
</xsl:variable>
|
||||
<xsl:variable name="height">
|
||||
<xsl:value-of select="substring-before(concat(normalize-space(@height),'p'),'p') div $imageDpi"/>
|
||||
</xsl:variable>
|
||||
<!-- Enclose image in a block if parent is a section or subsection element -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="parent::section | parent::subsection">
|
||||
<fo:block>
|
||||
<fo:external-graphic src="{normalize-space($source)}"
|
||||
height="{$height}in" width="{$width}in"
|
||||
content-height="auto" content-width="auto" />
|
||||
</fo:block>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<fo:external-graphic src="{normalize-space($source)}"
|
||||
height="{$height}in" width="{$width}in"
|
||||
content-height="auto" content-width="auto" />
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<!-- Templates for handling XHTML tags -->
|
||||
|
||||
<!--
|
||||
<xsl:template match="a[@href and not(ancestor::table)]">
|
||||
<fo:basic-link external-destination="{@href}">
|
||||
<fo:inline xsl:use-attribute-sets="href">
|
||||
<xsl:apply-templates />
|
||||
</fo:inline>
|
||||
</fo:basic-link>
|
||||
</xsl:template>
|
||||
-->
|
||||
|
||||
<xsl:template match="br">
|
||||
<fo:block/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="em | i">
|
||||
<fo:inline font-style="italic">
|
||||
<xsl:apply-templates />
|
||||
</fo:inline>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="b | strong[ancestor::table]">
|
||||
<fo:inline font-weight="bold">
|
||||
<xsl:apply-templates />
|
||||
</fo:inline>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="strong[ancestor::p|ancestor::li|ancestor::dl|ancestor::dt|ancestor::dd]">
|
||||
<fo:inline font-weight="bold" xsl:use-attribute-sets="body.strong">
|
||||
<xsl:apply-templates />
|
||||
</fo:inline>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="strong">
|
||||
<fo:inline font-weight="bold">
|
||||
<xsl:apply-templates />
|
||||
</fo:inline>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="sub">
|
||||
<fo:inline baseline-shift="sub">
|
||||
<xsl:apply-templates />
|
||||
</fo:inline>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="sup">
|
||||
<fo:inline baseline-shift="sup">
|
||||
<xsl:apply-templates />
|
||||
</fo:inline>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="tt|code">
|
||||
<fo:inline xsl:use-attribute-sets="body.pre">
|
||||
<xsl:apply-templates />
|
||||
</fo:inline>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="var">
|
||||
<fo:inline font-style="italic">
|
||||
<xsl:apply-templates />
|
||||
</fo:inline>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="big">
|
||||
<fo:inline font-size="larger">
|
||||
<xsl:apply-templates />
|
||||
</fo:inline>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="small">
|
||||
<fo:inline font-size="smaller">
|
||||
<xsl:apply-templates />
|
||||
</fo:inline>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="ul/ul | ul/ol | ol/ul | ol/ol">
|
||||
<fo:list-item xsl:use-attribute-sets="list.item">
|
||||
<fo:list-item-label>
|
||||
<fo:block />
|
||||
</fo:list-item-label>
|
||||
<fo:list-item-body start-indent="body-start()">
|
||||
<fo:block>
|
||||
<xsl:apply-templates />
|
||||
</fo:block>
|
||||
</fo:list-item-body>
|
||||
</fo:list-item>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="ul | ol">
|
||||
<fo:list-block xsl:use-attribute-sets="list">
|
||||
<xsl:apply-templates />
|
||||
</fo:list-block>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="ul/li">
|
||||
<fo:list-item xsl:use-attribute-sets="list.item">
|
||||
<fo:list-item-label>
|
||||
<fo:block>
|
||||
<xsl:if test="not(@style='list-style: none')">
|
||||
<xsl:text>•</xsl:text>
|
||||
</xsl:if>
|
||||
</fo:block>
|
||||
</fo:list-item-label>
|
||||
<fo:list-item-body start-indent="body-start()">
|
||||
<fo:block>
|
||||
<xsl:apply-templates />
|
||||
</fo:block>
|
||||
</fo:list-item-body>
|
||||
</fo:list-item>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="ol/li">
|
||||
<fo:list-item xsl:use-attribute-sets="list.item">
|
||||
<fo:list-item-label>
|
||||
<fo:block>
|
||||
<xsl:number format="1." />
|
||||
</fo:block>
|
||||
</fo:list-item-label>
|
||||
<fo:list-item-body start-indent="body-start()">
|
||||
<fo:block>
|
||||
<xsl:apply-templates />
|
||||
</fo:block>
|
||||
</fo:list-item-body>
|
||||
</fo:list-item>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="dl">
|
||||
<fo:block xsl:use-attribute-sets="dl">
|
||||
<xsl:apply-templates />
|
||||
</fo:block>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="dt">
|
||||
<fo:block xsl:use-attribute-sets="dt">
|
||||
<xsl:apply-templates />
|
||||
</fo:block>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="dd">
|
||||
<fo:block xsl:use-attribute-sets="dd">
|
||||
<xsl:apply-templates />
|
||||
</fo:block>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
||||
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
<?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'>
|
||||
|
||||
<!-- Set the default page width, in inches -->
|
||||
<xsl:variable name="pageWidth">
|
||||
<xsl:choose>
|
||||
<xsl:when test="$paperType = 'US'">8.5</xsl:when>
|
||||
<xsl:when test="$paperType = 'A4'">8.25</xsl:when>
|
||||
<xsl:otherwise>8.5</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
<!-- Set the default page height, in inches -->
|
||||
<xsl:variable name="pageHeight">11</xsl:variable>
|
||||
<!-- 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"/>
|
||||
|
||||
<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="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="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:region-before extent="0.35in"/>
|
||||
<fo:region-body margin-top="0.7in" margin-bottom="0.8in"/>
|
||||
<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:region-before extent="0.35in"/>
|
||||
<fo:region-body margin-top="0.7in" margin-bottom="0.8in"/>
|
||||
<fo:region-after extent="0.125in"/>
|
||||
</fo:simple-page-master>
|
||||
|
||||
</fo:layout-master-set>
|
||||
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
||||
@@ -0,0 +1,230 @@
|
||||
<?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'>
|
||||
|
||||
<!-- This is a dummy entry -->
|
||||
<xsl:variable name="masklookup">----------111111111122222222223333333333444444444455555555556666666666777777777788888888889999999999"</xsl:variable>
|
||||
<xsl:variable name="columnWidths"> 5? 5? 5? 5? 5? 5? 5? 5? 5? 5?</xsl:variable>
|
||||
|
||||
<xsl:template name="calculate-column-widths">
|
||||
<xsl:param name="row">1</xsl:param>
|
||||
<xsl:param name="col">1</xsl:param>
|
||||
<xsl:param name="mask"> ----------</xsl:param>
|
||||
<xsl:param name="nextmask"> ----------</xsl:param>
|
||||
<xsl:param name="widths" select="$columnWidths"/>
|
||||
<!-- Get current row and column based on (row,col) parameters -->
|
||||
<xsl:variable name="currentRow"
|
||||
select="thead/tr[position()=$row]"/>
|
||||
<xsl:variable name="currentCol"
|
||||
select="thead/tr[position()=$row]/th[position()=$col]"/>
|
||||
<!-- Determine the row/colspans for the current cell
|
||||
If not specified, they default to 1 -->
|
||||
<xsl:variable name="colspan">
|
||||
<xsl:choose>
|
||||
<xsl:when test="$currentCol/@colspan"><xsl:value-of select="$currentCol/@colspan"/></xsl:when>
|
||||
<xsl:otherwise>1</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
<xsl:variable name="rowspan">
|
||||
<xsl:choose>
|
||||
<xsl:when test="$currentCol/@rowspan"><xsl:value-of select="$currentCol/@rowspan"/></xsl:when>
|
||||
<xsl:otherwise>1</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
<!-- Based on the current row mask, determine where to insert the current cell mask -->
|
||||
<xsl:variable name="insmask-row">
|
||||
<xsl:value-of select="substring($masklookup, $rowspan *10+1, $colspan)"/>
|
||||
</xsl:variable>
|
||||
<xsl:variable name="insmask-nextrow">
|
||||
<xsl:value-of select="substring($masklookup, ($rowspan - 1)*10+1, $colspan)"/>
|
||||
</xsl:variable>
|
||||
<xsl:variable name="ins">
|
||||
<xsl:value-of select="string-length(substring-before($mask,'-')) + 1"/>
|
||||
</xsl:variable>
|
||||
<!-- If this cell has a width attribute, extract it and normalize to one column.
|
||||
Also, pad it to three characters wide. If the current column is more than one
|
||||
column wide, append the padded width with a '?' so that it can be overridden. -->
|
||||
<xsl:variable name="cellwidthRaw">
|
||||
<xsl:choose>
|
||||
<xsl:when test="$currentCol/@width">
|
||||
<xsl:if test="contains($currentCol/@width,'%')">
|
||||
<xsl:value-of select="substring-before($currentCol/@width,'%') div $colspan"/>
|
||||
</xsl:if>
|
||||
</xsl:when>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
<xsl:variable name="cellwidth">
|
||||
<xsl:if test="$cellwidthRaw > 0">
|
||||
<xsl:choose>
|
||||
<xsl:when test="$colspan = 1">
|
||||
<xsl:value-of select="concat(substring(' ', 1, 3 - string-length(round($cellwidthRaw))), round($cellwidthRaw), ' ')"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="concat(substring(' ', 1, 3 - string-length(round($cellwidthRaw))), round($cellwidthRaw), '?')"/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:if>
|
||||
</xsl:variable>
|
||||
<!-- Create a width 'mask' that repeats the width string i times, where i is the
|
||||
number of columns spanned -->
|
||||
<xsl:variable name="cellwidthmaskRaw">
|
||||
<xsl:value-of select="translate('abcdabcdabcdabcdabcdabcdabcdabcdabcdabcd', 'abcd',$cellwidth)"/>
|
||||
</xsl:variable>
|
||||
<xsl:variable name="cellwidthmask">
|
||||
<xsl:value-of select="substring($cellwidthmaskRaw, 1, $colspan * 4)"/>
|
||||
</xsl:variable>
|
||||
<!-- Insert the cell width, if supplied, into the registry -->
|
||||
<xsl:variable name="widths2">
|
||||
<xsl:choose>
|
||||
<xsl:when test="$cellwidthRaw > 0 and substring($widths, ($ins - 2)*4+4, 1) = '?'">
|
||||
<xsl:value-of select="concat(substring($widths, 1, ($ins - 2)*4),
|
||||
$cellwidthmask,
|
||||
substring($widths, ($ins - 2 + $colspan)*4+1))"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise><xsl:value-of select="$widths"/></xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
<!-- Revise the the current row's mask by inserting
|
||||
a digit j (repeated k times) into the first available space in the
|
||||
mask. J represents the number of rowspans for the current cell
|
||||
the supplied masks. We insert the same number of j into the next row's
|
||||
mask also. -->
|
||||
<xsl:variable name="mask2">
|
||||
<xsl:value-of select="concat(substring($mask, 1, $ins - 1),
|
||||
$insmask-row,
|
||||
substring($mask, $ins + $colspan))"/>
|
||||
</xsl:variable>
|
||||
<xsl:variable name="nextmask2">
|
||||
<xsl:value-of select="concat(substring($nextmask, 1, $ins - 1),
|
||||
$insmask-nextrow,
|
||||
substring($nextmask, $ins + $colspan))"/>
|
||||
</xsl:variable>
|
||||
<!-- Print debugging information -->
|
||||
<xsl:if test="$debug = 'true'">
|
||||
<xsl:message>Cell (<xsl:value-of select="$row"/>,<xsl:value-of select="$col"/>) text()='<xsl:value-of select="normalize-space($currentCol)"/>' rowspan=<xsl:value-of select="$rowspan"/> colspan=<xsl:value-of select="$colspan"/> width=<xsl:value-of select="normalize-space($cellwidthRaw * $colspan)"/></xsl:message>
|
||||
<xsl:message> Current cell mask : <xsl:value-of select="$mask"/>in <xsl:value-of select="$mask2"/>out</xsl:message>
|
||||
<xsl:message> Next row mask : <xsl:value-of select="$nextmask"/>in <xsl:value-of select="$nextmask2"/>out</xsl:message>
|
||||
<xsl:message> Estimated cell widths: <xsl:value-of select="$cellwidthmask"/></xsl:message>
|
||||
<xsl:message> Cell widths so far : <xsl:value-of select="$widths2"/></xsl:message>
|
||||
</xsl:if>
|
||||
<!-- What to do next? -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="thead/tr[position()=$row]/th[position()=$col+1]">
|
||||
<xsl:call-template name="calculate-column-widths">
|
||||
<xsl:with-param name="row" select="$row"/>
|
||||
<xsl:with-param name="col" select="$col+1"/>
|
||||
<xsl:with-param name="mask" select="$mask2"/>
|
||||
<xsl:with-param name="nextmask" select="$nextmask2"/>
|
||||
<xsl:with-param name="widths" select="$widths2"/>
|
||||
</xsl:call-template>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:choose>
|
||||
<xsl:when test="thead/tr[position()=$row+1]">
|
||||
<xsl:call-template name="calculate-column-widths">
|
||||
<xsl:with-param name="row" select="$row+1"/>
|
||||
<xsl:with-param name="col" select="1"/>
|
||||
<xsl:with-param name="mask" select="translate($mask2, '123456789', '-12345678')"/>
|
||||
<xsl:with-param name="widths" select="$widths2"/>
|
||||
</xsl:call-template>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:call-template name="totals">
|
||||
<xsl:with-param name="columns"
|
||||
select="string-length(substring-before(concat($mask2,'-'),'-'))-1"/>
|
||||
<xsl:with-param name="widths" select="$widths2"/>
|
||||
</xsl:call-template>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="totals">
|
||||
<xsl:param name="col">1</xsl:param>
|
||||
<xsl:param name="columns">1</xsl:param>
|
||||
<xsl:param name="widths"> 1?</xsl:param>
|
||||
<xsl:param name="sumwidths">0</xsl:param>
|
||||
<xsl:param name="softColumns">0</xsl:param>
|
||||
<xsl:variable name="colwidth" select="substring($widths, ($col - 1)*4+1 , 3)"/>
|
||||
<!-- If we find something ('?') in the 4th position, it's a soft column -->
|
||||
<xsl:variable name="softColumn">
|
||||
<xsl:choose>
|
||||
<xsl:when test="normalize-space(substring($widths, ($col - 1)*4+4, 1))">1</xsl:when>
|
||||
<xsl:otherwise>0</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
<xsl:variable name="leftover">
|
||||
<xsl:choose>
|
||||
<xsl:when test="$sumwidths > 100">
|
||||
<xsl:value-of select="0"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="100 - $sumwidths"/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
<xsl:choose>
|
||||
<xsl:when test="$col <= $columns">
|
||||
<xsl:call-template name="totals">
|
||||
<xsl:with-param name="col" select="$col + 1"/>
|
||||
<xsl:with-param name="columns" select="$columns"/>
|
||||
<xsl:with-param name="widths" select="$widths"/>
|
||||
<xsl:with-param name="sumwidths" select="$sumwidths + $colwidth"/>
|
||||
<xsl:with-param name="softColumns" select="$softColumns + $softColumn"/>
|
||||
</xsl:call-template>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:if test="$debug = 'true'">
|
||||
<xsl:message>Columns= <xsl:value-of select="$columns"/> (<xsl:value-of select="$softColumns"/> resizable), width=<xsl:value-of select="$sumwidths"/>, leftover=<xsl:value-of select="$leftover"/></xsl:message>
|
||||
</xsl:if>
|
||||
<xsl:call-template name="print-columns">
|
||||
<xsl:with-param name="columns" select="$columns"/>
|
||||
<xsl:with-param name="widths" select="$widths"/>
|
||||
<xsl:with-param name="sumwidths" select="$sumwidths + $leftover"/>
|
||||
<xsl:with-param name="adjust" select="$leftover div $softColumns"/>
|
||||
<xsl:with-param name="softColumns" select="$softColumns"/>
|
||||
</xsl:call-template>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="print-columns">
|
||||
<xsl:param name="col">1</xsl:param>
|
||||
<xsl:param name="columns">1</xsl:param>
|
||||
<xsl:param name="widths"> 1?</xsl:param>
|
||||
<xsl:param name="sumwidths">0</xsl:param>
|
||||
<xsl:param name="adjust">0</xsl:param>
|
||||
<xsl:param name="softColumns">1</xsl:param>
|
||||
<xsl:variable name="colwidth" select="substring($widths, ($col - 1)*4+1 , 3)"/>
|
||||
<xsl:variable name="colwidth2">
|
||||
<xsl:choose>
|
||||
<xsl:when test="normalize-space(substring($widths, ($col - 1)*4+4, 1))">
|
||||
<xsl:value-of select="$colwidth + $adjust"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="$colwidth"/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
<!-- And now, the moment we've all been waiting for -->
|
||||
<fo:table-column>
|
||||
<xsl:attribute name="column-width">
|
||||
<xsl:value-of select="$colwidth2 div $sumwidths * $maxTableWidth"/>in
|
||||
</xsl:attribute>
|
||||
</fo:table-column>
|
||||
<!-- Loop to the next column -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="$col < $columns">
|
||||
<xsl:call-template name="print-columns">
|
||||
<xsl:with-param name="col" select="$col + 1"/>
|
||||
<xsl:with-param name="columns" select="$columns"/>
|
||||
<xsl:with-param name="widths" select="$widths"/>
|
||||
<xsl:with-param name="sumwidths" select="$sumwidths"/>
|
||||
<xsl:with-param name="adjust" select="$adjust"/>
|
||||
<xsl:with-param name="softColumns" select="$softColumns"/>
|
||||
</xsl:call-template>
|
||||
</xsl:when>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
</xsl:stylesheet>
|
||||
@@ -0,0 +1,408 @@
|
||||
<?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 <table> did not contain a <thead> element. It was excluded from the generated XSL:FO file.
|
||||
</fo:block>
|
||||
</xsl:template>
|
||||
|
||||
<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>
|
||||
<xsl:param name="maxColumns">1</xsl:param>
|
||||
<!-- Get current row based on $row parameter -->
|
||||
<xsl:variable name="currentRow" select="thead/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) + sum($currentRow/th/@colspan) - count($currentRow/th/@colspan)"/>
|
||||
<xsl:variable name="newMaxColumns">
|
||||
<xsl:choose>
|
||||
<xsl:when test="$nColumns > $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="thead/tr[position()=$row+1]">
|
||||
<xsl:call-template name="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="print-table">
|
||||
<xsl:with-param name="spacerSpanColumns" select="$newMaxColumns"/>
|
||||
</xsl:call-template>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="table2" 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"/>
|
||||
-->
|
||||
<xsl:call-template name="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>
|
||||
<!-- Process any thead elements -->
|
||||
<xsl:apply-templates select="thead" mode="table-head">
|
||||
<xsl:with-param name="spacerSpanColumns" select="$spacerSpanColumns"/>
|
||||
</xsl:apply-templates>
|
||||
</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="tbody/tr|tr" mode="table-body">
|
||||
<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">
|
||||
<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: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">
|
||||
<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)"/>
|
||||
<!-- 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="table-body"/>
|
||||
</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="table-body">
|
||||
<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"/>
|
||||
<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">
|
||||
<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"/>
|
||||
<fo:block xsl:use-attribute-sets="table.body.block">
|
||||
<xsl:apply-templates/>
|
||||
</fo:block>
|
||||
</fo:table-cell>
|
||||
</xsl:template>
|
||||
|
||||
<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>
|
||||
@@ -0,0 +1,216 @@
|
||||
<?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>
|
||||
<xsl:with-param name="chapter">Table of Contents</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
<fo: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>
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<font-metrics type="TYPE0"><font-name>Garamond</font-name><embed/><cap-height>639</cap-height><x-height>0</x-height><ascender>861</ascender><descender>-263</descender><bbox><left>-138</left><bottom>-306</bottom><right>1062</right><top>986</top></bbox><flags>33</flags><stemv>0</stemv><italicangle>0</italicangle><subtype>TYPE0</subtype><multibyte-extras><cid-type>CIDFontType2</cid-type><default-width>0</default-width><bfranges><bf gi="3" ue="126" us="32"/><bf gi="172" ue="160" us="160"/><bf gi="163" ue="161" us="161"/><bf gi="132" ue="163" us="162"/><bf gi="189" ue="164" us="164"/><bf gi="150" ue="165" us="165"/><bf gi="231" ue="166" us="166"/><bf gi="134" ue="167" us="167"/><bf gi="142" ue="168" us="168"/><bf gi="139" ue="169" us="169"/><bf gi="157" ue="170" us="170"/><bf gi="169" ue="171" us="171"/><bf gi="164" ue="172" us="172"/><bf gi="257" ue="173" us="173"/><bf gi="138" ue="174" us="174"/><bf gi="258" ue="175" us="175"/><bf gi="131" ue="176" us="176"/><bf gi="147" ue="177" us="177"/><bf gi="241" ue="179" us="178"/><bf gi="141" ue="180" us="180"/><bf gi="151" ue="181" us="181"/><bf gi="136" ue="182" us="182"/><bf gi="259" ue="183" us="183"/><bf gi="221" ue="184" us="184"/><bf gi="240" ue="185" us="185"/><bf gi="158" ue="186" us="186"/><bf gi="170" ue="187" us="187"/><bf gi="244" ue="188" us="188"/><bf gi="243" ue="189" us="189"/><bf gi="245" ue="190" us="190"/><bf gi="162" ue="191" us="191"/><bf gi="173" ue="192" us="192"/><bf gi="201" ue="193" us="193"/><bf gi="199" ue="194" us="194"/><bf gi="174" ue="195" us="195"/><bf gi="98" ue="197" us="196"/><bf gi="144" ue="198" us="198"/><bf gi="100" ue="199" us="199"/><bf gi="203" ue="200" us="200"/><bf gi="101" ue="201" us="201"/><bf gi="200" ue="202" us="202"/><bf gi="202" ue="203" us="203"/><bf gi="207" ue="204" us="204"/><bf gi="204" ue="207" us="205"/><bf gi="232" ue="208" us="208"/><bf gi="102" ue="209" us="209"/><bf gi="210" ue="210" us="210"/><bf gi="208" ue="212" us="211"/><bf gi="175" ue="213" us="213"/><bf gi="103" ue="214" us="214"/><bf gi="239" ue="215" us="215"/><bf gi="145" ue="216" us="216"/><bf gi="213" ue="217" us="217"/><bf gi="211" ue="219" us="218"/><bf gi="104" ue="220" us="220"/><bf gi="234" ue="221" us="221"/><bf gi="236" ue="222" us="222"/><bf gi="137" ue="223" us="223"/><bf gi="106" ue="224" us="224"/><bf gi="105" ue="225" us="225"/><bf gi="107" ue="226" us="226"/><bf gi="109" ue="227" us="227"/><bf gi="108" ue="228" us="228"/><bf gi="110" ue="229" us="229"/><bf gi="160" ue="230" us="230"/><bf gi="111" ue="231" us="231"/><bf gi="113" ue="232" us="232"/><bf gi="112" ue="233" us="233"/><bf gi="114" ue="235" us="234"/><bf gi="117" ue="236" us="236"/><bf gi="116" ue="237" us="237"/><bf gi="118" ue="239" us="238"/><bf gi="233" ue="240" us="240"/><bf gi="120" ue="241" us="241"/><bf gi="122" ue="242" us="242"/><bf gi="121" ue="243" us="243"/><bf gi="123" ue="244" us="244"/><bf gi="125" ue="245" us="245"/><bf gi="124" ue="246" us="246"/><bf gi="184" ue="247" us="247"/><bf gi="161" ue="248" us="248"/><bf gi="127" ue="249" us="249"/><bf gi="126" ue="250" us="250"/><bf gi="128" ue="252" us="251"/><bf gi="235" ue="253" us="253"/><bf gi="237" ue="254" us="254"/><bf gi="186" ue="255" us="255"/><bf gi="261" ue="261" us="256"/><bf gi="252" ue="263" us="262"/><bf gi="267" ue="267" us="264"/><bf gi="254" ue="269" us="268"/><bf gi="271" ue="272" us="270"/><bf gi="256" ue="273" us="273"/><bf gi="274" ue="285" us="274"/><bf gi="247" ue="287" us="286"/><bf gi="286" ue="303" us="288"/><bf gi="249" ue="304" us="304"/><bf gi="214" ue="305" us="305"/><bf gi="302" ue="320" us="306"/><bf gi="225" ue="322" us="321"/><bf gi="317" ue="337" us="323"/><bf gi="176" ue="339" us="338"/><bf gi="332" ue="349" us="340"/><bf gi="250" ue="351" us="350"/><bf gi="227" ue="353" us="352"/><bf gi="342" ue="375" us="354"/><bf gi="187" ue="376" us="376"/><bf gi="364" ue="380" us="377"/><bf gi="229" ue="382" us="381"/><bf gi="368" ue="383" us="383"/><bf gi="166" ue="402" us="402"/><bf gi="369" ue="511" us="506"/><bf gi="215" ue="710" us="710"/><bf gi="224" ue="711" us="711"/><bf gi="217" ue="713" us="713"/><bf gi="218" ue="730" us="728"/><bf gi="223" ue="731" us="731"/><bf gi="216" ue="732" us="732"/><bf gi="222" ue="733" us="733"/><bf gi="30" ue="894" us="894"/><bf gi="375" ue="906" us="900"/><bf gi="382" ue="908" us="908"/><bf gi="383" ue="929" us="910"/><bf gi="403" ue="974" us="931"/><bf gi="447" ue="1036" us="1025"/><bf gi="459" ue="1103" us="1038"/><bf gi="525" ue="1116" us="1105"/><bf gi="537" ue="1119" us="1118"/><bf gi="539" ue="1169" us="1168"/><bf gi="541" ue="7813" us="7808"/><bf gi="547" ue="7923" us="7922"/><bf gi="178" ue="8212" us="8211"/><bf gi="549" ue="8213" us="8213"/><bf gi="550" ue="8215" us="8215"/><bf gi="182" ue="8217" us="8216"/><bf gi="196" ue="8218" us="8218"/><bf gi="551" ue="8219" us="8219"/><bf gi="180" ue="8221" us="8220"/><bf gi="197" ue="8222" us="8222"/><bf gi="130" ue="8224" us="8224"/><bf gi="194" ue="8225" us="8225"/><bf gi="135" ue="8226" us="82Line truncated
|
||||
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<font-metrics type="TYPE0"><font-name>Garamond</font-name><embed/><cap-height>635</cap-height><x-height>0</x-height><ascender>861</ascender><descender>-263</descender><bbox><left>-146</left><bottom>-372</bottom><right>1167</right><top>996</top></bbox><flags>33</flags><stemv>0</stemv><italicangle>0</italicangle><subtype>TYPE0</subtype><multibyte-extras><cid-type>CIDFontType2</cid-type><default-width>0</default-width><bfranges><bf gi="3" ue="126" us="32"/><bf gi="172" ue="160" us="160"/><bf gi="163" ue="161" us="161"/><bf gi="132" ue="163" us="162"/><bf gi="189" ue="164" us="164"/><bf gi="150" ue="165" us="165"/><bf gi="231" ue="166" us="166"/><bf gi="134" ue="167" us="167"/><bf gi="142" ue="168" us="168"/><bf gi="139" ue="169" us="169"/><bf gi="157" ue="170" us="170"/><bf gi="169" ue="171" us="171"/><bf gi="164" ue="172" us="172"/><bf gi="257" ue="173" us="173"/><bf gi="138" ue="174" us="174"/><bf gi="258" ue="175" us="175"/><bf gi="131" ue="176" us="176"/><bf gi="147" ue="177" us="177"/><bf gi="241" ue="179" us="178"/><bf gi="141" ue="180" us="180"/><bf gi="151" ue="181" us="181"/><bf gi="136" ue="182" us="182"/><bf gi="259" ue="183" us="183"/><bf gi="221" ue="184" us="184"/><bf gi="240" ue="185" us="185"/><bf gi="158" ue="186" us="186"/><bf gi="170" ue="187" us="187"/><bf gi="244" ue="188" us="188"/><bf gi="243" ue="189" us="189"/><bf gi="245" ue="190" us="190"/><bf gi="162" ue="191" us="191"/><bf gi="173" ue="192" us="192"/><bf gi="201" ue="193" us="193"/><bf gi="199" ue="194" us="194"/><bf gi="174" ue="195" us="195"/><bf gi="98" ue="197" us="196"/><bf gi="144" ue="198" us="198"/><bf gi="100" ue="199" us="199"/><bf gi="203" ue="200" us="200"/><bf gi="101" ue="201" us="201"/><bf gi="200" ue="202" us="202"/><bf gi="202" ue="203" us="203"/><bf gi="207" ue="204" us="204"/><bf gi="204" ue="207" us="205"/><bf gi="232" ue="208" us="208"/><bf gi="102" ue="209" us="209"/><bf gi="210" ue="210" us="210"/><bf gi="208" ue="212" us="211"/><bf gi="175" ue="213" us="213"/><bf gi="103" ue="214" us="214"/><bf gi="239" ue="215" us="215"/><bf gi="145" ue="216" us="216"/><bf gi="213" ue="217" us="217"/><bf gi="211" ue="219" us="218"/><bf gi="104" ue="220" us="220"/><bf gi="234" ue="221" us="221"/><bf gi="236" ue="222" us="222"/><bf gi="137" ue="223" us="223"/><bf gi="106" ue="224" us="224"/><bf gi="105" ue="225" us="225"/><bf gi="107" ue="226" us="226"/><bf gi="109" ue="227" us="227"/><bf gi="108" ue="228" us="228"/><bf gi="110" ue="229" us="229"/><bf gi="160" ue="230" us="230"/><bf gi="111" ue="231" us="231"/><bf gi="113" ue="232" us="232"/><bf gi="112" ue="233" us="233"/><bf gi="114" ue="235" us="234"/><bf gi="117" ue="236" us="236"/><bf gi="116" ue="237" us="237"/><bf gi="118" ue="239" us="238"/><bf gi="233" ue="240" us="240"/><bf gi="120" ue="241" us="241"/><bf gi="122" ue="242" us="242"/><bf gi="121" ue="243" us="243"/><bf gi="123" ue="244" us="244"/><bf gi="125" ue="245" us="245"/><bf gi="124" ue="246" us="246"/><bf gi="184" ue="247" us="247"/><bf gi="161" ue="248" us="248"/><bf gi="127" ue="249" us="249"/><bf gi="126" ue="250" us="250"/><bf gi="128" ue="252" us="251"/><bf gi="235" ue="253" us="253"/><bf gi="237" ue="254" us="254"/><bf gi="186" ue="255" us="255"/><bf gi="261" ue="261" us="256"/><bf gi="252" ue="263" us="262"/><bf gi="267" ue="267" us="264"/><bf gi="254" ue="269" us="268"/><bf gi="271" ue="272" us="270"/><bf gi="256" ue="273" us="273"/><bf gi="274" ue="285" us="274"/><bf gi="247" ue="287" us="286"/><bf gi="286" ue="303" us="288"/><bf gi="249" ue="304" us="304"/><bf gi="214" ue="305" us="305"/><bf gi="302" ue="320" us="306"/><bf gi="225" ue="322" us="321"/><bf gi="317" ue="337" us="323"/><bf gi="176" ue="339" us="338"/><bf gi="332" ue="349" us="340"/><bf gi="250" ue="351" us="350"/><bf gi="227" ue="353" us="352"/><bf gi="342" ue="375" us="354"/><bf gi="187" ue="376" us="376"/><bf gi="364" ue="380" us="377"/><bf gi="229" ue="382" us="381"/><bf gi="368" ue="383" us="383"/><bf gi="166" ue="402" us="402"/><bf gi="369" ue="511" us="506"/><bf gi="215" ue="710" us="710"/><bf gi="224" ue="711" us="711"/><bf gi="217" ue="713" us="713"/><bf gi="218" ue="730" us="728"/><bf gi="223" ue="731" us="731"/><bf gi="216" ue="732" us="732"/><bf gi="222" ue="733" us="733"/><bf gi="30" ue="894" us="894"/><bf gi="375" ue="906" us="900"/><bf gi="382" ue="908" us="908"/><bf gi="383" ue="929" us="910"/><bf gi="403" ue="974" us="931"/><bf gi="447" ue="1036" us="1025"/><bf gi="459" ue="1103" us="1038"/><bf gi="525" ue="1116" us="1105"/><bf gi="537" ue="1119" us="1118"/><bf gi="539" ue="1169" us="1168"/><bf gi="541" ue="7813" us="7808"/><bf gi="547" ue="7923" us="7922"/><bf gi="178" ue="8212" us="8211"/><bf gi="549" ue="8213" us="8213"/><bf gi="550" ue="8215" us="8215"/><bf gi="182" ue="8217" us="8216"/><bf gi="196" ue="8218" us="8218"/><bf gi="551" ue="8219" us="8219"/><bf gi="180" ue="8221" us="8220"/><bf gi="197" ue="8222" us="8222"/><bf gi="130" ue="8224" us="8224"/><bf gi="194" ue="8225" us="8225"/><bf gi="135" ue="8226" us="82Line truncated
|
||||
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<font-metrics type="TYPE0"><font-name>Garamond</font-name><embed/><cap-height>646</cap-height><x-height>0</x-height><ascender>861</ascender><descender>-263</descender><bbox><left>-216</left><bottom>-314</bottom><right>1128</right><top>992</top></bbox><flags>97</flags><stemv>0</stemv><italicangle>-12</italicangle><subtype>TYPE0</subtype><multibyte-extras><cid-type>CIDFontType2</cid-type><default-width>0</default-width><bfranges><bf gi="3" ue="126" us="32"/><bf gi="172" ue="160" us="160"/><bf gi="163" ue="161" us="161"/><bf gi="132" ue="163" us="162"/><bf gi="189" ue="164" us="164"/><bf gi="150" ue="165" us="165"/><bf gi="231" ue="166" us="166"/><bf gi="134" ue="167" us="167"/><bf gi="142" ue="168" us="168"/><bf gi="139" ue="169" us="169"/><bf gi="157" ue="170" us="170"/><bf gi="169" ue="171" us="171"/><bf gi="164" ue="172" us="172"/><bf gi="257" ue="173" us="173"/><bf gi="138" ue="174" us="174"/><bf gi="258" ue="175" us="175"/><bf gi="131" ue="176" us="176"/><bf gi="147" ue="177" us="177"/><bf gi="241" ue="179" us="178"/><bf gi="141" ue="180" us="180"/><bf gi="151" ue="181" us="181"/><bf gi="136" ue="182" us="182"/><bf gi="259" ue="183" us="183"/><bf gi="221" ue="184" us="184"/><bf gi="240" ue="185" us="185"/><bf gi="158" ue="186" us="186"/><bf gi="170" ue="187" us="187"/><bf gi="244" ue="188" us="188"/><bf gi="243" ue="189" us="189"/><bf gi="245" ue="190" us="190"/><bf gi="162" ue="191" us="191"/><bf gi="173" ue="192" us="192"/><bf gi="201" ue="193" us="193"/><bf gi="199" ue="194" us="194"/><bf gi="174" ue="195" us="195"/><bf gi="98" ue="197" us="196"/><bf gi="144" ue="198" us="198"/><bf gi="100" ue="199" us="199"/><bf gi="203" ue="200" us="200"/><bf gi="101" ue="201" us="201"/><bf gi="200" ue="202" us="202"/><bf gi="202" ue="203" us="203"/><bf gi="207" ue="204" us="204"/><bf gi="204" ue="207" us="205"/><bf gi="232" ue="208" us="208"/><bf gi="102" ue="209" us="209"/><bf gi="210" ue="210" us="210"/><bf gi="208" ue="212" us="211"/><bf gi="175" ue="213" us="213"/><bf gi="103" ue="214" us="214"/><bf gi="239" ue="215" us="215"/><bf gi="145" ue="216" us="216"/><bf gi="213" ue="217" us="217"/><bf gi="211" ue="219" us="218"/><bf gi="104" ue="220" us="220"/><bf gi="234" ue="221" us="221"/><bf gi="236" ue="222" us="222"/><bf gi="137" ue="223" us="223"/><bf gi="106" ue="224" us="224"/><bf gi="105" ue="225" us="225"/><bf gi="107" ue="226" us="226"/><bf gi="109" ue="227" us="227"/><bf gi="108" ue="228" us="228"/><bf gi="110" ue="229" us="229"/><bf gi="160" ue="230" us="230"/><bf gi="111" ue="231" us="231"/><bf gi="113" ue="232" us="232"/><bf gi="112" ue="233" us="233"/><bf gi="114" ue="235" us="234"/><bf gi="117" ue="236" us="236"/><bf gi="116" ue="237" us="237"/><bf gi="118" ue="239" us="238"/><bf gi="233" ue="240" us="240"/><bf gi="120" ue="241" us="241"/><bf gi="122" ue="242" us="242"/><bf gi="121" ue="243" us="243"/><bf gi="123" ue="244" us="244"/><bf gi="125" ue="245" us="245"/><bf gi="124" ue="246" us="246"/><bf gi="184" ue="247" us="247"/><bf gi="161" ue="248" us="248"/><bf gi="127" ue="249" us="249"/><bf gi="126" ue="250" us="250"/><bf gi="128" ue="252" us="251"/><bf gi="235" ue="253" us="253"/><bf gi="237" ue="254" us="254"/><bf gi="186" ue="255" us="255"/><bf gi="261" ue="261" us="256"/><bf gi="252" ue="263" us="262"/><bf gi="267" ue="267" us="264"/><bf gi="254" ue="269" us="268"/><bf gi="271" ue="272" us="270"/><bf gi="256" ue="273" us="273"/><bf gi="274" ue="285" us="274"/><bf gi="247" ue="287" us="286"/><bf gi="286" ue="303" us="288"/><bf gi="249" ue="304" us="304"/><bf gi="214" ue="305" us="305"/><bf gi="302" ue="320" us="306"/><bf gi="225" ue="322" us="321"/><bf gi="317" ue="337" us="323"/><bf gi="176" ue="339" us="338"/><bf gi="332" ue="349" us="340"/><bf gi="250" ue="351" us="350"/><bf gi="227" ue="353" us="352"/><bf gi="342" ue="375" us="354"/><bf gi="187" ue="376" us="376"/><bf gi="364" ue="380" us="377"/><bf gi="229" ue="382" us="381"/><bf gi="368" ue="383" us="383"/><bf gi="166" ue="402" us="402"/><bf gi="369" ue="511" us="506"/><bf gi="215" ue="710" us="710"/><bf gi="224" ue="711" us="711"/><bf gi="217" ue="713" us="713"/><bf gi="218" ue="730" us="728"/><bf gi="223" ue="731" us="731"/><bf gi="216" ue="732" us="732"/><bf gi="222" ue="733" us="733"/><bf gi="30" ue="894" us="894"/><bf gi="375" ue="906" us="900"/><bf gi="382" ue="908" us="908"/><bf gi="383" ue="929" us="910"/><bf gi="403" ue="974" us="931"/><bf gi="447" ue="1036" us="1025"/><bf gi="459" ue="1103" us="1038"/><bf gi="525" ue="1116" us="1105"/><bf gi="537" ue="1119" us="1118"/><bf gi="539" ue="1169" us="1168"/><bf gi="541" ue="7813" us="7808"/><bf gi="547" ue="7923" us="7922"/><bf gi="178" ue="8212" us="8211"/><bf gi="549" ue="8213" us="8213"/><bf gi="550" ue="8215" us="8215"/><bf gi="182" ue="8217" us="8216"/><bf gi="196" ue="8218" us="8218"/><bf gi="551" ue="8219" us="8219"/><bf gi="180" ue="8221" us="8220"/><bf gi="197" ue="8222" us="8222"/><bf gi="130" ue="8224" us="8224"/><bf gi="194" ue="8225" us="8225"/><bf gi="135" ue="8226" us="Line truncated
|
||||
@@ -1,447 +1,169 @@
|
||||
<?xml version='1.0'?>
|
||||
<?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-layouts.xslt" />
|
||||
<!--<xsl:include href="fo-cover.xslt" />-->
|
||||
<xsl:include href="fo-toc.xslt" />
|
||||
<xsl:include href="fo-body.xslt" />
|
||||
<xsl:include href="fo-tables.xslt" />
|
||||
<xsl:include href="fo-table-column-widths.xslt" />
|
||||
<xsl:param name="basePath">.</xsl:param>
|
||||
<xsl:param name="paperType">US</xsl:param>
|
||||
<xsl:param name="companyName">The Jakarta Project</xsl:param>
|
||||
<xsl:param name="companyIncName">Apache Software Foundation, Inc.</xsl:param>
|
||||
<xsl:param name="confidential">false</xsl:param>
|
||||
<xsl:param name="publicationYear">2003</xsl:param>
|
||||
<xsl:param name="imageDpi">150</xsl:param>
|
||||
<xsl:param name="companyLogo"/>
|
||||
<xsl:param name="projectLogo"/>
|
||||
<xsl:param name="coverProjectCompany">Apache Software Foundation</xsl:param>
|
||||
<xsl:param name="coverProjectName">Jakarta Maven</xsl:param>
|
||||
<xsl:param name="coverType">Project Documentation</xsl:param>
|
||||
<xsl:param name="coverVersion">1.0</xsl:param>
|
||||
<xsl:param name="coverDate">January 1, 1901</xsl:param>
|
||||
<xsl:param name="debug"></xsl:param>
|
||||
<!-- These next two variables are used in cheap-and-cheerful case conversions -->
|
||||
<xsl:variable name="lc">abcdefghijklmnopqrstuvwxyz</xsl:variable>
|
||||
<xsl:variable name="uc">ABCDEFGHIJKLMNOPQRSTUVWXYZ</xsl:variable>
|
||||
<xsl:variable name="footerText">©<xsl:value-of select="$publicationYear"/>
|
||||
<xsl:value-of select="concat(' ',$companyIncName)"/> • All rights reserved
|
||||
<xsl:if test="$confidential = 'true'">
|
||||
• 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:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
xmlns:fo="http://www.w3.org/1999/XSL/Format"
|
||||
version='1.0'>
|
||||
<xsl:output method="xml" encoding="UTF-8" indent="yes" omit-xml-declaration="no"/>
|
||||
|
||||
<xsl:param name="basePath">.</xsl:param>
|
||||
<!--
|
||||
<xsl:param name="debug">true</xsl:param>
|
||||
-->
|
||||
|
||||
<xsl:attribute-set name="base.body.style">
|
||||
<xsl:attribute name="font-family">serif</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>
|
||||
|
||||
<xsl:attribute-set name="base.header.style">
|
||||
<xsl:attribute name="font-family">sans-serif</xsl:attribute>
|
||||
<xsl:attribute name="color">#000036</xsl:attribute>
|
||||
</xsl:attribute-set>
|
||||
|
||||
<xsl:attribute-set name="chapter.header.top"
|
||||
use-attribute-sets="base.header.style">
|
||||
<xsl:attribute name="font-size">14pt</xsl:attribute>
|
||||
<xsl:attribute name="text-align">right</xsl:attribute>
|
||||
</xsl:attribute-set>
|
||||
<!-- Templates -->
|
||||
|
||||
<xsl:attribute-set name="chapter.header.bottom"
|
||||
use-attribute-sets="base.header.style">
|
||||
<xsl:attribute name="space-before.optimum">0.5em</xsl:attribute>
|
||||
<xsl:attribute name="font-size">16pt</xsl:attribute>
|
||||
<xsl:attribute name="text-align">right</xsl:attribute>
|
||||
<xsl:attribute name="space-after.optimum">5em</xsl:attribute>
|
||||
</xsl:attribute-set>
|
||||
<xsl:template match="/">
|
||||
<xsl:apply-templates select="project" />
|
||||
</xsl:template>
|
||||
|
||||
<xsl:attribute-set name="normal.header"
|
||||
use-attribute-sets="base.header.style">
|
||||
<xsl:attribute name="space-before.optimum">1.5em</xsl:attribute>
|
||||
<xsl:attribute name="space-before.minimum">1.2em</xsl:attribute>
|
||||
<xsl:attribute name="space-before.maximum">2.0em</xsl:attribute>
|
||||
</xsl:attribute-set>
|
||||
|
||||
<xsl:attribute-set name="normal.paragraph"
|
||||
use-attribute-sets="base.body.style">
|
||||
<xsl:attribute name="space-before.optimum">1.0em</xsl:attribute>
|
||||
<xsl:attribute name="space-before.minimum">0.8em</xsl:attribute>
|
||||
<xsl:attribute name="space-before.maximum">1.2em</xsl:attribute>
|
||||
</xsl:attribute-set>
|
||||
|
||||
<xsl:attribute-set name="normal.pre"
|
||||
use-attribute-sets="normal.paragraph">
|
||||
<xsl:attribute name="wrap-option">no-wrap</xsl:attribute>
|
||||
<xsl:attribute name="white-space-collapse">false</xsl:attribute>
|
||||
<xsl:attribute name="font-family">monospace</xsl:attribute>
|
||||
<xsl:attribute name="color">gray</xsl:attribute>
|
||||
<xsl:attribute name="border">dotted thin gray</xsl:attribute>
|
||||
<xsl:attribute name="padding">0.5em</xsl:attribute>
|
||||
<xsl:attribute name="start-indent">0.5em</xsl:attribute>
|
||||
<xsl:attribute name="end-indent">0.5em</xsl:attribute>
|
||||
</xsl:attribute-set>
|
||||
|
||||
<xsl:template match="project">
|
||||
<xsl:template match="project">
|
||||
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
|
||||
<!-- defines the layout master -->
|
||||
<fo:layout-master-set>
|
||||
<fo:simple-page-master
|
||||
master-name="main"
|
||||
margin-top="1in"
|
||||
margin-bottom="1in"
|
||||
margin-left="1in"
|
||||
margin-right="1in">
|
||||
<fo:region-body margin-bottom="0.5in"/>
|
||||
<fo:region-after extent="0.25in"/>
|
||||
</fo:simple-page-master>
|
||||
</fo:layout-master-set>
|
||||
|
||||
<xsl:apply-templates/>
|
||||
|
||||
<xsl:call-template name="fo-layouts" />
|
||||
<xsl:apply-templates />
|
||||
</fo:root>
|
||||
</xsl:template>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="project/body">
|
||||
<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>
|
||||
|
||||
<!-- Table of contents -->
|
||||
<xsl:template match="project/body/menu">
|
||||
<xsl:apply-templates />
|
||||
</xsl:template>
|
||||
|
||||
<fo:page-sequence master-reference="main">
|
||||
<xsl:template match="project/body/menu/item">
|
||||
<!-- Renders the xml xdoc document -->
|
||||
<xsl:call-template name="render-xdoc">
|
||||
<xsl:with-param name="chapterNumber"><xsl:number count="menu" />.<xsl:number count="menu/item" /></xsl:with-param>
|
||||
</xsl:call-template>
|
||||
<xsl:apply-templates />
|
||||
</xsl:template>
|
||||
|
||||
<!-- header -->
|
||||
<fo:static-content flow-name="xsl-region-after">
|
||||
<fo:block font-size="8pt"
|
||||
font-family="serif"
|
||||
text-align="right">
|
||||
Table of Contents
|
||||
–
|
||||
<fo:page-number/>
|
||||
</fo:block>
|
||||
</fo:static-content>
|
||||
<xsl:template match="project/body/menu/item/item">
|
||||
<!-- Renders the xml xdoc document -->
|
||||
<xsl:call-template name="render-xdoc">
|
||||
<xsl:with-param name="chapterNumber"><xsl:number count="menu" />.<xsl:number count="menu/item" />.<xsl:number count="menu/item/item" /></xsl:with-param>
|
||||
</xsl:call-template>
|
||||
<xsl:apply-templates />
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="project/body/menu/item/item/item">
|
||||
<!-- Renders the xml xdoc document -->
|
||||
<xsl:call-template name="render-xdoc">
|
||||
<xsl:with-param name="chapterNumber"><xsl:number count="menu"/>.<xsl:number count="menu/item"/>.<xsl:number count="menu/item/item"/>.<xsl:number count="menu/item/item/item"/></xsl:with-param>
|
||||
</xsl:call-template>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="render-xdoc">
|
||||
<xsl:param name="chapterNumber">Foo</xsl:param>
|
||||
<!-- Set the page number to start at. Normally this is 'auto'
|
||||
unless we are at the very first xdoc, in which case we reset it to 1 -->
|
||||
<xsl:variable name="pageStart">
|
||||
<xsl:choose>
|
||||
<xsl:when test="normalize-space(translate($chapterNumber,'1.',' '))">
|
||||
<xsl:text>auto</xsl:text>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:text>1</xsl:text>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
<!-- 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>
|
||||
Href = <xsl:value-of select="$href"/></xsl:message>
|
||||
<xsl:message>
|
||||
Doc Name = <xsl:value-of select="$documentName"/></xsl:message>
|
||||
<xsl:message>
|
||||
Doc Path = <xsl:value-of select="$documentPath"/></xsl:message>
|
||||
<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: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">
|
||||
|
||||
<fo:block id="{@href}" xsl:use-attribute-sets="chapter.header.top">
|
||||
<xsl:value-of select="../title"/>
|
||||
</fo:block>
|
||||
<fo:block>
|
||||
<fo:leader leader-pattern="rule"/>
|
||||
</fo:block>
|
||||
<fo:block xsl:use-attribute-sets="chapter.header.bottom">
|
||||
Table of Contents
|
||||
</fo:block>
|
||||
|
||||
<fo:table>
|
||||
|
||||
<fo:table-column column-width="1cm"/>
|
||||
<fo:table-column column-width="13cm"/>
|
||||
<fo:table-column column-width="1cm"/>
|
||||
|
||||
<fo:table-body>
|
||||
|
||||
<xsl:apply-templates mode="toc"/>
|
||||
|
||||
</fo:table-body>
|
||||
|
||||
</fo:table>
|
||||
|
||||
<!-- 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:apply-templates select="document($documentPath)/document/body" />
|
||||
</fo:block>
|
||||
</fo:flow>
|
||||
|
||||
</fo:page-sequence>
|
||||
|
||||
<!-- The sections -->
|
||||
|
||||
<xsl:apply-templates/>
|
||||
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="project/body/menu" mode="toc">
|
||||
|
||||
<fo:table-row>
|
||||
<fo:table-cell>
|
||||
<fo:block><xsl:number count="menu"/></fo:block>
|
||||
</fo:table-cell>
|
||||
<fo:table-cell>
|
||||
<fo:block font-weight="bold">
|
||||
<xsl:value-of select="@name"/>
|
||||
</fo:block>
|
||||
</fo:table-cell>
|
||||
<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>
|
||||
|
||||
<fo:table-cell>
|
||||
<fo:block>
|
||||
<xsl:number count="menu"/>.<xsl:number count="item"/>
|
||||
</fo:block>
|
||||
</fo:table-cell>
|
||||
|
||||
<fo:table-cell>
|
||||
<fo:block>
|
||||
<fo:basic-link internal-destination="{@href}">
|
||||
<xsl:value-of select="@name"/>
|
||||
<fo:leader leader-pattern="dots" keep-with-next.within-line="always"/>
|
||||
</fo:basic-link>
|
||||
</fo:block>
|
||||
</fo:table-cell>
|
||||
|
||||
<fo:table-cell>
|
||||
<fo:block text-align="right">
|
||||
<fo:basic-link internal-destination="{@href}">
|
||||
<fo:page-number-citation ref-id="{@href}"/>
|
||||
</fo:basic-link>
|
||||
</fo:block>
|
||||
</fo:table-cell>
|
||||
|
||||
</fo:table-row>
|
||||
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="project/body/menu">
|
||||
<xsl:apply-templates/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="project/body/menu/item">
|
||||
<!-- this effectively renders the xml document from the href html doc -->
|
||||
<xsl:variable name="document"
|
||||
select="document( concat( $basePath, '/', substring-before( @href, '.html' ), '.xml' ) )/document"/>
|
||||
|
||||
<fo:page-sequence master-reference="main">
|
||||
|
||||
<!-- header -->
|
||||
<fo:static-content flow-name="xsl-region-after">
|
||||
<fo:block font-size="8pt"
|
||||
font-family="serif"
|
||||
text-align="right">
|
||||
<xsl:value-of select="$document/properties/title"/>
|
||||
–
|
||||
<fo:page-number/>
|
||||
</fo:block>
|
||||
</fo:static-content>
|
||||
|
||||
<fo:flow flow-name="xsl-region-body">
|
||||
|
||||
<fo:block id="{@href}" xsl:use-attribute-sets="chapter.header.top">
|
||||
<xsl:number count="menu"/>.<xsl:number count="item"/>
|
||||
</fo:block>
|
||||
<fo:block>
|
||||
<fo:leader leader-pattern="rule"/>
|
||||
</fo:block>
|
||||
<fo:block xsl:use-attribute-sets="chapter.header.bottom">
|
||||
<xsl:value-of select="$document/properties/title"/>
|
||||
</fo:block>
|
||||
|
||||
<xsl:apply-templates select="$document/body"/>
|
||||
|
||||
</fo:flow>
|
||||
|
||||
</fo:page-sequence>
|
||||
|
||||
</xsl:template>
|
||||
|
||||
<!-- ================= the following templates are for xdocs (not projects) -->
|
||||
|
||||
<xsl:template match="document/body">
|
||||
|
||||
<xsl:apply-templates/>
|
||||
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="section">
|
||||
|
||||
<fo:block font-size="14pt" xsl:use-attribute-sets="normal.header">
|
||||
<xsl:value-of select="@name"/>
|
||||
</fo:block>
|
||||
|
||||
<xsl:apply-templates/>
|
||||
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="subsection">
|
||||
|
||||
<fo:block font-size="12pt" xsl:use-attribute-sets="normal.header">
|
||||
<xsl:value-of select="@name"/>
|
||||
</fo:block>
|
||||
|
||||
<xsl:apply-templates/>
|
||||
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="p">
|
||||
|
||||
<fo:block font-size="10pt" xsl:use-attribute-sets="normal.paragraph">
|
||||
<xsl:apply-templates/>
|
||||
</fo:block>
|
||||
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="source">
|
||||
|
||||
<fo:block font-size="10pt" xsl:use-attribute-sets="normal.pre">
|
||||
<xsl:apply-templates/>
|
||||
</fo:block>
|
||||
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="img[@src]">
|
||||
<fo:block>
|
||||
<fo:external-graphic src="{@src}"/>
|
||||
</fo:block>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="table">
|
||||
<!-- FIXME: Do Nothing is not acceptable -->
|
||||
<!-- realistically, FOP doesn't support tables with auto, so we can
|
||||
short term, count the number of td's or th's in the first row
|
||||
and use that as a guide for an evenly spaced table
|
||||
<fo:table>
|
||||
<fo:table-column column-width="1cm"/>
|
||||
<fo:table-column column-width="13cm"/>
|
||||
<fo:table-column column-width="1cm"/>
|
||||
|
||||
<fo:table-body>
|
||||
<xsl:apply-templates mode="toc"/>
|
||||
|
||||
</fo:table-body>
|
||||
|
||||
</fo:table>
|
||||
-->
|
||||
</xsl:template>
|
||||
|
||||
<!-- XHTML stuff -->
|
||||
|
||||
<xsl:template match="a[@href]">
|
||||
<fo:basic-link external-destination="{@href}">
|
||||
<fo:inline color="blue">
|
||||
<xsl:apply-templates />
|
||||
</fo:inline>
|
||||
</fo:basic-link>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="br">
|
||||
<fo:block/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="em|i">
|
||||
<fo:inline font-style="italic">
|
||||
<xsl:apply-templates />
|
||||
</fo:inline>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="strong|b">
|
||||
<fo:inline font-weight="bold">
|
||||
<xsl:apply-templates />
|
||||
</fo:inline>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="sub">
|
||||
<fo:inline baseline-shift="sub">
|
||||
<xsl:apply-templates />
|
||||
</fo:inline>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="sup">
|
||||
<fo:inline baseline-shift="sup">
|
||||
<xsl:apply-templates />
|
||||
</fo:inline>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="tt|code">
|
||||
<fo:inline font-family="monospace">
|
||||
<xsl:apply-templates />
|
||||
</fo:inline>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="big">
|
||||
<fo:inline font-size="larger">
|
||||
<xsl:apply-templates />
|
||||
</fo:inline>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="small">
|
||||
<fo:inline font-size="smaller">
|
||||
<xsl:apply-templates />
|
||||
</fo:inline>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:attribute-set name="list">
|
||||
<xsl:attribute name="provisional-distance-between-starts">
|
||||
1em
|
||||
</xsl:attribute>
|
||||
<xsl:attribute name="provisional-label-separation">
|
||||
1em
|
||||
</xsl:attribute>
|
||||
</xsl:attribute-set>
|
||||
|
||||
<xsl:attribute-set name="list.item">
|
||||
<xsl:attribute name="start-indent">inherit</xsl:attribute>
|
||||
</xsl:attribute-set>
|
||||
|
||||
<xsl:attribute-set name="dl">
|
||||
<!-- <xsl:attribute name="start-indent">inherit</xsl:attribute>
|
||||
<xsl:attribute name="end-indent">inherit</xsl:attribute>
|
||||
-->
|
||||
<xsl:attribute name="start-indent">1em</xsl:attribute>
|
||||
<xsl:attribute name="end-indent">1em</xsl:attribute>
|
||||
</xsl:attribute-set>
|
||||
|
||||
<xsl:attribute-set name="dt">
|
||||
<!-- <xsl:attribute name="start-indent">inherit</xsl:attribute>
|
||||
<xsl:attribute name="end-indent">inherit</xsl:attribute>
|
||||
--> <xsl:attribute name="start-indent">1em</xsl:attribute>
|
||||
<xsl:attribute name="end-indent">1em</xsl:attribute>
|
||||
</xsl:attribute-set>
|
||||
|
||||
<xsl:attribute-set name="dd">
|
||||
<xsl:attribute name="start-indent">1em</xsl:attribute>
|
||||
<!-- <xsl:attribute name="start-indent">inherit +1em</xsl:attribute>
|
||||
<xsl:attribute name="end-indent">inherit</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>
|
||||
|
||||
<xsl:template match="ul">
|
||||
<fo:list-block xsl:use-attribute-sets="list">
|
||||
<xsl:apply-templates/>
|
||||
</fo:list-block>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="ul/li">
|
||||
<fo:list-item>
|
||||
<fo:list-item-label xsl:use-attribute-sets="list-item"
|
||||
end-indent="label-end()">
|
||||
<fo:block font-size="10pt">
|
||||
<fo:character character="•" />
|
||||
</fo:block>
|
||||
</fo:list-item-label>
|
||||
<fo:list-item-body start-indent="body-start()">
|
||||
<fo:block font-size="10pt">
|
||||
<xsl:apply-templates/>
|
||||
</fo:block>
|
||||
</fo:list-item-body>
|
||||
</fo:list-item>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="ol">
|
||||
<fo:list-block xsl:use-attribute-sets="list">
|
||||
<xsl:apply-templates />
|
||||
</fo:list-block>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="ol/li">
|
||||
<fo:list-item>
|
||||
<fo:list-item-label xsl:use-attribute-sets="list-item" end-indent="label-end()">
|
||||
<fo:block font-size="10pt">
|
||||
<xsl:number format="1." />
|
||||
</fo:block>
|
||||
</fo:list-item-label>
|
||||
<fo:list-item-body start-indent="body-start()">
|
||||
<fo:block font-size="10pt">
|
||||
<xsl:apply-templates/>
|
||||
</fo:block>
|
||||
</fo:list-item-body>
|
||||
</fo:list-item>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template match="dl">
|
||||
<fo:block font-size="10pt" xsl:use-attribute-sets="dl">
|
||||
<xsl:apply-templates />
|
||||
</fo:block>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template match="dt">
|
||||
<fo:block font-size="10pt" xsl:use-attribute-sets="dt">
|
||||
<xsl:apply-templates />
|
||||
</fo:block>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="dd">
|
||||
<fo:block font-size="10pt" xsl:use-attribute-sets="dd">
|
||||
<xsl:apply-templates />
|
||||
</fo:block>
|
||||
</xsl:template>
|
||||
</fo:page-sequence>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
||||
|
||||
@@ -0,0 +1,72 @@
|
||||
<!--<!DOCTYPE configuration SYSTEM "config.dtd">-->
|
||||
<!--
|
||||
this file contains templates which allow an user easy
|
||||
configuration of Fop. Actually normally you don't need this configuration
|
||||
file, but if you need to change configuration, you should
|
||||
always use this file and *not* config.xml.
|
||||
Usage: java org.apache.fop.apps.Fop -c userconfig.xml -fo fo-file -pdf pdf-file
|
||||
-->
|
||||
|
||||
|
||||
<configuration>
|
||||
|
||||
<!-- NOT IMPLEMENTED
|
||||
basedir: normally the base directory is the directory where the fo file is
|
||||
located. if you want to specify your own, uncomment this entry
|
||||
-->
|
||||
<!--
|
||||
<entry>
|
||||
<key>baseDir</key>
|
||||
<value></value>
|
||||
</entry>
|
||||
-->
|
||||
|
||||
<!--
|
||||
************************************************************************
|
||||
HYPHENATION
|
||||
************************************************************************
|
||||
-->
|
||||
|
||||
<!--
|
||||
hyphenation directory
|
||||
if you want to specify your own directory with hyphenation pattern
|
||||
then uncomment the next entry and add the directory name
|
||||
-->
|
||||
|
||||
<!--
|
||||
<entry>
|
||||
<key>hyphenation-dir</key>
|
||||
<value>/java/xml-fop/hyph</value>
|
||||
</entry>
|
||||
-->
|
||||
|
||||
<!--
|
||||
************************************************************************
|
||||
Add fonts here
|
||||
************************************************************************
|
||||
-->
|
||||
|
||||
<fonts>
|
||||
<font metrics-file="fonts/ttf-gara.xml" kerning="yes" embed-file="fonts/gara.ttf">
|
||||
<font-triplet name="Garamond" style="normal" weight="normal"/>
|
||||
</font>
|
||||
<font metrics-file="fonts/ttf-garabd.xml" kerning="yes" embed-file="fonts/garabd.ttf">
|
||||
<font-triplet name="Garamond" style="normal" weight="bold"/>
|
||||
</font>
|
||||
<font metrics-file="fonts/ttf-garait.xml" kerning="yes" embed-file="fonts/garait.ttf">
|
||||
<font-triplet name="Garamond" style="italic" weight="normal"/>
|
||||
</font>
|
||||
<!-- example -->
|
||||
<!--
|
||||
<font metrics-file="arial.xml" kerning="yes" embed-file="arial.ttf">
|
||||
<font-triplet name="Arial" style="normal" weight="normal"/>
|
||||
<font-triplet name="ArialMT" style="normal" weight="normal"/>
|
||||
</font>
|
||||
-->
|
||||
</fonts>
|
||||
|
||||
|
||||
</configuration>
|
||||
|
||||
|
||||
|
||||
@@ -6,6 +6,13 @@
|
||||
</properties>
|
||||
|
||||
<body>
|
||||
<release version="2.0" date="In CVS">
|
||||
<action dev="evenisse" type="update">
|
||||
MAVEN-MPPDF-1. Completely re-writte of the PDF plug-in. It solves most of the thorniest
|
||||
issues, such as table formatting, more levels in the table of contents,
|
||||
and image sizing. The graphic design is also dramatically improved.
|
||||
</action>
|
||||
</release>
|
||||
<release version="1.2" date="2003-09-29">
|
||||
<action dev="dion" type="update">update to use maven.docs.*/maven.gen.docs</action>
|
||||
</release>
|
||||
|
||||
Reference in new issue
Block a user