]> git.evergreen-ils.org Git - working/Evergreen.git/blob - stylesheets/styleguide/docbook-xsl-1.75.2/xhtml/block.xsl
stylesheet changes.
[working/Evergreen.git] / stylesheets / styleguide / docbook-xsl-1.75.2 / xhtml / block.xsl
1 <?xml version="1.0" encoding="ASCII"?>
2 <!--This file was created automatically by html2xhtml-->
3 <!--from the HTML stylesheets.-->
4 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml" version="1.0">
5
6 <!-- ********************************************************************
7      $Id: block.xsl 8441 2009-05-24 02:14:56Z abdelazer $
8      ********************************************************************
9
10      This file is part of the XSL DocBook Stylesheet distribution.
11      See ../README or http://docbook.sf.net/release/xsl/current/ for
12      copyright and other information.
13
14      ******************************************************************** -->
15
16 <!-- ==================================================================== -->
17 <!-- What should we do about styling blockinfo? -->
18
19 <xsl:template match="blockinfo|info">
20   <!-- suppress -->
21 </xsl:template>
22
23 <!-- ==================================================================== -->
24
25 <xsl:template name="block.object">
26   <div>
27     <xsl:call-template name="common.html.attributes"/>
28     <xsl:call-template name="anchor"/>
29     <xsl:apply-templates/>
30   </div>
31 </xsl:template>
32
33 <!-- ==================================================================== -->
34
35 <xsl:template match="para">
36   <xsl:call-template name="paragraph">
37     <xsl:with-param name="class">
38       <xsl:if test="@role and $para.propagates.style != 0">
39         <xsl:value-of select="@role"/>
40       </xsl:if>
41     </xsl:with-param>
42     <xsl:with-param name="content">
43       <xsl:if test="position() = 1 and parent::listitem">
44         <xsl:call-template name="anchor">
45           <xsl:with-param name="node" select="parent::listitem"/>
46         </xsl:call-template>
47       </xsl:if>
48
49       <xsl:call-template name="anchor"/>
50       <xsl:apply-templates/>
51     </xsl:with-param>
52   </xsl:call-template>
53 </xsl:template>
54
55 <xsl:template name="paragraph">
56   <xsl:param name="class" select="''"/>
57   <xsl:param name="content"/>
58
59   <xsl:variable name="p">
60     <p>
61       <xsl:choose>
62         <xsl:when test="$class != ''">
63           <xsl:call-template name="common.html.attributes">
64             <xsl:with-param name="class" select="$class"/>
65           </xsl:call-template>
66         </xsl:when>
67         <xsl:otherwise>
68           <xsl:call-template name="locale.html.attributes"/>
69         </xsl:otherwise>
70       </xsl:choose>
71       <xsl:copy-of select="$content"/>
72     </p>
73   </xsl:variable>
74
75   <xsl:choose>
76     <xsl:when test="$html.cleanup != 0">
77       <xsl:call-template name="unwrap.p">
78         <xsl:with-param name="p" select="$p"/>
79       </xsl:call-template>
80     </xsl:when>
81     <xsl:otherwise>
82       <xsl:copy-of select="$p"/>
83     </xsl:otherwise>
84   </xsl:choose>
85 </xsl:template>
86
87 <xsl:template match="simpara">
88   <!-- see also listitem/simpara in lists.xsl -->
89   <p>
90     <xsl:call-template name="locale.html.attributes"/>
91     <xsl:if test="@role and $para.propagates.style != 0">
92       <xsl:apply-templates select="." mode="class.attribute">
93         <xsl:with-param name="class" select="@role"/>
94       </xsl:apply-templates>
95     </xsl:if>
96
97     <xsl:call-template name="anchor"/>
98     <xsl:apply-templates/>
99   </p>
100 </xsl:template>
101
102 <xsl:template match="formalpara">
103   <xsl:call-template name="paragraph">
104     <xsl:with-param name="class">
105       <xsl:if test="@role and $para.propagates.style != 0">
106         <xsl:value-of select="@role"/>
107       </xsl:if>
108     </xsl:with-param>
109     <xsl:with-param name="content">
110       <xsl:call-template name="anchor"/>
111       <xsl:apply-templates/>
112     </xsl:with-param>
113   </xsl:call-template>
114 </xsl:template>
115
116 <!-- Only use title from info -->
117 <xsl:template match="formalpara/info">
118   <xsl:apply-templates select="title"/>
119 </xsl:template>
120
121 <xsl:template match="formalpara/title|formalpara/info/title">
122   <xsl:variable name="titleStr">
123       <xsl:apply-templates/>
124   </xsl:variable>
125   <xsl:variable name="lastChar">
126     <xsl:if test="$titleStr != ''">
127       <xsl:value-of select="substring($titleStr,string-length($titleStr),1)"/>
128     </xsl:if>
129   </xsl:variable>
130
131   <b>
132     <xsl:copy-of select="$titleStr"/>
133     <xsl:if test="$lastChar != ''                   and not(contains($runinhead.title.end.punct, $lastChar))">
134       <xsl:value-of select="$runinhead.default.title.end.punct"/>
135     </xsl:if>
136     <xsl:text>&#160;</xsl:text>
137   </b>
138 </xsl:template>
139
140 <xsl:template match="formalpara/para">
141   <xsl:apply-templates/>
142 </xsl:template>
143
144 <!-- ==================================================================== -->
145
146 <xsl:template match="blockquote">
147   <div>
148     <xsl:call-template name="common.html.attributes"/>
149     <xsl:call-template name="anchor"/>
150
151     <xsl:choose>
152       <xsl:when test="attribution">
153         <table border="0" width="100%" cellspacing="0" cellpadding="0" class="blockquote" summary="Block quote">
154           <tr>
155             <td width="10%" valign="top">&#160;</td>
156             <td width="80%" valign="top">
157               <xsl:apply-templates select="child::*[local-name(.)!='attribution']"/>
158             </td>
159             <td width="10%" valign="top">&#160;</td>
160           </tr>
161           <tr>
162             <td width="10%" valign="top">&#160;</td>
163             <td colspan="2" align="{$direction.align.end}" valign="top">
164               <xsl:text>--</xsl:text>
165               <xsl:apply-templates select="attribution"/>
166             </td>
167           </tr>
168         </table>
169       </xsl:when>
170       <xsl:otherwise>
171         <blockquote>
172           <xsl:call-template name="common.html.attributes"/>
173           <xsl:apply-templates/>
174         </blockquote>
175       </xsl:otherwise>
176     </xsl:choose>
177   </div>
178 </xsl:template>
179
180 <xsl:template match="blockquote/title|blockquote/info/title">
181   <div class="blockquote-title">
182     <p>
183       <b>
184         <xsl:apply-templates/>
185       </b>
186     </p>
187   </div>
188 </xsl:template>
189
190 <!-- Use an em dash per Chicago Manual of Style and https://sourceforge.net/tracker/index.php?func=detail&aid=2793878&group_id=21935&atid=373747 -->
191 <xsl:template match="epigraph">
192   <div>
193     <xsl:call-template name="common.html.attributes"/>
194       <xsl:apply-templates select="para|simpara|formalpara|literallayout"/>
195       <xsl:if test="attribution">
196         <div class="attribution">
197           <span>&#8212;<xsl:apply-templates select="attribution"/></span>
198         </div>
199       </xsl:if>
200   </div>
201 </xsl:template>
202
203 <xsl:template match="attribution">
204   <span>
205     <xsl:call-template name="common.html.attributes"/>
206     <xsl:apply-templates/>
207   </span>
208 </xsl:template>
209
210 <!-- ==================================================================== -->
211
212 <xsl:template match="abstract|sidebar">
213   <div>
214     <xsl:call-template name="common.html.attributes"/>
215     <xsl:call-template name="anchor"/>
216     <xsl:call-template name="formal.object.heading">
217       <xsl:with-param name="title">
218         <xsl:apply-templates select="." mode="title.markup">
219           <xsl:with-param name="allow-anchors" select="'1'"/>
220         </xsl:apply-templates>
221       </xsl:with-param>
222     </xsl:call-template>
223     <xsl:apply-templates/>
224   </div>
225 </xsl:template>
226
227 <xsl:template match="abstract/title|sidebar/title">
228 </xsl:template>
229
230 <xsl:template match="sidebar/sidebarinfo|sidebar/info"/>
231
232 <!-- ==================================================================== -->
233
234 <xsl:template match="msgset">
235   <xsl:apply-templates/>
236 </xsl:template>
237
238 <xsl:template match="msgentry">
239   <xsl:call-template name="block.object"/>
240 </xsl:template>
241
242 <xsl:template match="simplemsgentry">
243   <xsl:call-template name="block.object"/>
244 </xsl:template>
245
246 <xsl:template match="msg">
247   <xsl:call-template name="block.object"/>
248 </xsl:template>
249
250 <xsl:template match="msgmain">
251   <xsl:apply-templates/>
252 </xsl:template>
253
254 <xsl:template match="msgmain/title">
255   <b><xsl:apply-templates/></b>
256 </xsl:template>
257
258 <xsl:template match="msgsub">
259   <xsl:apply-templates/>
260 </xsl:template>
261
262 <xsl:template match="msgsub/title">
263   <b><xsl:apply-templates/></b>
264 </xsl:template>
265
266 <xsl:template match="msgrel">
267   <xsl:apply-templates/>
268 </xsl:template>
269
270 <xsl:template match="msgrel/title">
271   <b><xsl:apply-templates/></b>
272 </xsl:template>
273
274 <xsl:template match="msgtext">
275   <xsl:apply-templates/>
276 </xsl:template>
277
278 <xsl:template match="msginfo">
279   <xsl:call-template name="block.object"/>
280 </xsl:template>
281
282 <xsl:template match="msglevel">
283   <p>
284     <b>
285       <xsl:call-template name="gentext.template">
286         <xsl:with-param name="context" select="'msgset'"/>
287         <xsl:with-param name="name" select="'MsgLevel'"/>
288       </xsl:call-template>
289     </b>
290     <xsl:apply-templates/>
291   </p>
292 </xsl:template>
293
294 <xsl:template match="msgorig">
295   <p>
296     <b>
297       <xsl:call-template name="gentext.template">
298         <xsl:with-param name="context" select="'msgset'"/>
299         <xsl:with-param name="name" select="'MsgOrig'"/>
300       </xsl:call-template>
301     </b>
302     <xsl:apply-templates/>
303   </p>
304 </xsl:template>
305
306 <xsl:template match="msgaud">
307   <p>
308     <b>
309       <xsl:call-template name="gentext.template">
310         <xsl:with-param name="context" select="'msgset'"/>
311         <xsl:with-param name="name" select="'MsgAud'"/>
312       </xsl:call-template>
313     </b>
314     <xsl:apply-templates/>
315   </p>
316 </xsl:template>
317
318 <xsl:template match="msgexplan">
319   <xsl:call-template name="block.object"/>
320 </xsl:template>
321
322 <xsl:template match="msgexplan/title">
323   <p><b><xsl:apply-templates/></b></p>
324 </xsl:template>
325
326 <!-- ==================================================================== -->
327
328 <xsl:template match="revhistory">
329   <div>
330     <xsl:call-template name="common.html.attributes"/>
331     <table border="0" width="100%" summary="Revision history">
332       <tr>
333         <th align="{$direction.align.start}" valign="top" colspan="3">
334           <b>
335             <xsl:call-template name="gentext">
336               <xsl:with-param name="key" select="'RevHistory'"/>
337             </xsl:call-template>
338           </b>
339         </th>
340       </tr>
341       <xsl:apply-templates/>
342     </table>
343   </div>
344 </xsl:template>
345
346 <xsl:template match="revhistory/revision">
347   <xsl:variable name="revnumber" select="revnumber"/>
348   <xsl:variable name="revdate" select="date"/>
349   <xsl:variable name="revauthor" select="authorinitials|author"/>
350   <xsl:variable name="revremark" select="revremark|revdescription"/>
351   <tr>
352     <td align="{$direction.align.start}">
353       <xsl:if test="$revnumber">
354         <xsl:call-template name="gentext">
355           <xsl:with-param name="key" select="'Revision'"/>
356         </xsl:call-template>
357         <xsl:call-template name="gentext.space"/>
358         <xsl:apply-templates select="$revnumber"/>
359       </xsl:if>
360     </td>
361     <td align="{$direction.align.start}">
362       <xsl:apply-templates select="$revdate"/>
363     </td>
364     <xsl:choose>
365       <xsl:when test="count($revauthor)=0">
366         <td align="{$direction.align.start}">
367           <xsl:call-template name="dingbat">
368             <xsl:with-param name="dingbat">nbsp</xsl:with-param>
369           </xsl:call-template>
370         </td>
371       </xsl:when>
372       <xsl:otherwise>
373         <td align="{$direction.align.start}">
374           <xsl:for-each select="$revauthor">
375             <xsl:apply-templates select="."/>
376             <xsl:if test="position() != last()">
377               <xsl:text>, </xsl:text>
378             </xsl:if>
379           </xsl:for-each>
380         </td>
381       </xsl:otherwise>
382     </xsl:choose>
383   </tr>
384   <xsl:if test="$revremark">
385     <tr>
386       <td align="{$direction.align.start}" colspan="3">
387         <xsl:apply-templates select="$revremark"/>
388       </td>
389     </tr>
390   </xsl:if>
391 </xsl:template>
392
393 <xsl:template match="revision/revnumber">
394   <xsl:apply-templates/>
395 </xsl:template>
396
397 <xsl:template match="revision/date">
398   <xsl:apply-templates/>
399 </xsl:template>
400
401 <xsl:template match="revision/authorinitials">
402   <xsl:text>, </xsl:text>
403   <xsl:apply-templates/>
404 </xsl:template>
405
406 <xsl:template match="revision/authorinitials[1]" priority="2">
407   <xsl:apply-templates/>
408 </xsl:template>
409
410 <xsl:template match="revision/revremark">
411   <xsl:apply-templates/>
412 </xsl:template>
413
414 <xsl:template match="revision/revdescription">
415   <xsl:apply-templates/>
416 </xsl:template>
417
418 <!-- ==================================================================== -->
419
420 <xsl:template match="ackno|acknowledgements[parent::article]">
421   <p>
422     <xsl:call-template name="common.html.attributes"/>
423     <xsl:apply-templates/>
424   </p>
425 </xsl:template>
426
427 <!-- ==================================================================== -->
428
429 <xsl:template match="highlights">
430   <xsl:call-template name="block.object"/>
431 </xsl:template>
432
433 <!-- ==================================================================== -->
434
435 </xsl:stylesheet>