⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 fopdf.xsl

📁 Hibernate中文参考手册
💻 XSL
📖 第 1 页 / 共 2 页
字号:
<?xml version="1.0"?><!--    This is the XSL FO configuration file for the Hibernate    Reference Documentation. It defines a custom titlepage and    the parameters for the A4 sized PDF printable output.    It took me days to figure out this stuff and fix most of    the obvious bugs in the DocBook XSL distribution. Some of    the workarounds might not be appropriate with a newer version    of DocBook XSL. This file is released as part of Hibernate,    hence LGPL licensed.    christian@hibernate.org--><!DOCTYPE xsl:stylesheet [    <!ENTITY db_xsl_path        "../lib/docbook-xsl/">    <!ENTITY admon_gfx_path     "../images/admons/">]><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"                version="1.0"                xmlns="http://www.w3.org/TR/xhtml1/transitional"                xmlns:fo="http://www.w3.org/1999/XSL/Format"                exclude-result-prefixes="#default">                <xsl:import href="&db_xsl_path;/fo/docbook.xsl"/><!--###################################################                   Custom Title Page    ################################################### -->         <xsl:template name="book.titlepage.recto">        <fo:block>            <fo:table table-layout="fixed" width="175mm">                <fo:table-column column-width="175mm"/>                <fo:table-body>                    <fo:table-row>                        <fo:table-cell text-align="center">                            <fo:block>                                <fo:external-graphic src="file:images/hibernate_logo_a.png"/>                            </fo:block>                            <fo:block font-family="Helvetica" font-size="22pt" padding-before="10mm">                                <xsl:value-of select="bookinfo/subtitle"/>                             </fo:block>                            <fo:block font-family="Helvetica" font-size="12pt" padding="10mm">                                Version: <xsl:value-of select="bookinfo/releaseinfo"/>                              </fo:block>                        </fo:table-cell>                    </fo:table-row>                </fo:table-body>            </fo:table>        </fo:block>    </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><!--###################################################                      Custom Footer    ################################################### -->         <!-- This footer prints the Hibernate version number on the left side -->    <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:choose>                <xsl:when test="//releaseinfo">                        <xsl:text>Hibernate </xsl:text><xsl:value-of select="//releaseinfo"/>                </xsl:when>                <xsl:otherwise>                    <!-- nop -->                </xsl:otherwise>            </xsl:choose>        </xsl:variable>        <xsl:choose>            <xsl:when test="$sequence='blank'">            <xsl:choose>                <xsl:when test="$double.sided != 0 and $position = 'left'">                <xsl:value-of select="$Version"/>                </xsl:when>                <xsl:when test="$double.sided = 0 and $position = 'center'">                <!-- nop -->                </xsl:when>                <xsl:otherwise>                <fo:page-number/>                </xsl:otherwise>            </xsl:choose>            </xsl:when>            <xsl:when test="$pageclass='titlepage'">            <!-- nop: other titlepage sequences have no footer -->            </xsl:when>            <xsl:when test="$double.sided != 0 and $sequence = 'even' and $position='left'">            <fo:page-number/>            </xsl:when>            <xsl:when test="$double.sided != 0 and $sequence = 'odd' and $position='right'">            <fo:page-number/>            </xsl:when>            <xsl:when test="$double.sided = 0 and $position='right'">            <fo:page-number/>            </xsl:when>            <xsl:when test="$double.sided != 0 and $sequence = 'odd' and $position='left'">            <xsl:value-of select="$Version"/>            </xsl:when>            <xsl:when test="$double.sided != 0 and $sequence = 'even' and $position='right'">            <xsl:value-of select="$Version"/>            </xsl:when>            <xsl:when test="$double.sided = 0 and $position='left'">            <xsl:value-of select="$Version"/>            </xsl:when>            <xsl:otherwise>            <!-- nop -->            </xsl:otherwise>        </xsl:choose>    </xsl:template>        <!--###################################################                   Custom Toc Line    ################################################### -->        <!-- The default DocBook XSL TOC printing is seriously broken... -->    <xsl:template name="toc.line">        <xsl:variable name="id">            <xsl:call-template name="object.id"/>        </xsl:variable>        <xsl:variable name="label">            <xsl:apply-templates select="." mode="label.markup"/>        </xsl:variable>        <!-- justify-end removed from block attributes (space problem in title.markup) -->        <fo:block  end-indent="{$toc.indent.width}pt"                   last-line-end-indent="-{$toc.indent.width}pt"                   white-space-treatment="preserve"                   white-space-collapse="false">            <fo:inline keep-with-next.within-line="always">                <!-- print Chapters in bold style -->                <xsl:choose>                    <xsl:when test="local-name(.) = 'chapter'">                        <xsl:attribute name="font-weight">bold</xsl:attribute>                    </xsl:when>                </xsl:choose>                        <fo:basic-link internal-destination="{$id}">                    <xsl:if test="$label != ''">                        <xsl:copy-of select="$label"/>                        <fo:inline white-space-treatment="preserve"                                    white-space-collapse="false">                            <xsl:value-of select="$autotoc.label.separator"/>                        </fo:inline>                    </xsl:if>                    <xsl:apply-templates select="." mode="title.markup"/>                </fo:basic-link>            </fo:inline>            <fo:inline keep-together.within-line="always">            <xsl:text> </xsl:text>            <fo:leader leader-pattern="dots"                        leader-pattern-width="3pt"                        leader-alignment="reference-area"                        keep-with-next.within-line="always"/>            <xsl:text> </xsl:text>            <fo:basic-link internal-destination="{$id}">                <fo:page-number-citation ref-id="{$id}"/>            </fo:basic-link>            </fo:inline>        </fo:block>    </xsl:template>    <!--###################################################                      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>    <!-- FOP provide only PDF Bookmarks at the moment -->    <xsl:param name="fop.extensions">1</xsl:param><!--###################################################                      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">3</xsl:param>        <!-- Dot and Whitespace as separator in TOC between Label and Title-->

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -