]> granicus.if.org Git - postgresql/blob - doc/src/sgml/stylesheet.xsl
Trim trailing whitespace
[postgresql] / doc / src / sgml / stylesheet.xsl
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>https://www.postgresql.org/media/css/docs.css</xsl:otherwise>
27   </xsl:choose>
28 </xsl:param>
29
30
31 <!--
32 Customization of header
33 - add Up and Home links
34 - add tool tips to links
35
36 (overrides html/chunk-common.xsl)
37 -->
38 <xsl:template name="header.navigation">
39   <xsl:param name="prev" select="/foo"/>
40   <xsl:param name="next" select="/foo"/>
41   <xsl:param name="nav.context"/>
42
43   <xsl:variable name="home" select="/*[1]"/>
44   <xsl:variable name="up" select="parent::*"/>
45
46   <xsl:variable name="row1" select="$navig.showtitles != 0"/>
47   <xsl:variable name="row2" select="count($prev) &gt; 0
48                                     or (count($up) &gt; 0
49                                         and generate-id($up) != generate-id($home)
50                                         and $navig.showtitles != 0)
51                                     or count($next) &gt; 0"/>
52
53   <xsl:if test="$suppress.navigation = '0' and $suppress.header.navigation = '0'">
54     <div class="navheader">
55       <xsl:if test="$row1 or $row2">
56         <table width="100%" summary="Navigation header">
57           <xsl:if test="$row1">
58             <tr>
59               <th colspan="5" align="center">
60                 <xsl:apply-templates select="." mode="object.title.markup"/>
61               </th>
62             </tr>
63           </xsl:if>
64
65           <xsl:if test="$row2">
66             <tr>
67               <td width="10%" align="{$direction.align.start}">
68                 <xsl:if test="count($prev)>0">
69                   <a accesskey="p">
70                     <xsl:attribute name="href">
71                       <xsl:call-template name="href.target">
72                         <xsl:with-param name="object" select="$prev"/>
73                       </xsl:call-template>
74                     </xsl:attribute>
75                     <xsl:attribute name="title">
76                       <xsl:apply-templates select="$prev" mode="object.title.markup"/>
77                     </xsl:attribute>
78                     <xsl:call-template name="navig.content">
79                       <xsl:with-param name="direction" select="'prev'"/>
80                     </xsl:call-template>
81                   </a>
82                 </xsl:if>
83                 <xsl:text>&#160;</xsl:text>
84               </td>
85               <td width="10%" align="{$direction.align.start}">
86                 <xsl:choose>
87                   <xsl:when test="count($up)&gt;0
88                                   and generate-id($up) != generate-id($home)">
89                     <a accesskey="u">
90                       <xsl:attribute name="href">
91                         <xsl:call-template name="href.target">
92                           <xsl:with-param name="object" select="$up"/>
93                         </xsl:call-template>
94                       </xsl:attribute>
95                       <xsl:attribute name="title">
96                         <xsl:apply-templates select="$up" mode="object.title.markup"/>
97                       </xsl:attribute>
98                       <xsl:call-template name="navig.content">
99                         <xsl:with-param name="direction" select="'up'"/>
100                       </xsl:call-template>
101                     </a>
102                   </xsl:when>
103                   <xsl:otherwise>&#160;</xsl:otherwise>
104                 </xsl:choose>
105               </td>
106               <th width="60%" align="center">
107                 <xsl:choose>
108                   <xsl:when test="count($up) > 0
109                                   and generate-id($up) != generate-id($home)
110                                   and $navig.showtitles != 0">
111                     <xsl:apply-templates select="$up" mode="object.title.markup"/>
112                   </xsl:when>
113                   <xsl:otherwise>&#160;</xsl:otherwise>
114                 </xsl:choose>
115               </th>
116               <td width="10%" align="{$direction.align.end}">
117                 <xsl:choose>
118                   <xsl:when test="$home != . or $nav.context = 'toc'">
119                     <a accesskey="h">
120                       <xsl:attribute name="href">
121                         <xsl:call-template name="href.target">
122                           <xsl:with-param name="object" select="$home"/>
123                         </xsl:call-template>
124                       </xsl:attribute>
125                     <xsl:attribute name="title">
126                       <xsl:apply-templates select="$home" mode="object.title.markup"/>
127                     </xsl:attribute>
128                       <xsl:call-template name="navig.content">
129                         <xsl:with-param name="direction" select="'home'"/>
130                       </xsl:call-template>
131                     </a>
132                     <xsl:if test="$chunk.tocs.and.lots != 0 and $nav.context != 'toc'">
133                       <xsl:text>&#160;|&#160;</xsl:text>
134                     </xsl:if>
135                   </xsl:when>
136                   <xsl:otherwise>&#160;</xsl:otherwise>
137                 </xsl:choose>
138               </td>
139               <td width="10%" align="{$direction.align.end}">
140                 <xsl:text>&#160;</xsl:text>
141                 <xsl:if test="count($next)>0">
142                   <a accesskey="n">
143                     <xsl:attribute name="href">
144                       <xsl:call-template name="href.target">
145                         <xsl:with-param name="object" select="$next"/>
146                       </xsl:call-template>
147                     </xsl:attribute>
148                     <xsl:attribute name="title">
149                       <xsl:apply-templates select="$next" mode="object.title.markup"/>
150                     </xsl:attribute>
151                     <xsl:call-template name="navig.content">
152                       <xsl:with-param name="direction" select="'next'"/>
153                     </xsl:call-template>
154                   </a>
155                 </xsl:if>
156               </td>
157             </tr>
158           </xsl:if>
159         </table>
160       </xsl:if>
161       <xsl:if test="$header.rule != 0">
162         <hr/>
163       </xsl:if>
164     </div>
165   </xsl:if>
166 </xsl:template>
167
168 </xsl:stylesheet>