]> git.evergreen-ils.org Git - working/Evergreen.git/blob - stylesheets/evergreen_docbook_files/docbook-xsl-1.75.2/fo/fop1.xsl
Capitalized the start of a sentence in the bucket section of cataloging.
[working/Evergreen.git] / stylesheets / evergreen_docbook_files / docbook-xsl-1.75.2 / fo / fop1.xsl
1 <?xml version='1.0'?>
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"
5                 version='1.0'>
6
7 <!-- ********************************************************************
8      $Id: fop1.xsl 8418 2009-04-27 17:10:33Z bobstayton $
9      ********************************************************************
10
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.
14
15      ******************************************************************** -->
16
17 <!-- ==================================================================== -->
18
19 <xsl:variable name="bookmarks.state">
20   <xsl:choose>
21     <xsl:when test="$bookmarks.collapse != 0">hide</xsl:when>
22     <xsl:otherwise>show</xsl:otherwise>
23   </xsl:choose>
24 </xsl:variable>
25
26 <xsl:template match="*" mode="fop1.outline">
27   <xsl:apply-templates select="*" mode="fop1.outline"/>
28 </xsl:template>
29
30 <xsl:template match="set|book|part|reference|
31                      preface|chapter|appendix|article
32                      |glossary|bibliography|index|setindex
33                      |refentry
34                      |sect1|sect2|sect3|sect4|sect5|section"
35               mode="fop1.outline">
36
37   <xsl:variable name="id">
38     <xsl:call-template name="object.id"/>
39   </xsl:variable>
40   <xsl:variable name="bookmark-label">
41     <xsl:apply-templates select="." mode="object.title.markup"/>
42   </xsl:variable>
43
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 -->
46
47   <xsl:choose>
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"/>
53         </xsl:attribute>
54         <fo:bookmark-title>
55           <xsl:value-of select="normalize-space(translate($bookmark-label, $a-dia, $a-asc))"/>
56         </fo:bookmark-title>
57         <xsl:apply-templates select="*" mode="fop1.outline"/>
58       </fo:bookmark>
59     </xsl:when>
60     <xsl:otherwise>
61       <fo:bookmark internal-destination="{$id}">
62         <xsl:attribute name="starting-state">
63           <xsl:value-of select="$bookmarks.state"/>
64         </xsl:attribute>
65         <fo:bookmark-title>
66           <xsl:value-of select="normalize-space(translate($bookmark-label, $a-dia, $a-asc))"/>
67         </fo:bookmark-title>
68       </fo:bookmark>
69
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)"/>
73         </xsl:call-template>
74       </xsl:variable>
75
76       <xsl:if test="contains($toc.params, 'toc')
77                     and (book|part|reference|preface|chapter|appendix|article
78                          |glossary|bibliography|index|setindex
79                          |refentry
80                          |sect1|sect2|sect3|sect4|sect5|section)">
81         <fo:bookmark internal-destination="toc...{$id}">
82           <fo:bookmark-title>
83             <xsl:call-template name="gentext">
84               <xsl:with-param name="key" select="'TableofContents'"/>
85             </xsl:call-template>
86           </fo:bookmark-title>
87         </fo:bookmark>
88       </xsl:if>
89       <xsl:apply-templates select="*" mode="fop1.outline"/>
90     </xsl:otherwise>
91   </xsl:choose>
92 <!--
93   <fo:bookmark internal-destination="{$id}"/>
94 -->
95 </xsl:template>
96
97 <!-- Metadata support ("Document Properties" in Adobe Reader) -->
98 <xsl:template name="fop1-document-information">
99   <xsl:variable name="authors" select="(//author|//editor|//corpauthor|//authorgroup)[1]"/>
100
101   <xsl:variable name="title">
102     <xsl:apply-templates select="/*[1]" mode="label.markup"/>
103     <xsl:apply-templates select="/*[1]" mode="title.markup"/>
104     <xsl:variable name="subtitle">
105       <xsl:apply-templates select="/*[1]" mode="subtitle.markup"/>
106     </xsl:variable>
107     <xsl:if test="$subtitle !=''">
108       <xsl:text> - </xsl:text>
109       <xsl:value-of select="$subtitle"/>
110     </xsl:if>
111   </xsl:variable>
112
113   <fo:declarations>
114     <x:xmpmeta xmlns:x="adobe:ns:meta/">
115       <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
116         <rdf:Description rdf:about="" xmlns:dc="http://purl.org/dc/elements/1.1/">
117           <!-- Dublin Core properties go here -->
118
119           <!-- Title -->
120           <dc:title><xsl:value-of select="normalize-space($title)"/></dc:title>
121
122           <!-- Author -->
123           <xsl:if test="$authors">
124             <xsl:variable name="author">
125               <xsl:choose>
126                 <xsl:when test="$authors[self::authorgroup]">
127                   <xsl:call-template name="person.name.list">
128                     <xsl:with-param name="person.list" 
129                        select="$authors/*[self::author|self::corpauthor|
130                                      self::othercredit|self::editor]"/>
131                   </xsl:call-template>
132                 </xsl:when>
133                 <xsl:when test="$authors[self::corpauthor]">
134                   <xsl:value-of select="$authors"/>
135                 </xsl:when>
136                 <xsl:otherwise>
137                   <xsl:call-template name="person.name">
138                     <xsl:with-param name="node" select="$authors"/>
139                   </xsl:call-template>
140                 </xsl:otherwise>
141               </xsl:choose>
142             </xsl:variable>
143
144             <dc:creator><xsl:value-of select="normalize-space($author)"/></dc:creator>
145           </xsl:if>
146
147           <!-- Subject -->
148           <xsl:if test="//subjectterm">
149             <dc:description>
150               <xsl:for-each select="//subjectterm">
151                 <xsl:value-of select="normalize-space(.)"/>
152                 <xsl:if test="position() != last()">
153                   <xsl:text>, </xsl:text>
154                 </xsl:if>
155               </xsl:for-each>
156             </dc:description>
157           </xsl:if>
158         </rdf:Description>
159
160         <rdf:Description rdf:about="" xmlns:pdf="http://ns.adobe.com/pdf/1.3/">
161           <!-- PDF properties go here -->
162
163           <!-- Keywords -->
164           <xsl:if test="//keyword">
165             <pdf:Keywords>
166               <xsl:for-each select="//keyword">
167                 <xsl:value-of select="normalize-space(.)"/>
168                 <xsl:if test="position() != last()">
169                   <xsl:text>, </xsl:text>
170                 </xsl:if>
171               </xsl:for-each>
172             </pdf:Keywords>
173           </xsl:if>
174         </rdf:Description>
175
176         <rdf:Description rdf:about="" xmlns:xmp="http://ns.adobe.com/xap/1.0/">
177           <!-- XMP properties go here -->
178
179           <!-- Creator Tool -->
180           <xmp:CreatorTool>DocBook XSL Stylesheets with Apache FOP</xmp:CreatorTool>
181         </rdf:Description>
182
183       </rdf:RDF>
184     </x:xmpmeta>
185   </fo:declarations>
186 </xsl:template>
187
188 </xsl:stylesheet>