Add discussion point for XIM/UTF-8 locales.
[fvwm.git] / doc / docbook-xsl / manpages / info.xsl
blobd8c6498c04b0995f4b0e07e983be9d710671ddde
1 <?xml version='1.0'?>
2 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
3 xmlns:date="http://exslt.org/dates-and-times"
4 xmlns:exsl="http://exslt.org/common"
5 exclude-result-prefixes="date exsl"
6 version='1.0'>
8 <!-- ********************************************************************
9 $Id: info.xsl,v 1.1 2007/03/10 05:15:34 scott Exp $
10 ********************************************************************
12 This file is part of the XSL DocBook Stylesheet distribution.
13 See ../README or http://docbook.sf.net/release/xsl/current/ for
14 copyright and other information.
16 ******************************************************************** -->
18 <xsl:variable name="blurb-indent">
19 <xsl:choose>
20 <xsl:when test="not($man.indent.blurbs = 0)">
21 <xsl:value-of select="$man.indent.width"/>
22 </xsl:when>
23 <xsl:when test="not($man.indent.refsect = 0)">
24 <!-- * "zq" is the name of a register we set for -->
25 <!-- * preserving the original default indent value -->
26 <!-- * when $man.indent.refsect is non-zero; -->
27 <!-- * "u" is a roff unit specifier -->
28 <xsl:text>\n(zqu</xsl:text>
29 </xsl:when>
30 <xsl:otherwise/> <!-- * otherwise, just leave it empty -->
31 </xsl:choose>
32 </xsl:variable>
34 <!-- ================================================================== -->
35 <!-- * About the $info param used in this stylesheet -->
36 <!-- * -->
37 <!-- * The $info param is a "master info" node set that contains -->
38 <!-- * the entires contents of the *info child of the current -->
39 <!-- * Refentry, plus the entire contents of the *info children of -->
40 <!-- * all ancestors of the current Refentry, in document order. -->
41 <!-- * -->
42 <!-- * We try to find a "best match" for selecting content from -->
43 <!-- * $infor; we look through it in reverse document order until we -->
44 <!-- * can find something usable. -->
45 <!-- * -->
46 <!-- * Specifically what the basic metadata-gathering XPath expression -->
47 <!-- * in this stylesheet does is: -->
48 <!-- * -->
49 <!-- * 1. Look through the entire "master info" node set.-->
50 <!-- * 2. Get the last node in the set that contains, for -->
51 <!-- * example, an Author element. That amounts to being the -->
52 <!-- * closest *info node to the Refentry - either its *info -->
53 <!-- * child, or the *info node of its closest ancestor that -->
54 <!-- * contains an Author. -->
56 <!-- ================================================================== -->
57 <!-- * Get user "refentry metadata" preferences -->
58 <!-- ================================================================== -->
59 <!-- * The DocBook XSL stylesheets include several user-configurable -->
60 <!-- * global stylesheet parameters for controlling refentry metadata -->
61 <!-- * gathering. Those parameters are not read directly by the other -->
62 <!-- * refentry metadata-gathering templates. Instead, they are read -->
63 <!-- * only by the get.refentry.metadata.prefs template, which -->
64 <!-- * assembles them into a structure that is then passed to the -->
65 <!-- * other refentry metadata-gathering template. -->
67 <xsl:variable name="get.refentry.metadata.prefs">
68 <!-- * get.refentry.metadata.prefs is in common/refentry.xsl -->
69 <xsl:call-template name="get.refentry.metadata.prefs"/>
70 </xsl:variable>
72 <xsl:variable name="refentry.metadata.prefs"
73 select="exsl:node-set($get.refentry.metadata.prefs)"/>
75 <!-- * ============================================================== -->
76 <!-- * Get content for Author metadata field. -->
77 <!-- * ============================================================== -->
79 <!-- * The make.roff.metatada.author template and metadata.author -->
80 <!-- * mode are used only for populating the Author field in the -->
81 <!-- * metadata "top comment" we embed in roff source of each page. -->
83 <xsl:template name="make.roff.metadata.author">
84 <xsl:param name="info"/>
85 <xsl:choose>
86 <xsl:when test="$info//author">
87 <xsl:apply-templates
88 select="(($info[//author])[last()]//author)[1]"
89 mode="metadata.author"/>
90 </xsl:when>
91 <xsl:when test="$info//corpauthor">
92 <xsl:apply-templates
93 select="(($info[//corpauthor])[last()]//corpauthor)[1]"
94 mode="metadata.author"/>
95 </xsl:when>
96 <xsl:when test="$info//editor">
97 <xsl:apply-templates
98 select="(($info[//editor])[last()]//editor)[1]"
99 mode="metadata.author"/>
100 </xsl:when>
101 <xsl:when test="$info//corpcredit">
102 <xsl:apply-templates
103 select="(($info[//corpcredit])[last()]//corpcredit)[1]"
104 mode="metadata.author"/>
105 </xsl:when>
106 <xsl:when test="$info//othercredit">
107 <xsl:apply-templates
108 select="(($info[//othercredit])[last()]//othercredit)[1]"
109 mode="metadata.author"/>
110 </xsl:when>
111 <xsl:when test="$info//collab">
112 <xsl:apply-templates
113 select="(($info[//collab])[last()]//collab)[1]"
114 mode="metadata.author"/>
115 </xsl:when>
116 <xsl:when test="$info//orgname">
117 <xsl:apply-templates
118 select="(($info[//orgname])[last()]//orgname)[1]"
119 mode="metadata.author"/>
120 </xsl:when>
121 <xsl:when test="$info//publishername">
122 <xsl:apply-templates
123 select="(($info[//publishername])[last()]//publishername)[1]"
124 mode="metadata.author"/>
125 </xsl:when>
126 <xsl:otherwise/> <!-- * do nothing, no author info found -->
127 </xsl:choose>
128 </xsl:template>
130 <xsl:template match="author|editor|othercredit|collab" mode="metadata.author">
131 <xsl:choose>
132 <xsl:when test="collabname">
133 <!-- * If this node is a Collab, then it should have a -->
134 <!-- * Collabname child, so get that. -->
135 <xsl:variable name="contents">
136 <xsl:apply-templates select="collabname"/>
137 </xsl:variable>
138 <xsl:value-of select="normalize-space($contents)"/>
139 </xsl:when>
140 <xsl:otherwise>
141 <!-- * Otherwise, this node is not a Collab, but instead -->
142 <!-- * an author|editor|othercredit, which must have a name -->
143 <!-- * of some kind; so get that name -->
144 <xsl:call-template name="person.name.normalized"/>
145 </xsl:otherwise>
146 </xsl:choose>
147 <xsl:if test=".//email|address/otheraddr/ulink">
148 <xsl:text> </xsl:text>
149 <!-- * For each attribution found, use only the first e-mail -->
150 <!-- * address or ulink value found -->
151 <xsl:apply-templates select="(.//email|address/otheraddr/ulink)[1]"
152 mode="metadata.author"/>
153 </xsl:if>
154 </xsl:template>
156 <xsl:template match="email|address/otheraddr/ulink" mode="metadata.author">
157 <xsl:text>&lt;</xsl:text>
158 <xsl:choose>
159 <xsl:when test="self::email">
160 <xsl:variable name="contents">
161 <xsl:apply-templates/>
162 </xsl:variable>
163 <xsl:value-of select="normalize-space($contents)"/>
164 </xsl:when>
165 <xsl:when test="self::ulink">
166 <xsl:variable name="contents">
167 <xsl:apply-templates select="."/>
168 </xsl:variable>
169 <xsl:value-of select="normalize-space($contents)"/>
170 </xsl:when>
171 </xsl:choose>
172 <xsl:text>&gt;</xsl:text>
173 </xsl:template>
175 <xsl:template match="corpauthor|corpcredit|orgname|publishername" mode="metadata.author">
176 <xsl:variable name="contents">
177 <xsl:apply-templates/>
178 </xsl:variable>
179 <xsl:value-of select="normalize-space($contents)"/>
180 </xsl:template>
182 <!-- * ============================================================== -->
183 <!-- * Assemble the AUTHOR/AUTHORS section -->
184 <!-- * ============================================================== -->
186 <xsl:template name="author.section">
187 <xsl:param name="info"/>
188 <!-- * The $info param is a "master info" node set that contains -->
189 <!-- * the entires contents of the *info child of the current -->
190 <!-- * Refentry, plus the entire contents of the *info children of -->
191 <!-- * all ancestors of the current Refentry, in document order. -->
192 <xsl:choose>
193 <xsl:when test="$info//author|$info//editor|$info//collab|
194 $info//corpauthor|$info//corpcredit|
195 $info//othercredit|$info/orgname|
196 $info/publishername|$info/publisher">
197 <xsl:variable name="authorcount">
198 <xsl:value-of
199 select="count(
200 $info//author|$info//editor|$info//collab|
201 $info//corpauthor|$info//corpcredit|
202 $info//othercredit)">
203 </xsl:value-of>
204 </xsl:variable>
205 <xsl:text>.SH "</xsl:text>
206 <xsl:call-template name="make.authorsecttitle">
207 <xsl:with-param name="authorcount" select="$authorcount"/>
208 </xsl:call-template>
209 <!-- * Now output all the actual author, editor, etc. content -->
210 <xsl:for-each
211 select="$info//author|$info//editor|$info//collab|
212 $info//corpauthor|$info//corpcredit|
213 $info//othercredit|$info/orgname|
214 $info/publishername|$info/publisher">
215 <xsl:apply-templates select="." mode="authorsect"/>
216 </xsl:for-each>
217 </xsl:when>
218 <xsl:otherwise/> <!-- * do nothing, no author info found -->
219 </xsl:choose>
220 </xsl:template>
222 <xsl:template name="make.authorsecttitle">
223 <!-- * If we have exactly one attributable person/entity, then output -->
224 <!-- * localized gentext for 'Author'; otherwise, output 'Authors'. -->
225 <xsl:param name="authorcount"/>
226 <xsl:param name="authorsecttitle">
227 <xsl:choose>
228 <xsl:when test="$authorcount = 1">
229 <xsl:text>Author</xsl:text>
230 </xsl:when>
231 <xsl:otherwise>
232 <xsl:text>Authors</xsl:text>
233 </xsl:otherwise>
234 </xsl:choose>
235 </xsl:param>
236 <xsl:call-template name="string.upper">
237 <xsl:with-param name="string">
238 <xsl:call-template name="gentext">
239 <xsl:with-param name="key" select="$authorsecttitle"/>
240 </xsl:call-template>
241 </xsl:with-param>
242 </xsl:call-template>
243 <xsl:text>"&#10;</xsl:text>
244 </xsl:template>
246 <xsl:template match="author|editor|othercredit" mode="authorsect">
247 <xsl:variable name="person-name">
248 <xsl:call-template name="person.name.normalized"/>
249 </xsl:variable>
250 <!-- * If we have a person-name or email or ulink content, then -->
251 <!-- * output name and email or ulink content on the same line -->
252 <xsl:choose>
253 <xsl:when test="not($person-name = '') or .//email or address/otheraddr/ulink">
254 <!-- * Our mode="bold" mechanism doesn't work on text nodes; so we -->
255 <!-- * need to turn the person-name into an element node first. -->
256 <xsl:variable name="person-name-node">
257 <bold><xsl:value-of select="$person-name"/></bold>
258 </xsl:variable>
259 <xsl:text>.PP&#10;</xsl:text>
260 <!-- * Display person name in bold -->
261 <xsl:apply-templates mode="bold" select="exsl:node-set($person-name-node)"/>
262 <!-- * Display e-mail address(es) and ulink(s) on same line as name -->
263 <xsl:apply-templates select=".//email|address/otheraddr/ulink" mode="authorsect"/>
264 <xsl:text>&#10;</xsl:text>
265 </xsl:when>
266 <xsl:otherwise>
267 <xsl:text>.br&#10;</xsl:text>
268 </xsl:otherwise>
269 </xsl:choose>
270 <!-- * Display affiliation(s) on separate lines -->
271 <xsl:apply-templates select="affiliation" mode="authorsect"/>
272 <!-- * Display direct-child addresses on separate lines -->
273 <xsl:apply-templates select="address" mode="authorsect"/>
274 <!-- * Call template for handling various attribution possibilities -->
275 <xsl:call-template name="attribution"/>
276 </xsl:template>
278 <xsl:template match="collab" mode="authorsect">
279 <xsl:text>.PP&#10;</xsl:text>
280 <xsl:apply-templates mode="bold" select="collabname"/>
281 <!-- * Display e-mail address(es) and ulink(s) on same line as name -->
282 <xsl:apply-templates select=".//email|address/otheraddr/ulink" mode="authorsect"/>
283 <xsl:text>&#10;</xsl:text>
284 <!-- * Display affilition(s) on separate lines -->
285 <xsl:apply-templates select="affiliation" mode="authorsect"/>
286 </xsl:template>
288 <xsl:template match="corpauthor|corpcredit|orgname|publishername" mode="authorsect">
289 <xsl:text>.PP&#10;</xsl:text>
290 <xsl:apply-templates mode="bold" select="."/>
291 <xsl:text>&#10;</xsl:text>
292 <xsl:if test="self::publishername">
293 <!-- * Display localized "Publisher" gentext -->
294 <xsl:call-template name="publisher.attribution"/>
295 </xsl:if>
296 </xsl:template>
298 <xsl:template match="publisher" mode="authorsect">
299 <xsl:text>.PP&#10;</xsl:text>
300 <xsl:apply-templates mode="bold" select="publishername"/>
301 <!-- * Display e-mail address(es) and ulink(s) on same line as name -->
302 <xsl:apply-templates select=".//email|address/otheraddr/ulink" mode="authorsect"/>
303 <!-- * Display addresses on separate lines -->
304 <xsl:apply-templates select="address" mode="authorsect"/>
305 <!-- * Display localized "Publisher" literal -->
306 <xsl:call-template name="publisher.attribution"/>
307 </xsl:template>
309 <xsl:template name="publisher.attribution">
310 <xsl:text>&#10;</xsl:text>
311 <xsl:text>.sp -1n&#10;</xsl:text>
312 <xsl:text>.IP ""</xsl:text>
313 <xsl:if test="not($blurb-indent = '')">
314 <xsl:text> </xsl:text>
315 <xsl:value-of select="$blurb-indent"/>
316 </xsl:if>
317 <xsl:text>&#10;</xsl:text>
318 <xsl:call-template name="gentext">
319 <xsl:with-param name="key" select="'Publisher'"/>
320 </xsl:call-template>
321 <xsl:text>.&#10;</xsl:text>
322 </xsl:template>
324 <xsl:template match="email|address/otheraddr/ulink" mode="authorsect">
325 <xsl:choose>
326 <xsl:when test="preceding-sibling::*[descendant-or-self::email]
327 or preceding-sibling::address/otheraddr/ulink
328 or ancestor::address[preceding-sibling::*[descendant-or-self::email]]
329 or ancestor::address[preceding-sibling::address/otheraddr/ulink]">
330 <!-- * This is not the first instance, so do nothing. -->
331 </xsl:when>
332 <xsl:otherwise>
333 <!-- * This is first instances of an e-mail address or ulink, -->
334 <!-- * so put a space before it. -->
335 <xsl:text> </xsl:text>
336 </xsl:otherwise>
337 </xsl:choose>
338 <!-- * Note that the reason for the \& character after the opening -->
339 <!-- * angle bracket and before the closing angle bracket is to -->
340 <!-- * prevent groff from inserting a linebreak at those points and -->
341 <!-- * outputting a hyphen character where the break occurs -->
342 <xsl:text>&lt;\&amp;</xsl:text>
343 <xsl:choose>
344 <xsl:when test="self::email">
345 <xsl:variable name="contents">
346 <xsl:apply-templates/>
347 </xsl:variable>
348 <xsl:value-of select="normalize-space($contents)"/>
349 </xsl:when>
350 <xsl:when test="self::ulink">
351 <xsl:variable name="contents">
352 <xsl:apply-templates select="."/>
353 </xsl:variable>
354 <xsl:value-of select="normalize-space($contents)"/>
355 </xsl:when>
356 </xsl:choose>
357 <xsl:text>\&amp;&gt;</xsl:text>
358 <xsl:choose>
359 <xsl:when test="not(following-sibling::*[descendant-or-self::email]
360 or following-sibling::address/otheraddr/ulink
361 or ancestor::address[following-sibling::*[descendant-or-self::email]]
362 or ancestor::address[following-sibling::address/otheraddr/ulink])">
363 <!-- * This is the final instance, so do nothing. -->
364 </xsl:when>
365 <xsl:otherwise>
366 <!-- * Separate multiple e-mail addresses or ulinks with a comma -->
367 <xsl:text>, </xsl:text>
368 </xsl:otherwise>
369 </xsl:choose>
370 </xsl:template>
372 <xsl:template match="affiliation" mode="authorsect">
373 <!-- * Get the string value of the contents of this Affiliation. If the -->
374 <!-- * affiliation only contains an Address child whose only content is -->
375 <!-- * an email address or ulink, then these contents will end up empty. -->
376 <xsl:variable name="contents">
377 <xsl:apply-templates mode="authorsect"/>
378 </xsl:variable>
379 <!-- * If contents are actually empty except for an email address -->
380 <!-- * or ulink, then output nothing. -->
381 <xsl:if test="$contents != ''">
382 <xsl:text>.br&#10;</xsl:text>
383 <xsl:for-each select="shortaffil|jobtitle|orgname|orgdiv|address">
384 <!-- * only display output of nodes other than email or ulink -->
385 <xsl:apply-templates select="node()[not(self::email) and not(self::otheraddr/ulink)]"/>
386 <xsl:choose>
387 <xsl:when test="position() = last()"/> <!-- do nothing -->
388 <xsl:otherwise>
389 <!-- * only add comma if the node has a child node other than -->
390 <!-- * an email address or ulink -->
391 <xsl:if test="child::node()[not(self::email) and not(self::otheraddr/ulink)]">
392 <xsl:text>, </xsl:text>
393 </xsl:if>
394 </xsl:otherwise>
395 </xsl:choose>
396 </xsl:for-each>
397 <xsl:text>&#10;</xsl:text>
398 <xsl:choose>
399 <xsl:when test="position() = last()"/> <!-- do nothing -->
400 <xsl:otherwise>
401 <!-- * put a line break after every Affiliation instance except -->
402 <!-- * the last one in the set -->
403 <xsl:text>.br&#10;</xsl:text>
404 </xsl:otherwise>
405 </xsl:choose>
406 </xsl:if>
407 </xsl:template>
409 <xsl:template match="address" mode="authorsect">
410 <xsl:variable name="contents"
411 select="normalize-space(node()[not(self::email)
412 and not(self::otheraddr/ulink)])"/>
413 <!-- * If this contents of this Address do not contain anything except -->
414 <!-- * an email address or ulink, then output nothing. -->
415 <xsl:if test="$contents != ''">
416 <xsl:text>&#10;</xsl:text>
417 <xsl:text>.br&#10;</xsl:text>
418 <!--* Skip email and ulink descendants of Address (rendered elsewhere) -->
419 <xsl:apply-templates select="node()[not(self::email) and not(self::otheraddr/ulink)]"/>
420 </xsl:if>
421 </xsl:template>
423 <xsl:template name="attribution">
424 <!-- * Determine appropriate attribution for a particular person's role. -->
425 <xsl:choose>
426 <!-- * if we have a *blurb or contrib, just use that -->
427 <xsl:when test="contrib|personblurb|authorblurb">
428 <xsl:apply-templates select="contrib|personblurb|authorblurb" mode="authorsect"/>
429 <xsl:text>&#10;</xsl:text>
430 </xsl:when>
431 <!-- * If we have no *blurb or contrib, but this is an Author or -->
432 <!-- * Editor, then render the corresponding localized gentext -->
433 <xsl:when test="self::author">
434 <xsl:text>&#10;</xsl:text>
435 <xsl:text>.sp -1n&#10;</xsl:text>
436 <xsl:text>.IP ""</xsl:text>
437 <xsl:if test="not($blurb-indent = '')">
438 <xsl:text> </xsl:text>
439 <xsl:value-of select="$blurb-indent"/>
440 </xsl:if>
441 <xsl:text>&#10;</xsl:text>
442 <xsl:call-template name="gentext">
443 <xsl:with-param name="key" select="'Author'"/>
444 </xsl:call-template>
445 <xsl:text>.&#10;</xsl:text>
446 </xsl:when>
447 <xsl:when test="self::editor">
448 <xsl:text>&#10;</xsl:text>
449 <xsl:text>.sp -1n&#10;</xsl:text>
450 <xsl:text>.IP ""</xsl:text>
451 <xsl:if test="not($blurb-indent = '')">
452 <xsl:text> </xsl:text>
453 <xsl:value-of select="$blurb-indent"/>
454 </xsl:if>
455 <xsl:text>&#10;</xsl:text>
456 <xsl:call-template name="gentext">
457 <xsl:with-param name="key" select="'Editor'"/>
458 </xsl:call-template>
459 <xsl:text>.&#10;</xsl:text>
460 </xsl:when>
461 <!-- * If we have no *blurb or contrib, but this is an Othercredit, -->
462 <!-- * check value of Class attribute and use corresponding gentext. -->
463 <xsl:when test="self::othercredit">
464 <xsl:choose>
465 <xsl:when test="@class and @class != 'other'">
466 <xsl:text>&#10;</xsl:text>
467 <xsl:text>.sp -1n&#10;</xsl:text>
468 <xsl:text>.IP ""</xsl:text>
469 <xsl:if test="not($blurb-indent = '')">
470 <xsl:text> </xsl:text>
471 <xsl:value-of select="$blurb-indent"/>
472 </xsl:if>
473 <xsl:text>&#10;</xsl:text>
474 <xsl:call-template name="gentext">
475 <xsl:with-param name="key" select="@class"/>
476 </xsl:call-template>
477 <xsl:text>.&#10;</xsl:text>
478 </xsl:when>
479 <xsl:otherwise>
480 <!-- * We have an Othercredit, but not usable value for the Class -->
481 <!-- * attribute, so nothing to show, do nothing -->
482 </xsl:otherwise>
483 </xsl:choose>
484 </xsl:when>
485 <xsl:otherwise>
486 <!-- * We have no *blurb or contrib or anything else we can use to -->
487 <!-- * display appropriate attribution for this person, so do nothing -->
488 </xsl:otherwise>
489 </xsl:choose>
490 </xsl:template>
492 <xsl:template match="personblurb|authorblurb" mode="authorsect">
493 <xsl:call-template name="mark.up.blurb.or.contrib"/>
494 <!-- * yeah, it's possible for a *blurb to have a "title" -->
495 <xsl:apply-templates select="title"/>
496 <xsl:apply-templates select="*[not(self::title)]"/>
497 </xsl:template>
499 <xsl:template match="personblurb/title|authorblurb/title">
500 <!-- * always render period after title -->
501 <xsl:variable name="contents">
502 <xsl:apply-templates/>
503 </xsl:variable>
504 <xsl:value-of select="normalize-space($contents)"/>
505 <xsl:text>.</xsl:text>
506 <!-- * render space after Title+period if the title is followed -->
507 <!-- * by something element content -->
508 <xsl:if test="following-sibling::*[name() != '']">
509 <xsl:text> </xsl:text>
510 </xsl:if>
511 </xsl:template>
513 <xsl:template match="contrib" mode="authorsect">
514 <xsl:call-template name="mark.up.blurb.or.contrib"/>
515 <xsl:variable name="contents">
516 <xsl:apply-templates/>
517 </xsl:variable>
518 <xsl:value-of select="normalize-space($contents)"/>
519 <xsl:text>&#10;</xsl:text>
520 </xsl:template>
522 <xsl:template name="mark.up.blurb.or.contrib">
523 <xsl:choose>
524 <!-- * If this *blurb has a sibling "name" element of some kind, then -->
525 <!-- * we are already outputting the name content, and we need to -->
526 <!-- * indent the *blurb content after that. -->
527 <xsl:when
528 test="../personname|../surname|../firstname
529 |../othername|../lineage|../honorific
530 |../affiliation|../email|../address">
531 <xsl:text>&#10;</xsl:text>
532 <xsl:text>.sp -1n&#10;</xsl:text>
533 <xsl:text>.IP ""</xsl:text>
534 <xsl:if test="not($blurb-indent = '')">
535 <xsl:text> </xsl:text>
536 <xsl:value-of select="$blurb-indent"/>
537 </xsl:if>
538 </xsl:when>
539 <xsl:otherwise>
540 <!-- * otherwise, we have no "name" content, so don't indent; -->
541 <!-- * instead, decide if we need a .PP or just a .br -->
542 <xsl:choose>
543 <xsl:when test="not(preceding-sibling::*)">
544 <!-- * if this *blurb or contrib has no preceding -->
545 <!-- * siblings, then we need to start a new paragraph -->
546 <xsl:text>.PP</xsl:text>
547 </xsl:when>
548 <xsl:otherwise>
549 <!-- * otherwise, this has no preceding siblings, so -->
550 <!-- * just put a linebreak -->
551 <xsl:text>.br</xsl:text>
552 </xsl:otherwise>
553 </xsl:choose>
554 </xsl:otherwise>
555 </xsl:choose>
556 <xsl:text>&#10;</xsl:text>
557 </xsl:template>
559 <!-- * ============================================================== -->
560 <!-- * Assemble the COPYRIGHT section -->
561 <!-- * ============================================================== -->
562 <!-- * The COPYRIGHT section is output only if a copyright or -->
563 <!-- * legalnotice is found. It contains the copyright contents -->
564 <!-- * followed by the legalnotice contents. -->
565 <xsl:template name="copyright.section">
566 <xsl:param name="info"/>
567 <xsl:choose>
568 <xsl:when test="$info//copyright|$info//legalnotice">
569 <xsl:text>.SH "</xsl:text>
570 <xsl:call-template name="string.upper">
571 <xsl:with-param name="string">
572 <xsl:call-template name="gentext">
573 <xsl:with-param name="key">Copyright</xsl:with-param>
574 </xsl:call-template>
575 </xsl:with-param>
576 </xsl:call-template>
577 <xsl:text>"&#10;</xsl:text>
578 <!-- * the copyright mode="titlepage.mode" template is -->
579 <!-- * imported from the HTML stylesheets -->
580 <xsl:for-each select="(($info[//copyright])[last()]//copyright)">
581 <xsl:variable name="contents">
582 <xsl:apply-templates select="." mode="titlepage.mode"/>
583 </xsl:variable>
584 <xsl:value-of select="normalize-space($contents)"/>
585 <xsl:text>&#10;</xsl:text>
586 <xsl:text>.br&#10;</xsl:text>
587 </xsl:for-each>
588 <xsl:text>&#10;</xsl:text>
589 <xsl:for-each select="(($info[//legalnotice])[last()]//legalnotice)">
590 <xsl:apply-templates select="." mode="titlepage.mode"/>
591 <xsl:text>&#10;</xsl:text>
592 <xsl:text>.br&#10;</xsl:text>
593 </xsl:for-each>
594 </xsl:when>
595 <xsl:otherwise/> <!-- * do nothing, no copyright or legalnotice found -->
596 </xsl:choose>
597 </xsl:template>
599 <xsl:template match="legalnotice">
600 <xsl:apply-templates/>
601 </xsl:template>
603 <!-- * ============================================================== -->
605 <!-- * suppress refmeta and all *info (we grab what we need from them -->
606 <!-- * elsewhere) -->
608 <xsl:template match="refmeta"/>
610 <xsl:template match="info|refentryinfo|referenceinfo|refsynopsisdivinfo
611 |refsectioninfo|refsect1info|refsect2info|refsect3info
612 |setinfo|bookinfo|articleinfo|chapterinfo|sectioninfo
613 |sect1info|sect2info|sect3info|sect4info|sect5info
614 |partinfo|prefaceinfo|appendixinfo|docinfo"/>
616 <!-- ============================================================== -->
618 </xsl:stylesheet>