1<?xml version='1.0'?>
2<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
3                version='1.0'
4                xmlns="http://www.w3.org/TR/xhtml1/transitional"
5                exclude-result-prefixes="#default">
6
7<xsl:import href="http://docbook.sourceforge.net/release/xsl/current/xhtml/chunk.xsl"/>
8<xsl:include href="stylesheet-common.xsl" />
9<xsl:include href="stylesheet-html-common.xsl" />
10<xsl:include href="stylesheet-speedup-xhtml.xsl" />
11
12
13<!-- Parameters -->
14<xsl:param name="base.dir" select="'html/'"></xsl:param>
15<xsl:param name="use.id.as.filename" select="'1'"></xsl:param>
16<xsl:param name="generate.legalnotice.link" select="1"></xsl:param>
17<xsl:param name="chunk.first.sections" select="1"/>
18<xsl:param name="chunk.quietly" select="1"></xsl:param>
19<xsl:param name="admon.style"></xsl:param>  <!-- handled by CSS stylesheet -->
20
21<xsl:param name="website.stylesheet" select="0"/>
22
23<xsl:param name="html.stylesheet">
24  <xsl:choose>
25    <xsl:when test="$website.stylesheet = 0">stylesheet.css</xsl:when>
26    <xsl:otherwise>
27      https://www.postgresql.org/media/css/docs-complete.css
28    </xsl:otherwise>
29  </xsl:choose>
30</xsl:param>
31
32
33<!-- strip directory name from image filerefs -->
34<xsl:template match="imagedata/@fileref">
35 <xsl:value-of select="substring-after(., '/')"/>
36</xsl:template>
37
38
39<!--
40Customization of header
41- add Up and Home links
42- add tool tips to links
43
44(overrides html/chunk-common.xsl)
45-->
46<xsl:template name="header.navigation">
47  <xsl:param name="prev" select="/foo"/>
48  <xsl:param name="next" select="/foo"/>
49  <xsl:param name="nav.context"/>
50
51  <xsl:variable name="home" select="/*[1]"/>
52  <xsl:variable name="up" select="parent::*"/>
53
54  <xsl:variable name="row1" select="$navig.showtitles != 0"/>
55  <xsl:variable name="row2" select="count($prev) &gt; 0
56                                    or (count($up) &gt; 0
57                                        and $navig.showtitles != 0)
58                                    or count($next) &gt; 0"/>
59
60  <xsl:if test="$suppress.navigation = '0' and $suppress.header.navigation = '0'">
61    <div class="navheader">
62      <xsl:if test="$row1 or $row2">
63        <table width="100%" summary="Navigation header">
64          <xsl:if test="$row1">
65            <tr>
66              <th colspan="5" align="center">
67                <xsl:apply-templates select="." mode="object.title.markup"/>
68              </th>
69            </tr>
70          </xsl:if>
71
72          <xsl:if test="$row2">
73            <tr>
74              <td width="10%" align="{$direction.align.start}">
75                <xsl:if test="count($prev)>0">
76                  <a accesskey="p">
77                    <xsl:attribute name="href">
78                      <xsl:call-template name="href.target">
79                        <xsl:with-param name="object" select="$prev"/>
80                      </xsl:call-template>
81                    </xsl:attribute>
82                    <xsl:attribute name="title">
83                      <xsl:apply-templates select="$prev" mode="object.title.markup"/>
84                    </xsl:attribute>
85                    <xsl:call-template name="navig.content">
86                      <xsl:with-param name="direction" select="'prev'"/>
87                    </xsl:call-template>
88                  </a>
89                </xsl:if>
90                <xsl:text>&#160;</xsl:text>
91              </td>
92              <td width="10%" align="{$direction.align.start}">
93                <xsl:choose>
94                  <xsl:when test="count($up)&gt;0">
95                    <a accesskey="u">
96                      <xsl:attribute name="href">
97                        <xsl:call-template name="href.target">
98                          <xsl:with-param name="object" select="$up"/>
99                        </xsl:call-template>
100                      </xsl:attribute>
101                      <xsl:attribute name="title">
102                        <xsl:apply-templates select="$up" mode="object.title.markup"/>
103                      </xsl:attribute>
104                      <xsl:call-template name="navig.content">
105                        <xsl:with-param name="direction" select="'up'"/>
106                      </xsl:call-template>
107                    </a>
108                  </xsl:when>
109                  <xsl:otherwise>&#160;</xsl:otherwise>
110                </xsl:choose>
111              </td>
112              <th width="60%" align="center">
113                <xsl:choose>
114                  <xsl:when test="count($up) > 0
115                                  and $navig.showtitles != 0">
116                    <xsl:apply-templates select="$up" mode="object.title.markup"/>
117                  </xsl:when>
118                  <xsl:otherwise>&#160;</xsl:otherwise>
119                </xsl:choose>
120              </th>
121              <td width="10%" align="{$direction.align.end}">
122                <xsl:choose>
123                  <xsl:when test="$home != . or $nav.context = 'toc'">
124                    <a accesskey="h">
125                      <xsl:attribute name="href">
126                        <xsl:call-template name="href.target">
127                          <xsl:with-param name="object" select="$home"/>
128                        </xsl:call-template>
129                      </xsl:attribute>
130                    <xsl:attribute name="title">
131                      <xsl:apply-templates select="$home" mode="object.title.markup"/>
132                    </xsl:attribute>
133                      <xsl:call-template name="navig.content">
134                        <xsl:with-param name="direction" select="'home'"/>
135                      </xsl:call-template>
136                    </a>
137                    <xsl:if test="$chunk.tocs.and.lots != 0 and $nav.context != 'toc'">
138                      <xsl:text>&#160;|&#160;</xsl:text>
139                    </xsl:if>
140                  </xsl:when>
141                  <xsl:otherwise>&#160;</xsl:otherwise>
142                </xsl:choose>
143              </td>
144              <td width="10%" align="{$direction.align.end}">
145                <xsl:text>&#160;</xsl:text>
146                <xsl:if test="count($next)>0">
147                  <a accesskey="n">
148                    <xsl:attribute name="href">
149                      <xsl:call-template name="href.target">
150                        <xsl:with-param name="object" select="$next"/>
151                      </xsl:call-template>
152                    </xsl:attribute>
153                    <xsl:attribute name="title">
154                      <xsl:apply-templates select="$next" mode="object.title.markup"/>
155                    </xsl:attribute>
156                    <xsl:call-template name="navig.content">
157                      <xsl:with-param name="direction" select="'next'"/>
158                    </xsl:call-template>
159                  </a>
160                </xsl:if>
161              </td>
162            </tr>
163          </xsl:if>
164        </table>
165      </xsl:if>
166      <xsl:if test="$header.rule != 0">
167        <hr/>
168      </xsl:if>
169    </div>
170  </xsl:if>
171</xsl:template>
172
173
174<!--
175Customization of footer
176- don't hide redundant Up link
177- add tool tips to links
178
179(overrides html/chunk-common.xsl)
180-->
181<xsl:template name="footer.navigation">
182  <xsl:param name="prev" select="/foo"/>
183  <xsl:param name="next" select="/foo"/>
184  <xsl:param name="nav.context"/>
185
186  <xsl:variable name="home" select="/*[1]"/>
187  <xsl:variable name="up" select="parent::*"/>
188
189  <xsl:variable name="row1" select="count($prev) &gt; 0
190                                    or count($up) &gt; 0
191                                    or count($next) &gt; 0"/>
192
193  <xsl:variable name="row2" select="($prev and $navig.showtitles != 0)
194                                    or (generate-id($home) != generate-id(.)
195                                        or $nav.context = 'toc')
196                                    or ($chunk.tocs.and.lots != 0
197                                        and $nav.context != 'toc')
198                                    or ($next and $navig.showtitles != 0)"/>
199
200  <xsl:if test="$suppress.navigation = '0' and $suppress.footer.navigation = '0'">
201    <div class="navfooter">
202      <xsl:if test="$footer.rule != 0">
203        <hr/>
204      </xsl:if>
205
206      <xsl:if test="$row1 or $row2">
207        <table width="100%" summary="Navigation footer">
208          <xsl:if test="$row1">
209            <tr>
210              <td width="40%" align="{$direction.align.start}">
211                <xsl:if test="count($prev)>0">
212                  <a accesskey="p">
213                    <xsl:attribute name="href">
214                      <xsl:call-template name="href.target">
215                        <xsl:with-param name="object" select="$prev"/>
216                      </xsl:call-template>
217                    </xsl:attribute>
218                    <xsl:attribute name="title">
219                      <xsl:apply-templates select="$prev" mode="object.title.markup"/>
220                    </xsl:attribute>
221                    <xsl:call-template name="navig.content">
222                      <xsl:with-param name="direction" select="'prev'"/>
223                    </xsl:call-template>
224                  </a>
225                </xsl:if>
226                <xsl:text>&#160;</xsl:text>
227              </td>
228              <td width="20%" align="center">
229                <xsl:choose>
230                  <xsl:when test="count($up)&gt;0">
231                    <a accesskey="u">
232                      <xsl:attribute name="href">
233                        <xsl:call-template name="href.target">
234                          <xsl:with-param name="object" select="$up"/>
235                        </xsl:call-template>
236                      </xsl:attribute>
237                      <xsl:attribute name="title">
238                        <xsl:apply-templates select="$up" mode="object.title.markup"/>
239                      </xsl:attribute>
240                      <xsl:call-template name="navig.content">
241                        <xsl:with-param name="direction" select="'up'"/>
242                      </xsl:call-template>
243                    </a>
244                  </xsl:when>
245                  <xsl:otherwise>&#160;</xsl:otherwise>
246                </xsl:choose>
247              </td>
248              <td width="40%" align="{$direction.align.end}">
249                <xsl:text>&#160;</xsl:text>
250                <xsl:if test="count($next)>0">
251                  <a accesskey="n">
252                    <xsl:attribute name="href">
253                      <xsl:call-template name="href.target">
254                        <xsl:with-param name="object" select="$next"/>
255                      </xsl:call-template>
256                    </xsl:attribute>
257                    <xsl:attribute name="title">
258                      <xsl:apply-templates select="$next" mode="object.title.markup"/>
259                    </xsl:attribute>
260                    <xsl:call-template name="navig.content">
261                      <xsl:with-param name="direction" select="'next'"/>
262                    </xsl:call-template>
263                  </a>
264                </xsl:if>
265              </td>
266            </tr>
267          </xsl:if>
268
269          <xsl:if test="$row2">
270            <tr>
271              <td width="40%" align="{$direction.align.start}" valign="top">
272                <xsl:if test="$navig.showtitles != 0">
273                  <xsl:apply-templates select="$prev" mode="object.title.markup"/>
274                </xsl:if>
275                <xsl:text>&#160;</xsl:text>
276              </td>
277              <td width="20%" align="center">
278                <xsl:choose>
279                  <xsl:when test="$home != . or $nav.context = 'toc'">
280                    <a accesskey="h">
281                      <xsl:attribute name="href">
282                        <xsl:call-template name="href.target">
283                          <xsl:with-param name="object" select="$home"/>
284                        </xsl:call-template>
285                      </xsl:attribute>
286                      <xsl:attribute name="title">
287                        <xsl:apply-templates select="$home" mode="object.title.markup"/>
288                      </xsl:attribute>
289                      <xsl:call-template name="navig.content">
290                        <xsl:with-param name="direction" select="'home'"/>
291                      </xsl:call-template>
292                    </a>
293                    <xsl:if test="$chunk.tocs.and.lots != 0 and $nav.context != 'toc'">
294                      <xsl:text>&#160;|&#160;</xsl:text>
295                    </xsl:if>
296                  </xsl:when>
297                  <xsl:otherwise>&#160;</xsl:otherwise>
298                </xsl:choose>
299
300                <xsl:if test="$chunk.tocs.and.lots != 0 and $nav.context != 'toc'">
301                  <a accesskey="t">
302                    <xsl:attribute name="href">
303                      <xsl:value-of select="$chunked.filename.prefix"/>
304                      <xsl:apply-templates select="/*[1]"
305                                           mode="recursive-chunk-filename">
306                        <xsl:with-param name="recursive" select="true()"/>
307                      </xsl:apply-templates>
308                      <xsl:text>-toc</xsl:text>
309                      <xsl:value-of select="$html.ext"/>
310                    </xsl:attribute>
311                    <xsl:call-template name="gentext">
312                      <xsl:with-param name="key" select="'nav-toc'"/>
313                    </xsl:call-template>
314                  </a>
315                </xsl:if>
316              </td>
317              <td width="40%" align="{$direction.align.end}" valign="top">
318                <xsl:text>&#160;</xsl:text>
319                <xsl:if test="$navig.showtitles != 0">
320                  <xsl:apply-templates select="$next" mode="object.title.markup"/>
321                </xsl:if>
322              </td>
323            </tr>
324          </xsl:if>
325        </table>
326      </xsl:if>
327    </div>
328  </xsl:if>
329</xsl:template>
330
331</xsl:stylesheet>
332