2 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
3 xmlns:fox="http://xmlgraphics.apache.org/fop/extensions"
4 xmlns:fo="http://www.w3.org/1999/XSL/Format"
7 <!-- ********************************************************************
8 $Id: fop1.xsl 8913 2010-10-01 04:44:57Z bobstayton $
9 ********************************************************************
11 This file is part of the XSL DocBook Stylesheet distribution.
12 See ../README or http://docbook.sf.net/release/xsl/current/ for
13 copyright and other information.
15 ******************************************************************** -->
17 <!-- ==================================================================== -->
19 <xsl:variable name="bookmarks.state">
21 <xsl:when test="$bookmarks.collapse != 0">hide</xsl:when>
22 <xsl:otherwise>show</xsl:otherwise>
26 <xsl:template match="*" mode="fop1.outline">
27 <xsl:apply-templates select="*" mode="fop1.outline"/>
30 <xsl:template match="set|book|part|reference|
31 preface|chapter|appendix|article
32 |glossary|bibliography|index|setindex
34 |sect1|sect2|sect3|sect4|sect5|section"
37 <xsl:variable name="id">
38 <xsl:call-template name="object.id"/>
40 <xsl:variable name="bookmark-label">
41 <xsl:apply-templates select="." mode="object.title.markup"/>
44 <!-- Put the root element bookmark at the same level as its children -->
45 <!-- If the object is a set or book, generate a bookmark for the toc -->
48 <xsl:when test="self::index and $generate.index = 0"/>
49 <xsl:when test="parent::*">
50 <fo:bookmark internal-destination="{$id}">
51 <xsl:attribute name="starting-state">
52 <xsl:value-of select="$bookmarks.state"/>
55 <xsl:value-of select="normalize-space(translate($bookmark-label, $a-dia, $a-asc))"/>
57 <xsl:apply-templates select="*" mode="fop1.outline"/>
61 <fo:bookmark internal-destination="{$id}">
62 <xsl:attribute name="starting-state">
63 <xsl:value-of select="$bookmarks.state"/>
66 <xsl:value-of select="normalize-space(translate($bookmark-label, $a-dia, $a-asc))"/>
70 <xsl:variable name="toc.params">
71 <xsl:call-template name="find.path.params">
72 <xsl:with-param name="table" select="normalize-space($generate.toc)"/>
76 <xsl:if test="contains($toc.params, 'toc')
77 and (book|part|reference|preface|chapter|appendix|article
78 |glossary|bibliography|index|setindex
80 |sect1|sect2|sect3|sect4|sect5|section)">
81 <fo:bookmark internal-destination="toc...{$id}">
83 <xsl:call-template name="gentext">
84 <xsl:with-param name="key" select="'TableofContents'"/>
89 <xsl:apply-templates select="*" mode="fop1.outline"/>
93 <fo:bookmark internal-destination="{$id}"/>
97 <xsl:template match="*" mode="fop1.foxdest">
98 <xsl:apply-templates select="*" mode="fop1.foxdest"/>
101 <xsl:template match="set|book|part|reference|
102 preface|chapter|appendix|article
103 |glossary|bibliography|index|setindex
105 |sect1|sect2|sect3|sect4|sect5|section"
107 <xsl:variable name="id">
108 <xsl:call-template name="object.id"/>
110 <xsl:variable name="bookmark-label">
111 <xsl:apply-templates select="." mode="object.title.markup"/>
113 <!--xsl:if test="$id != ''">
114 <fox:destination internal-destination="{$id}"/>
117 <!-- Put the root element bookmark at the same level as its children -->
118 <!-- If the object is a set or book, generate a bookmark for the toc -->
121 <xsl:when test="self::index and $generate.index = 0"/>
122 <xsl:when test="parent::*">
123 <fox:destination internal-destination="{$id}"/>
124 <xsl:apply-templates select="*" mode="fop1.foxdest"/>
127 <fox:destination internal-destination="{$id}"/>
128 <xsl:apply-templates select="*" mode="fop1.foxdest"/>
132 <!-- Metadata support ("Document Properties" in Adobe Reader) -->
133 <xsl:template name="fop1-document-information">
134 <xsl:variable name="authors" select="(//author|//editor|//corpauthor|//authorgroup)[1]"/>
136 <xsl:variable name="title">
137 <xsl:apply-templates select="/*[1]" mode="label.markup"/>
138 <xsl:apply-templates select="/*[1]" mode="title.markup"/>
139 <xsl:variable name="subtitle">
140 <xsl:apply-templates select="/*[1]" mode="subtitle.markup"/>
142 <xsl:if test="$subtitle !=''">
143 <xsl:text> - </xsl:text>
144 <xsl:value-of select="$subtitle"/>
149 <x:xmpmeta xmlns:x="adobe:ns:meta/">
150 <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
151 <rdf:Description rdf:about="" xmlns:dc="http://purl.org/dc/elements/1.1/">
152 <!-- Dublin Core properties go here -->
155 <dc:title><xsl:value-of select="normalize-space($title)"/></dc:title>
158 <xsl:if test="$authors">
159 <xsl:variable name="author">
161 <xsl:when test="$authors[self::authorgroup]">
162 <xsl:call-template name="person.name.list">
163 <xsl:with-param name="person.list"
164 select="$authors/*[self::author|self::corpauthor|
165 self::othercredit|self::editor]"/>
168 <xsl:when test="$authors[self::corpauthor]">
169 <xsl:value-of select="$authors"/>
172 <xsl:call-template name="person.name">
173 <xsl:with-param name="node" select="$authors"/>
179 <dc:creator><xsl:value-of select="normalize-space($author)"/></dc:creator>
183 <xsl:if test="//subjectterm">
185 <xsl:for-each select="//subjectterm">
186 <xsl:value-of select="normalize-space(.)"/>
187 <xsl:if test="position() != last()">
188 <xsl:text>, </xsl:text>
195 <rdf:Description rdf:about="" xmlns:pdf="http://ns.adobe.com/pdf/1.3/">
196 <!-- PDF properties go here -->
199 <xsl:if test="//keyword">
201 <xsl:for-each select="//keyword">
202 <xsl:value-of select="normalize-space(.)"/>
203 <xsl:if test="position() != last()">
204 <xsl:text>, </xsl:text>
211 <rdf:Description rdf:about="" xmlns:xmp="http://ns.adobe.com/xap/1.0/">
212 <!-- XMP properties go here -->
214 <!-- Creator Tool -->
215 <xmp:CreatorTool>DocBook XSL Stylesheets with Apache FOP</xmp:CreatorTool>