import org.apache.fop.apps.Fop
import org.apache.fop.apps.MimeConstants
import javax.xml.transform.sax.SAXResult
-import javax.xml.transform.Source
import javax.xml.transform.TransformerFactory
import javax.xml.transform.Templates
import org.lilie.services.eliot.DocbookRenderException
import org.lilie.services.eliot.xml.URIResolver
-import org.lilie.services.eliot.xml.XmlUtils
+import org.lilie.services.eliot.ResourceUtils
+import org.apache.avalon.framework.configuration.Configuration
+import org.apache.avalon.framework.configuration.DefaultConfigurationBuilder
+
/**
* Classe de convertion des fichiers docbook vers PDF
class DocbookVersPdf {
- OutputStream fichierPdf = new ByteArrayOutputStream()
-
- private Transformer internalBuildTransformer(DonneesPourLeRendu ctx) {
+ OutputStream fichierPdf = new ByteArrayOutputStream()
- TransformerFactory factory = new com.icl.saxon.TransformerFactoryImpl()
- factory.setURIResolver(new URIResolver())
- Templates templates = factory.newTemplates(ctx.getXslSource())
- Transformer transformer = templates.newTransformer()
- return transformer
- }
+ private Transformer internalBuildTransformer(DonneesPourLeRendu ctx) {
- private Transformer buildTransformer(DonneesPourLeRendu ctx) {
-
- Transformer transformer = internalBuildTransformer(ctx)
+ TransformerFactory factory = new com.icl.saxon.TransformerFactoryImpl()
+ factory.setURIResolver(new URIResolver())
+ Templates templates = factory.newTemplates(ctx.getXslSource())
+ Transformer transformer = templates.newTransformer()
+ return transformer
+ }
- affecteParametres(transformer, ctx.sansSommaire)
+ private Transformer buildTransformer(DonneesPourLeRendu ctx) {
+ Transformer transformer
+ try {
+ transformer = internalBuildTransformer(ctx)
- return transformer
- }
+ affecteParametres(transformer, ctx.sansSommaire)
+ } catch (Exception e) {
+ throw new DocbookRenderException("Erreur convertion docbook->xsl/fo", e)
+ }
- /**
- * positionne les paramètres de la feuille de style docbook to pdf
- * @param transformer
- * @param sansSommaire
- */
- private void affecteParametres(Transformer transformer, boolean sansSommaire) {
- transformer.setParameter("fop.extensions", "0")
- transformer.setParameter("fop1.extensions", "1")
- // format feuille A4
- transformer.setParameter("paper.type", "A4")
- // libellé en français
- transformer.setParameter("l10n.gentext.language", "fr")
- // si on n'a pas de sommaire on vide le descriptif du sommaire
- if (sansSommaire) {
- transformer.setParameter("generate.toc", "")
+ return transformer
}
- }
-
- /**
- * Construction d'un objet result à partir des données docbook à
- * transformer. Construit aussi un objet fop pour générer du pdf.
- * @param ctx
- * @return
- */
- private Result getResult(DonneesPourLeRendu ctx) {
- try {
-
- FopFactory fopFactory = FopFactory.newInstance()
- fopFactory.setStrictValidation(false)
- fopFactory.setURIResolver(new PdfURIResolver())
-
- Fop fop = fopFactory.newFop(
- MimeConstants.MIME_PDF,
- fichierPdf
- )
-
- return new SAXResult(fop.getDefaultHandler());
-
- } catch (Exception e) {
- throw new DocbookRenderException("Erreur de création de l'objet FOP", e)
+
+ /**
+ * positionne les paramètres de la feuille de style docbook to pdf
+ * @param transformer
+ * @param sansSommaire
+ */
+ private void affecteParametres(Transformer transformer, boolean sansSommaire) {
+ // libellé en français
+ transformer.setParameter("l10n.gentext.language", "fr")
+ // si on n'a pas de sommaire on vide le descriptif du sommaire
+ if (sansSommaire) {
+ transformer.setParameter("generate.toc", "")
+ }
}
- }
+ /**
+ * Construction d'un objet result à partir des données docbook à
+ * transformer. Construit aussi un objet fop pour générer du pdf.
+ * @param ctx
+ * @return
+ */
+ private Result getResult(DonneesPourLeRendu ctx) {
+ try {
+
+ FopFactory fopFactory = FopFactory.newInstance()
+
+ chargeConfigurationFactory(fopFactory)
- /**
- * Permet de convertir un document docbook en pdf
- * @param ctx
- */
- public void render(DonneesPourLeRendu ctx) {
- try {
- Transformer transformer = buildTransformer(ctx)
+ fopFactory.setStrictValidation(false)
+ PdfURIResolver pdfURIResolver = new PdfURIResolver()
- transformer.transform(
- ctx.getXmlSource(),
- getResult(ctx)
- )
+ fopFactory.setURIResolver(pdfURIResolver)
+
+ Fop fop = fopFactory.newFop(
+ MimeConstants.MIME_PDF,
+ fichierPdf
+ )
+
+ return new SAXResult(fop.getDefaultHandler());
+
+ } catch (Exception e) {
+ throw new DocbookRenderException("Erreur de création de l'objet FOP", e)
+ }
+
+ }
+
+ private void chargeConfigurationFactory(FopFactory fopFactory) {
+ DefaultConfigurationBuilder cfgBuilder = new DefaultConfigurationBuilder()
+ Configuration cfg = cfgBuilder.build(ResourceUtils.fopConfigFile())
+ fopFactory.setUserConfig(cfg)
+ }
- } catch (Exception e) {
- throw new DocbookRenderException(e)
+ /**
+ * Permet de convertir un document docbook en pdf
+ * @param ctx
+ */
+ public void render(DonneesPourLeRendu ctx) {
+ try {
+ Transformer transformer = buildTransformer(ctx)
+
+ transformer.transform(
+ ctx.getXmlSource(),
+ getResult(ctx)
+ )
+
+ } catch (Exception e) {
+ throw new DocbookRenderException("Erreur sur le render",e)
+ }
}
- }
}
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:d="http://docbook.org/ns/docbook"
+ xmlns:fo="http://www.w3.org/1999/XSL/Format"
+ version="1.0">
+
+ <xsl:import href="docbook.xsl"/>
+
+ <!--###################################################
+ Extensions
+ ################################################### -->
+
+ <!-- These extensions are required for table printing and other stuff -->
+ <xsl:param name="use.extensions">1</xsl:param>
+ <xsl:param name="tablecolumns.extension">0</xsl:param>
+ <xsl:param name="callout.extensions">1</xsl:param>
+
+ <xsl:param name="header.rule">0</xsl:param>
+
+ <!-- FOP provide only PDF Bookmarks at the moment -->
+ <xsl:param name="fop.extensions">0</xsl:param>
+ <xsl:param name="fop1.extensions">1</xsl:param>
+
+ <xsl:param name="use.role.for.mediaobject">1</xsl:param>
+ <xsl:param name="preferred.mediaobject.role" select="'print'"/>
+ <!--###################################################
+ Table Of Contents
+ ################################################### -->
+
+ <!-- Generate the TOCs for named components only -->
+ <xsl:param name="generate.toc">
+ book toc
+ </xsl:param>
+
+ <!-- Show only Sections up to level 3 in the TOCs -->
+ <xsl:param name="toc.section.depth">2</xsl:param>
+
+ <!-- Dot and Whitespace as separator in TOC between Label and Title-->
+ <xsl:param name="autotoc.label.separator" select="'. '"/>
+
+ <xsl:param name="highlight.source">1</xsl:param>
+
+
+ <!--###################################################
+ Paper & Page Size
+ ################################################### -->
+
+ <!-- Paper type, no headers on blank pages, no double sided printing -->
+ <xsl:param name="paper.type" select="'A4'"/>
+
+ <xsl:param name="headers.on.blank.pages">1</xsl:param>
+ <xsl:param name="footers.on.blank.pages">1</xsl:param>
+
+ <!-- Space between paper border and content (chaotic stuff, don't touch) -->
+ <xsl:param name="region.before.extent">0.0in</xsl:param>
+ <xsl:param name="body.margin.top">0.0in</xsl:param>
+
+ <xsl:param name="body.margin.bottom">0.4in</xsl:param>
+ <xsl:param name="region.after.extent">0.3in</xsl:param>
+
+ <xsl:param name="page.margin.bottom" select="'0.75in'"/>
+ <xsl:param name="page.margin.top" select="'0.75in'"/>
+ <xsl:param name="page.margin.inner" select="'0.875in'"/>
+ <xsl:param name="page.margin.outer" select="'0.875in'"/>
+
+ <xsl:param name="body.start.indent" select="'0pt'"/>
+
+ <!-- No intendation of Titles -->
+ <xsl:param name="title.margin.left">0pc</xsl:param>
+
+ <!--###################################################
+ Fonts & Styles
+ ################################################### -->
+
+ <!-- Left aligned text and no hyphenation -->
+ <xsl:param name="alignment">justify</xsl:param>
+ <xsl:param name="hyphenate">true</xsl:param>
+
+ <!-- Line height in body text -->
+ <xsl:param name="line-height">1.3</xsl:param>
+
+ <xsl:param name="body.font.family" select="'TimesNewRoman'" />
+ <xsl:param name="body.font.master" select="'10'"/>
+ <xsl:param name="body.font.small" select="'8'"/>
+ <xsl:param name="dingbat.font.family" select="''"/>
+ <xsl:param name="symbol.font.family" select="''"/>
+ <!-- <xsl:param name="title.font.family" select="'sans-serif'" /> -->
+ <!-- <xsl:param name="monospace.font.family" select="'monospace'" /> -->
+ <xsl:param name="double.sided" select="'0'"/>
+
+ <xsl:attribute-set name="normal.para.spacing">
+ <xsl:attribute name="space-after.optimum">6pt</xsl:attribute>
+ <xsl:attribute name="space-before.optimum">3pt</xsl:attribute>
+ </xsl:attribute-set>
+
+ <xsl:attribute-set name="component.title.properties">
+ <xsl:attribute name="keep-with-next.within-column">always</xsl:attribute>
+ <xsl:attribute name="space-before.optimum">
+ <xsl:value-of
+ select="concat($body.font.master, 'pt')"></xsl:value-of>
+ </xsl:attribute>
+ <xsl:attribute name="space-before.minimum">
+ <xsl:value-of
+ select="concat($body.font.master, 'pt * 0.8')"></xsl:value-of>
+ </xsl:attribute>
+ <xsl:attribute name="space-before.maximum">
+ <xsl:value-of
+ select="concat($body.font.master, 'pt * 1.2')"></xsl:value-of>
+ </xsl:attribute>
+ <xsl:attribute name="hyphenate">false</xsl:attribute>
+ <xsl:attribute name="text-align">left</xsl:attribute>
+ <xsl:attribute name="word-spacing">-0.1em</xsl:attribute>
+ <xsl:attribute name="letter-spacing">-0.05em</xsl:attribute>
+ </xsl:attribute-set>
+
+ <xsl:attribute-set name="toc.margin.properties">
+ <xsl:attribute name="space-before.minimum">0.5em</xsl:attribute>
+ <xsl:attribute name="space-before.optimum">1em</xsl:attribute>
+ <xsl:attribute name="space-before.maximum">2em</xsl:attribute>
+ <xsl:attribute name="space-after.minimum">0.5em</xsl:attribute>
+ <xsl:attribute name="space-after.optimum">1em</xsl:attribute>
+ <xsl:attribute name="space-after.maximum">2em</xsl:attribute>
+ </xsl:attribute-set>
+
+ <xsl:attribute-set name="chap.label.properties">
+ </xsl:attribute-set>
+
+ <xsl:attribute-set name="chap.title.properties">
+ </xsl:attribute-set>
+
+ <!--
+ ################################################### Custom Title Page
+ ###################################################
+ -->
+
+ <xsl:template name="book.titlepage.recto">
+ </xsl:template>
+
+
+ <!-- Prevent blank pages in output -->
+
+ <xsl:template name="book.titlepage.before.verso">
+ </xsl:template>
+ <!--<xsl:template name="book.titlepage.verso">-->
+ <!--</xsl:template>-->
+ <xsl:template name="book.titlepage.separator">
+ </xsl:template>
+
+
+ <!--###################################################
+ Header
+ ################################################### -->
+
+ <!-- More space in the center header for long text -->
+ <xsl:attribute-set name="header.content.properties">
+ <xsl:attribute name="font-family">
+ <xsl:value-of select="$body.font.family"/>
+ </xsl:attribute>
+ <xsl:attribute name="margin-left">-5em</xsl:attribute>
+ <xsl:attribute name="margin-right">-5em</xsl:attribute>
+ </xsl:attribute-set>
+
+ <xsl:param name="ulink.footnotes">1</xsl:param>
+
+ <!--###################################################
+ Custom Footer
+ ################################################### -->
+ <xsl:template name="header.content">
+ </xsl:template>
+
+ <xsl:template name="footer.content">
+ <xsl:param name="pageclass" select="''"/>
+ <xsl:param name="sequence" select="''"/>
+ <xsl:param name="position" select="''"/>
+ <xsl:param name="gentext-key" select="''"/>
+ <xsl:variable name="Version">
+ <xsl:if test="//releaseinfo">
+ <xsl:value-of select="//releaseinfo"/>
+ </xsl:if>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="$sequence='blank'">
+ <xsl:if test="$position = 'center'">
+ <xsl:value-of select="$Version"/>
+ </xsl:if>
+ </xsl:when>
+ <!-- for double sided printing, print page numbers on alternating sides (of the page) -->
+ <xsl:when test="$double.sided != 0">
+ <xsl:choose>
+ <xsl:when test="$sequence = 'even' and $position='left'">
+ <fo:page-number/>
+ </xsl:when>
+ <xsl:when test="$sequence = 'odd' and $position='right'">
+ <fo:page-number/>
+ </xsl:when>
+ <xsl:when test="$position='center'">
+ <xsl:value-of select="$Version"/>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:when>
+ <!-- for single sided printing, print all page numbers on the right (of the page) -->
+ <xsl:when test="$double.sided = 0">
+ <xsl:choose>
+ <xsl:when test="$position='center'">
+ <xsl:value-of select="$Version"/>
+ </xsl:when>
+ <xsl:when test="$position='right'">
+ <fo:page-number/>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:template>
+
+ <!-- Monospaced fonts are smaller than regular text -->
+ <xsl:attribute-set name="monospace.properties">
+ <xsl:attribute name="font-family">
+ <xsl:value-of select="$monospace.font.family"/>
+ </xsl:attribute>
+ <xsl:attribute name="font-size">9pt</xsl:attribute>
+ </xsl:attribute-set>
+
+ <!--###################################################
+ Tables
+ ################################################### -->
+
+ <!-- The table width should be adapted to the paper size -->
+ <xsl:param name="default.table.width">5.25in</xsl:param>
+
+ <!-- Some padding inside tables -->
+ <xsl:attribute-set name="table.cell.padding">
+ <xsl:attribute name="padding-left">2pt</xsl:attribute>
+ <xsl:attribute name="padding-right">2pt</xsl:attribute>
+ <xsl:attribute name="padding-top">2pt</xsl:attribute>
+ <xsl:attribute name="padding-bottom">2pt</xsl:attribute>
+ </xsl:attribute-set>
+
+ <!-- Only hairlines as frame and cell borders in tables -->
+ <xsl:param name="table.frame.border.thickness">0.1pt</xsl:param>
+ <xsl:param name="table.cell.border.thickness">0.1pt</xsl:param>
+
+ <!--###################################################
+ Labels
+ ################################################### -->
+
+ <!-- Label Chapters and Sections (numbering) -->
+ <xsl:param name="chapter.autolabel">1</xsl:param>
+ <xsl:param name="section.autolabel" select="1"/>
+ <xsl:param name="section.label.includes.component.label" select="1"/>
+
+ <!--###################################################
+ Titles
+ ################################################### -->
+
+ <!-- Chapter title size -->
+ <xsl:attribute-set name="chapter.titlepage.recto.style">
+ <xsl:attribute name="text-align">left</xsl:attribute>
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
+ <xsl:attribute name="font-size">
+ <xsl:value-of select="$body.font.master * 1.25"/>
+ <xsl:text>pt</xsl:text>
+ </xsl:attribute>
+ </xsl:attribute-set>
+
+ <!-- Why is the font-size for chapters hardcoded in the XSL FO templates?
+ Let's remove it, so this sucker can use our attribute-set only... -->
+ <xsl:template match="title" mode="chapter.titlepage.recto.auto.mode">
+ <fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format"
+ xsl:use-attribute-sets="chapter.titlepage.recto.style">
+ <xsl:call-template name="component.title">
+ <xsl:with-param name="node" select="ancestor-or-self::chapter[1]"/>
+ </xsl:call-template>
+ </fo:block>
+ </xsl:template>
+
+ <!-- Sections 1, 2 and 3 titles have a small bump factor and padding -->
+ <xsl:attribute-set name="section.title.level1.properties">
+ <xsl:attribute name="space-before.optimum">0.8em</xsl:attribute>
+ <xsl:attribute name="space-before.minimum">0.8em</xsl:attribute>
+ <xsl:attribute name="space-before.maximum">0.8em</xsl:attribute>
+ <xsl:attribute name="font-size">
+ <xsl:value-of select="$body.font.master * 1.5"/>
+ <xsl:text>pt</xsl:text>
+ </xsl:attribute>
+ <xsl:attribute name="space-after.optimum">0.1em</xsl:attribute>
+ <xsl:attribute name="space-after.minimum">0.1em</xsl:attribute>
+ <xsl:attribute name="space-after.maximum">0.1em</xsl:attribute>
+ </xsl:attribute-set>
+ <xsl:attribute-set name="section.title.level2.properties">
+ <xsl:attribute name="space-before.optimum">0.6em</xsl:attribute>
+ <xsl:attribute name="space-before.minimum">0.6em</xsl:attribute>
+ <xsl:attribute name="space-before.maximum">0.6em</xsl:attribute>
+ <xsl:attribute name="font-size">
+ <xsl:value-of select="$body.font.master * 1.25"/>
+ <xsl:text>pt</xsl:text>
+ </xsl:attribute>
+ <xsl:attribute name="space-after.optimum">0.1em</xsl:attribute>
+ <xsl:attribute name="space-after.minimum">0.1em</xsl:attribute>
+ <xsl:attribute name="space-after.maximum">0.1em</xsl:attribute>
+ </xsl:attribute-set>
+ <xsl:attribute-set name="section.title.level3.properties">
+ <xsl:attribute name="space-before.optimum">0.4em</xsl:attribute>
+ <xsl:attribute name="space-before.minimum">0.4em</xsl:attribute>
+ <xsl:attribute name="space-before.maximum">0.4em</xsl:attribute>
+ <xsl:attribute name="font-size">
+ <xsl:value-of select="$body.font.master * 1.0"/>
+ <xsl:text>pt</xsl:text>
+ </xsl:attribute>
+ <xsl:attribute name="space-after.optimum">0.1em</xsl:attribute>
+ <xsl:attribute name="space-after.minimum">0.1em</xsl:attribute>
+ <xsl:attribute name="space-after.maximum">0.1em</xsl:attribute>
+ </xsl:attribute-set>
+
+ <!-- Titles of formal objects (tables, examples, ...) -->
+ <xsl:attribute-set name="formal.object.properties">
+ <xsl:attribute name="keep-together.within-column">auto</xsl:attribute>
+ </xsl:attribute-set>
+
+ <xsl:attribute-set name="formal.title.properties" use-attribute-sets="normal.para.spacing">
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
+ <xsl:attribute name="font-size">
+ <xsl:value-of select="$body.font.master"/>
+ <xsl:text>pt</xsl:text>
+ </xsl:attribute>
+ <xsl:attribute name="hyphenate">false</xsl:attribute>
+ <xsl:attribute name="space-after.minimum">0.4em</xsl:attribute>
+ <xsl:attribute name="space-after.optimum">0.6em</xsl:attribute>
+ <xsl:attribute name="space-after.maximum">0.8em</xsl:attribute>
+ </xsl:attribute-set>
+
+ <!--###################################################
+ Programlistings
+ ################################################### -->
+
+ <!-- Verbatim text formatting (programlistings) -->
+ <xsl:attribute-set name="monospace.verbatim.properties">
+ <xsl:attribute name="wrap-option">wrap</xsl:attribute>
+ <xsl:attribute name="font-size">
+ <xsl:text>7.8pt</xsl:text>
+ </xsl:attribute>
+ </xsl:attribute-set>
+
+ <xsl:attribute-set name="verbatim.properties">
+ <xsl:attribute name="space-before.minimum">0em</xsl:attribute>
+ <xsl:attribute name="space-before.optimum">0em</xsl:attribute>
+ <xsl:attribute name="space-before.maximum">0em</xsl:attribute>
+ <xsl:attribute name="border-color">#151B54</xsl:attribute>
+ <xsl:attribute name="border-style">solid</xsl:attribute>
+ <xsl:attribute name="border-width">0.2pt</xsl:attribute>
+ <xsl:attribute name="padding-top">0.5em</xsl:attribute>
+ <xsl:attribute name="padding-left">0.3em</xsl:attribute>
+ <xsl:attribute name="padding-right">0.3em</xsl:attribute>
+ <xsl:attribute name="padding-bottom">0.5em</xsl:attribute>
+ <xsl:attribute name="margin-left">0em</xsl:attribute>
+ <xsl:attribute name="margin-right">0em</xsl:attribute>
+ </xsl:attribute-set>
+
+ <!-- Shade (background) programlistings -->
+ <xsl:param name="shade.verbatim">1</xsl:param>
+ <xsl:attribute-set name="shade.verbatim.style">
+ <xsl:attribute name="background-color">#E3E4FA</xsl:attribute>
+ </xsl:attribute-set>
+
+ <!--###################################################
+ Callouts
+ ################################################### -->
+
+ <!-- Use images for callouts instead of (1) (2) (3) -->
+ <xsl:param name="callout.graphics">1</xsl:param>
+ <xsl:param name="callout.unicode">0</xsl:param>
+
+ <!-- Place callout marks at this column in annotated areas -->
+ <xsl:param name="callout.defaultcolumn">90</xsl:param>
+
+ <!--###################################################
+ Admonitions
+ ################################################### -->
+
+ <!-- Use nice graphics for admonitions -->
+ <xsl:param name="admon.graphics">'1'</xsl:param>
+ <xsl:param name="admon.graphics.extension">.svg</xsl:param>
+ <!-- <xsl:param name="admon.graphics.path">&admon_gfx_path;</xsl:param> -->
+
+ <xsl:attribute-set name="admonition.title.properties">
+ <xsl:attribute name="font-size">14pt</xsl:attribute>
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
+ <xsl:attribute name="hyphenate">false</xsl:attribute>
+ <xsl:attribute name="keep-with-next.within-column">always</xsl:attribute>
+ </xsl:attribute-set>
+
+ <!--###################################################
+ Misc
+ ################################################### -->
+
+ <!-- Placement of titles -->
+ <xsl:param name="formal.title.placement">
+ figure after
+ example before
+ equation before
+ table before
+ procedure before
+ </xsl:param>
+
+ <!-- Format Variable Lists as Blocks (prevents horizontal overflow) -->
+ <xsl:param name="variablelist.as.blocks">1</xsl:param>
+
+ <!-- The horrible list spacing problems -->
+ <xsl:attribute-set name="list.block.spacing">
+ <xsl:attribute name="space-before.optimum">0em</xsl:attribute>
+ <xsl:attribute name="space-before.minimum">0em</xsl:attribute>
+ <xsl:attribute name="space-before.maximum">0em</xsl:attribute>
+ <xsl:attribute name="space-after.optimum">0em</xsl:attribute>
+ <xsl:attribute name="space-after.minimum">0em</xsl:attribute>
+ <xsl:attribute name="space-after.maximum">0em</xsl:attribute>
+ <xsl:attribute name="margin-left">1.0em</xsl:attribute>
+ </xsl:attribute-set>
+
+ <xsl:param name="list.item.spacing">0.5em</xsl:param>
+ <xsl:param name="compact.list.item.spacing">0.5em</xsl:param>
+
+ <!--###################################################
+ colored and hyphenated links
+ ################################################### -->
+ <xsl:template match="ulink">
+ <fo:basic-link external-destination="{@url}"
+ xsl:use-attribute-sets="xref.properties"
+ text-decoration="underline"
+ color="blue">
+ <xsl:choose>
+ <xsl:when test="count(child::node())=0">
+ <xsl:value-of select="@url"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:apply-templates/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </fo:basic-link>
+ </xsl:template>
+
+ <xsl:template match="link">
+ <fo:basic-link internal-destination="{@linkend}"
+ xsl:use-attribute-sets="xref.properties"
+ text-decoration="underline"
+ color="blue">
+ <xsl:choose>
+ <xsl:when test="count(child::node())=0">
+ <xsl:value-of select="@linkend"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:apply-templates/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </fo:basic-link>
+ </xsl:template>
+
+ <xsl:template match="d:command">
+ <xsl:call-template name="inline.boldmonoseq"/>
+ </xsl:template>
+
+ <xsl:attribute-set name="revhistory.title.properties">
+ <xsl:attribute name="font-size">17.28pt</xsl:attribute>
+ <xsl:attribute name="font-family">Helvetica</xsl:attribute>
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
+ </xsl:attribute-set>
+
+ <xsl:attribute-set name="revhistory.table.properties">
+ <xsl:attribute name="border">0.5pt solid black</xsl:attribute>
+ <xsl:attribute name="background-color">#F2F2F2</xsl:attribute>
+ <xsl:attribute name="width">100%</xsl:attribute>
+ </xsl:attribute-set>
+
+ <xsl:attribute-set name="revhistory.table.cell.properties">
+ <xsl:attribute name="border">0.5pt solid black</xsl:attribute>
+ <xsl:attribute name="font-size">9pt</xsl:attribute>
+ <xsl:attribute name="padding">4pt</xsl:attribute>
+ </xsl:attribute-set>
+
+</xsl:stylesheet>