1 <?xml version="1.0" encoding="utf-8"?>
2 <!DOCTYPE xsl:stylesheet [
3 <!ENTITY % common.entities SYSTEM "http://docbook.sourceforge.net/release/xsl/current/common/entities.ent">
6 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
10 This file contains XSLT stylesheet customizations that are common to
11 all HTML output variants (chunked and single-page).
15 <xsl:param name="make.valid.html" select="1"></xsl:param>
16 <xsl:param name="generate.id.attributes" select="1"></xsl:param>
17 <xsl:param name="link.mailto.url">pgsql-docs@postgresql.org</xsl:param>
18 <xsl:param name="toc.max.depth">2</xsl:param>
21 <!-- Change display of some elements -->
23 <xsl:template match="command">
24 <xsl:call-template name="inline.monoseq"/>
27 <xsl:template match="confgroup" mode="bibliography.mode">
29 <xsl:call-template name="common.html.attributes"/>
30 <xsl:call-template name="id.attribute"/>
31 <xsl:apply-templates select="conftitle/text()" mode="bibliography.mode"/>
32 <xsl:text>, </xsl:text>
33 <xsl:apply-templates select="confdates/text()" mode="bibliography.mode"/>
34 <xsl:copy-of select="$biblioentry.item.separator"/>
38 <xsl:template match="isbn" mode="bibliography.mode">
40 <xsl:call-template name="common.html.attributes"/>
41 <xsl:call-template name="id.attribute"/>
42 <xsl:text>ISBN </xsl:text>
43 <xsl:apply-templates mode="bibliography.mode"/>
44 <xsl:copy-of select="$biblioentry.item.separator"/>
49 <!-- table of contents configuration -->
51 <xsl:param name="generate.toc">
71 <xsl:param name="generate.section.toc.level" select="1"></xsl:param>
73 <!-- include refentry under sect1 in tocs -->
74 <xsl:template match="sect1" mode="toc">
75 <xsl:param name="toc-context" select="."/>
76 <xsl:call-template name="subtoc">
77 <xsl:with-param name="toc-context" select="$toc-context"/>
78 <xsl:with-param name="nodes" select="sect2|refentry
79 |bridgehead[$bridgehead.in.toc != 0]"/>
84 <!-- Put index "quicklinks" (A | B | C | ...) at the top of the bookindex page. -->
86 <!-- from html/autoidx.xsl -->
88 <xsl:template name="generate-basic-index">
89 <xsl:param name="scope" select="NOTANODE"/>
91 <xsl:variable name="role">
92 <xsl:if test="$index.on.role != 0">
93 <xsl:value-of select="@role"/>
97 <xsl:variable name="type">
98 <xsl:if test="$index.on.type != 0">
99 <xsl:value-of select="@type"/>
103 <xsl:variable name="terms"
105 [count(.|key('letter',
106 translate(substring(&primary;, 1, 1),
110 and not(@class = 'endofrange')]"/>
112 <xsl:variable name="alphabetical"
113 select="$terms[contains(concat(&lowercase;, &uppercase;),
114 substring(&primary;, 1, 1))]"/>
116 <xsl:variable name="others" select="$terms[not(contains(concat(&lowercase;,
118 substring(&primary;, 1, 1)))]"/>
121 <!-- pgsql-docs: begin added stuff -->
122 <p class="indexdiv-quicklinks">
123 <a href="#indexdiv-Symbols">
124 <xsl:call-template name="gentext">
125 <xsl:with-param name="key" select="'index symbols'"/>
128 <xsl:apply-templates select="$alphabetical[count(.|key('letter',
129 translate(substring(&primary;, 1, 1),
130 &lowercase;,&uppercase;))[&scope;][1]) = 1]"
131 mode="index-div-quicklinks">
132 <xsl:with-param name="position" select="position()"/>
133 <xsl:with-param name="scope" select="$scope"/>
134 <xsl:with-param name="role" select="$role"/>
135 <xsl:with-param name="type" select="$type"/>
136 <xsl:sort select="translate(&primary;, &lowercase;, &uppercase;)"/>
137 </xsl:apply-templates>
139 <!-- pgsql-docs: end added stuff -->
141 <xsl:if test="$others">
143 <xsl:when test="normalize-space($type) != '' and
144 $others[@type = $type][count(.|key('primary', &primary;)[&scope;][1]) = 1]">
145 <!-- pgsql-docs: added id attribute here for linking to it -->
146 <div class="indexdiv" id="indexdiv-Symbols">
148 <xsl:call-template name="gentext">
149 <xsl:with-param name="key" select="'index symbols'"/>
153 <xsl:apply-templates select="$others[count(.|key('primary', &primary;)[&scope;][1]) = 1]"
154 mode="index-symbol-div">
155 <xsl:with-param name="position" select="position()"/>
156 <xsl:with-param name="scope" select="$scope"/>
157 <xsl:with-param name="role" select="$role"/>
158 <xsl:with-param name="type" select="$type"/>
159 <xsl:sort select="translate(&primary;, &lowercase;, &uppercase;)"/>
160 </xsl:apply-templates>
164 <xsl:when test="normalize-space($type) != ''">
165 <!-- Output nothing, as there isn't a match for $other using this $type -->
168 <!-- pgsql-docs: added id attribute here for linking to it -->
169 <div class="indexdiv" id="indexdiv-Symbols">
171 <xsl:call-template name="gentext">
172 <xsl:with-param name="key" select="'index symbols'"/>
176 <xsl:apply-templates select="$others[count(.|key('primary',
177 &primary;)[&scope;][1]) = 1]"
178 mode="index-symbol-div">
179 <xsl:with-param name="position" select="position()"/>
180 <xsl:with-param name="scope" select="$scope"/>
181 <xsl:with-param name="role" select="$role"/>
182 <xsl:with-param name="type" select="$type"/>
183 <xsl:sort select="translate(&primary;, &lowercase;, &uppercase;)"/>
184 </xsl:apply-templates>
191 <xsl:apply-templates select="$alphabetical[count(.|key('letter',
192 translate(substring(&primary;, 1, 1),
193 &lowercase;,&uppercase;))[&scope;][1]) = 1]"
194 mode="index-div-basic">
195 <xsl:with-param name="position" select="position()"/>
196 <xsl:with-param name="scope" select="$scope"/>
197 <xsl:with-param name="role" select="$role"/>
198 <xsl:with-param name="type" select="$type"/>
199 <xsl:sort select="translate(&primary;, &lowercase;, &uppercase;)"/>
200 </xsl:apply-templates>
204 <xsl:template match="indexterm" mode="index-div-basic">
205 <xsl:param name="scope" select="."/>
206 <xsl:param name="role" select="''"/>
207 <xsl:param name="type" select="''"/>
209 <xsl:variable name="key"
210 select="translate(substring(&primary;, 1, 1),
211 &lowercase;,&uppercase;)"/>
213 <xsl:if test="key('letter', $key)[&scope;]
214 [count(.|key('primary', &primary;)[&scope;][1]) = 1]">
215 <div class="indexdiv">
216 <!-- pgsql-docs: added id attribute here for linking to it -->
217 <xsl:attribute name="id">
218 <xsl:value-of select="concat('indexdiv-', $key)"/>
221 <xsl:if test="contains(concat(&lowercase;, &uppercase;), $key)">
223 <xsl:value-of select="translate($key, &lowercase;, &uppercase;)"/>
227 <xsl:apply-templates select="key('letter', $key)[&scope;]
228 [count(.|key('primary', &primary;)
230 mode="index-primary">
231 <xsl:with-param name="position" select="position()"/>
232 <xsl:with-param name="scope" select="$scope"/>
233 <xsl:with-param name="role" select="$role"/>
234 <xsl:with-param name="type" select="$type"/>
235 <xsl:sort select="translate(&primary;, &lowercase;, &uppercase;)"/>
236 </xsl:apply-templates>
243 <xsl:template match="indexterm" mode="index-div-quicklinks">
244 <xsl:param name="scope" select="."/>
245 <xsl:param name="role" select="''"/>
246 <xsl:param name="type" select="''"/>
248 <xsl:variable name="key"
249 select="translate(substring(&primary;, 1, 1),
250 &lowercase;,&uppercase;)"/>
252 <xsl:if test="key('letter', $key)[&scope;]
253 [count(.|key('primary', &primary;)[&scope;][1]) = 1]">
254 <xsl:if test="contains(concat(&lowercase;, &uppercase;), $key)">
257 <xsl:attribute name="href">
258 <xsl:value-of select="concat('#indexdiv-', $key)"/>
260 <xsl:value-of select="translate($key, &lowercase;, &uppercase;)"/>