2 <xsl:stylesheet exclude-result-prefixes="d"
3 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
4 xmlns:d="http://docbook.org/ns/docbook"
5 xmlns:fox="http://xmlgraphics.apache.org/fop/extensions"
6 xmlns:fo="http://www.w3.org/1999/XSL/Format"
9 <!-- ********************************************************************
11 This file is part of the XSL DocBook Stylesheet distribution.
12 See ../README or http://cdn.docbook.org/release/xsl/current/ for
13 copyright and other information.
15 ******************************************************************** -->
18 <!-- ==================================================================== -->
20 <xsl:template match="*" mode="fop1.outline">
21 <xsl:apply-templates select="*" mode="fop1.outline"/>
24 <xsl:template match="d:set|d:book|d:part|d:reference|
25 d:preface|d:chapter|d:appendix|d:article|d:topic
26 |d:glossary|d:bibliography|d:index|d:setindex
27 |d:refentry|d:refsynopsisdiv
28 |d:refsect1|d:refsect2|d:refsect3|d:refsection
29 |d:sect1|d:sect2|d:sect3|d:sect4|d:sect5|d:section"
32 <xsl:variable name="id">
33 <xsl:call-template name="object.id"/>
35 <xsl:variable name="bookmark-label">
36 <xsl:apply-templates select="." mode="object.title.markup"/>
39 <!-- Put the root element bookmark at the same level as its children -->
40 <!-- If the object is a set or book, generate a bookmark for the toc -->
43 <xsl:when test="self::d:index and $generate.index = 0"/>
44 <xsl:when test="parent::*">
45 <fo:bookmark internal-destination="{$id}">
46 <xsl:attribute name="starting-state">
47 <xsl:value-of select="$bookmarks.state"/>
50 <xsl:value-of select="normalize-space($bookmark-label)"/>
52 <xsl:apply-templates select="*" mode="fop1.outline"/>
56 <fo:bookmark internal-destination="{$id}">
57 <xsl:attribute name="starting-state">
58 <xsl:value-of select="$bookmarks.state"/>
61 <xsl:value-of select="normalize-space($bookmark-label)"/>
65 <xsl:variable name="toc.params">
66 <xsl:call-template name="find.path.params">
67 <xsl:with-param name="table" select="normalize-space($generate.toc)"/>
71 <xsl:if test="contains($toc.params, 'toc')
72 and (d:book|d:part|d:reference|d:preface|d:chapter|d:appendix|d:article|d:topic
73 |d:glossary|d:bibliography|d:index|d:setindex
74 |d:refentry|d:refsynopsisdiv
75 |d:refsect1|d:refsect2|d:refsect3|d:refsection
76 |d:sect1|d:sect2|d:sect3|d:sect4|d:sect5|d:section)">
77 <fo:bookmark internal-destination="toc...{$id}">
79 <xsl:call-template name="gentext">
80 <xsl:with-param name="key" select="'TableofContents'"/>
85 <xsl:apply-templates select="*" mode="fop1.outline"/>
89 <fo:bookmark internal-destination="{$id}"/>
93 <xsl:template match="*" mode="fop1.foxdest">
94 <xsl:variable name="id">
95 <xsl:value-of select="(@id|@xml:id)[1]"/>
98 <xsl:when test="self::d:index and $generate.index = 0"/>
99 <!-- ID on the footnote is not passed to the output FO -->
100 <xsl:when test="not(self::d:footnote) and $id != ''">
101 <fox:destination internal-destination="{$id}"/>
102 <xsl:apply-templates select="*" mode="fop1.foxdest"/>
105 <xsl:apply-templates select="*" mode="fop1.foxdest"/>
110 <!-- Metadata support ("Document Properties" in Adobe Reader) -->
111 <xsl:template name="fop1-document-information">
112 <xsl:variable name="authors" select="(//d:author|//d:editor|//d:corpauthor|//d:authorgroup)[1]"/>
114 <xsl:variable name="title">
115 <xsl:apply-templates select="/*[1]" mode="label.markup"/>
116 <xsl:apply-templates select="/*[1]" mode="title.markup"/>
117 <xsl:variable name="subtitle">
118 <xsl:apply-templates select="/*[1]" mode="subtitle.markup">
119 <xsl:with-param name="verbose" select="0"/>
120 </xsl:apply-templates>
122 <xsl:if test="$subtitle !=''">
123 <xsl:text> - </xsl:text>
124 <xsl:value-of select="$subtitle"/>
129 <x:xmpmeta xmlns:x="adobe:ns:meta/">
130 <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
131 <rdf:Description rdf:about="" xmlns:dc="http://purl.org/dc/elements/1.1/">
132 <!-- Dublin Core properties go here -->
135 <dc:title><xsl:value-of select="normalize-space($title)"/></dc:title>
138 <xsl:if test="$authors">
139 <xsl:variable name="author">
141 <xsl:when test="$authors[self::d:authorgroup]">
142 <xsl:call-template name="person.name.list">
143 <xsl:with-param name="person.list"
144 select="$authors/*[self::d:author|self::d:corpauthor|
145 self::d:othercredit|self::d:editor]"/>
148 <xsl:when test="$authors[self::d:corpauthor]">
149 <xsl:value-of select="$authors"/>
151 <xsl:when test="$authors[d:orgname]">
152 <xsl:value-of select="$authors/d:orgname"/>
155 <xsl:call-template name="person.name">
156 <xsl:with-param name="node" select="$authors"/>
162 <dc:creator><xsl:value-of select="normalize-space($author)"/></dc:creator>
166 <xsl:if test="//d:subjectterm">
168 <xsl:for-each select="//d:subjectterm">
169 <xsl:value-of select="normalize-space(.)"/>
170 <xsl:if test="position() != last()">
171 <xsl:text>, </xsl:text>
178 <rdf:Description rdf:about="" xmlns:pdf="http://ns.adobe.com/pdf/1.3/">
179 <!-- PDF properties go here -->
182 <xsl:if test="//d:keyword">
184 <xsl:for-each select="//d:keyword">
185 <xsl:value-of select="normalize-space(.)"/>
186 <xsl:if test="position() != last()">
187 <xsl:text>, </xsl:text>
194 <rdf:Description rdf:about="" xmlns:xmp="http://ns.adobe.com/xap/1.0/">
195 <!-- XMP properties go here -->
197 <!-- Creator Tool -->
198 <xmp:CreatorTool>DocBook XSL Stylesheets with Apache FOP</xmp:CreatorTool>