]> git.stg.codes - stg.git/blob - doc/xslt/html/titlepage.xsl
Set output encoding to utf-8.
[stg.git] / doc / xslt / html / titlepage.xsl
1 <?xml version='1.0'?>
2 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
3                 version='1.0'>
4
5 <!-- ********************************************************************
6      $Id: titlepage.xsl 8816 2010-08-10 11:56:35Z mzjn $
7      ********************************************************************
8
9      This file is part of the XSL DocBook Stylesheet distribution.
10      See ../README or http://docbook.sf.net/release/xsl/current/ for
11      copyright and other information.
12
13      ******************************************************************** -->
14
15 <!-- ==================================================================== -->
16
17 <xsl:attribute-set name="book.titlepage.recto.style"/>
18 <xsl:attribute-set name="book.titlepage.verso.style"/>
19
20 <xsl:attribute-set name="article.titlepage.recto.style"/>
21 <xsl:attribute-set name="article.titlepage.verso.style"/>
22
23 <xsl:attribute-set name="set.titlepage.recto.style"/>
24 <xsl:attribute-set name="set.titlepage.verso.style"/>
25
26 <xsl:attribute-set name="part.titlepage.recto.style"/>
27 <xsl:attribute-set name="part.titlepage.verso.style"/>
28
29 <xsl:attribute-set name="partintro.titlepage.recto.style"/>
30 <xsl:attribute-set name="partintro.titlepage.verso.style"/>
31
32 <xsl:attribute-set name="reference.titlepage.recto.style"/>
33 <xsl:attribute-set name="reference.titlepage.verso.style"/>
34
35 <xsl:attribute-set name="refentry.titlepage.recto.style"/>
36 <xsl:attribute-set name="refentry.titlepage.verso.style"/>
37
38 <xsl:attribute-set name="dedication.titlepage.recto.style"/>
39 <xsl:attribute-set name="dedication.titlepage.verso.style"/>
40
41 <xsl:attribute-set name="acknowledgements.titlepage.recto.style"/>
42 <xsl:attribute-set name="acknowledgements.titlepage.verso.style"/>
43
44 <xsl:attribute-set name="preface.titlepage.recto.style"/>
45 <xsl:attribute-set name="preface.titlepage.verso.style"/>
46
47 <xsl:attribute-set name="chapter.titlepage.recto.style"/>
48 <xsl:attribute-set name="chapter.titlepage.verso.style"/>
49
50 <xsl:attribute-set name="appendix.titlepage.recto.style"/>
51 <xsl:attribute-set name="appendix.titlepage.verso.style"/>
52
53 <xsl:attribute-set name="bibliography.titlepage.recto.style"/>
54 <xsl:attribute-set name="bibliography.titlepage.verso.style"/>
55
56 <xsl:attribute-set name="glossary.titlepage.recto.style"/>
57 <xsl:attribute-set name="glossary.titlepage.verso.style"/>
58
59 <xsl:attribute-set name="index.titlepage.recto.style"/>
60 <xsl:attribute-set name="index.titlepage.verso.style"/>
61
62 <xsl:attribute-set name="setindex.titlepage.recto.style"/>
63 <xsl:attribute-set name="setindex.titlepage.verso.style"/>
64
65 <xsl:attribute-set name="sidebar.titlepage.recto.style"/>
66 <xsl:attribute-set name="sidebar.titlepage.verso.style"/>
67
68 <xsl:attribute-set name="section.titlepage.recto.style"/>
69 <xsl:attribute-set name="section.titlepage.verso.style"/>
70
71 <xsl:attribute-set name="sect1.titlepage.recto.style"
72                    use-attribute-sets="section.titlepage.recto.style"/>
73 <xsl:attribute-set name="sect1.titlepage.verso.style"
74                    use-attribute-sets="section.titlepage.verso.style"/>
75
76 <xsl:attribute-set name="sect2.titlepage.recto.style"
77                    use-attribute-sets="section.titlepage.recto.style"/>
78 <xsl:attribute-set name="sect2.titlepage.verso.style"
79                    use-attribute-sets="section.titlepage.verso.style"/>
80
81 <xsl:attribute-set name="sect3.titlepage.recto.style"
82                    use-attribute-sets="section.titlepage.recto.style"/>
83 <xsl:attribute-set name="sect3.titlepage.verso.style"
84                    use-attribute-sets="section.titlepage.verso.style"/>
85
86 <xsl:attribute-set name="sect4.titlepage.recto.style"
87                    use-attribute-sets="section.titlepage.recto.style"/>
88 <xsl:attribute-set name="sect4.titlepage.verso.style"
89                    use-attribute-sets="section.titlepage.verso.style"/>
90
91 <xsl:attribute-set name="sect5.titlepage.recto.style"
92                    use-attribute-sets="section.titlepage.recto.style"/>
93 <xsl:attribute-set name="sect5.titlepage.verso.style"
94                    use-attribute-sets="section.titlepage.verso.style"/>
95
96 <xsl:attribute-set name="simplesect.titlepage.recto.style"
97                    use-attribute-sets="section.titlepage.recto.style"/>
98 <xsl:attribute-set name="simplesect.titlepage.verso.style"
99                    use-attribute-sets="section.titlepage.verso.style"/>
100
101 <xsl:attribute-set name="table.of.contents.titlepage.recto.style"/>
102 <xsl:attribute-set name="table.of.contents.titlepage.verso.style"/>
103
104 <xsl:attribute-set name="list.of.tables.titlepage.recto.style"/>
105 <xsl:attribute-set name="list.of.tables.contents.titlepage.verso.style"/>
106
107 <xsl:attribute-set name="list.of.figures.titlepage.recto.style"/>
108 <xsl:attribute-set name="list.of.figures.contents.titlepage.verso.style"/>
109
110 <xsl:attribute-set name="list.of.equations.titlepage.recto.style"/>
111 <xsl:attribute-set name="list.of.equations.contents.titlepage.verso.style"/>
112
113 <xsl:attribute-set name="list.of.examples.titlepage.recto.style"/>
114 <xsl:attribute-set name="list.of.examples.contents.titlepage.verso.style"/>
115
116 <xsl:attribute-set name="list.of.unknowns.titlepage.recto.style"/>
117 <xsl:attribute-set name="list.of.unknowns.contents.titlepage.verso.style"/>
118
119 <!-- ==================================================================== -->
120
121 <xsl:template match="*" mode="titlepage.mode">
122   <!-- if an element isn't found in this mode, try the default mode -->
123   <xsl:apply-templates select="."/>
124 </xsl:template>
125
126 <xsl:template match="abbrev" mode="titlepage.mode">
127   <span>
128     <xsl:apply-templates select="." mode="common.html.attributes"/>
129     <xsl:apply-templates mode="titlepage.mode"/>
130     <br/>
131   </span>
132 </xsl:template>
133
134 <xsl:template match="abstract" mode="titlepage.mode">
135   <div>
136     <xsl:apply-templates select="." mode="common.html.attributes"/>
137     <xsl:call-template name="anchor"/>
138     <xsl:if test="$abstract.notitle.enabled = 0">
139       <xsl:call-template name="formal.object.heading">
140         <xsl:with-param name="title">
141           <xsl:apply-templates select="." mode="title.markup"/>
142         </xsl:with-param>
143       </xsl:call-template>
144     </xsl:if>
145     <xsl:apply-templates mode="titlepage.mode"/>
146     <xsl:call-template name="process.footnotes"/>
147   </div>
148 </xsl:template>
149
150 <xsl:template match="abstract/title" mode="titlepage.mode">
151 </xsl:template>
152
153 <xsl:template match="address" mode="titlepage.mode">
154   <xsl:param name="suppress-numbers" select="'0'"/>
155
156   <xsl:variable name="rtf">
157     <xsl:apply-templates mode="titlepage.mode"/>
158   </xsl:variable>
159
160   <xsl:choose>
161     <xsl:when test="$suppress-numbers = '0'
162                     and @linenumbering = 'numbered'
163                     and $use.extensions != '0'
164                     and $linenumbering.extension != '0'">
165       <div>
166         <xsl:apply-templates select="." mode="common.html.attributes"/>
167         <xsl:call-template name="paragraph">
168           <xsl:with-param name="content">
169             <xsl:call-template name="number.rtf.lines">
170               <xsl:with-param name="rtf" select="$rtf"/>
171             </xsl:call-template>
172           </xsl:with-param>
173         </xsl:call-template>
174       </div>
175     </xsl:when>
176
177     <xsl:otherwise>
178       <div>
179         <xsl:apply-templates select="." mode="common.html.attributes"/>
180         <xsl:call-template name="paragraph">
181           <xsl:with-param name="content">
182             <xsl:call-template name="make-verbatim">
183               <xsl:with-param name="rtf" select="$rtf"/>
184             </xsl:call-template>
185           </xsl:with-param>
186         </xsl:call-template>
187       </div>
188     </xsl:otherwise>
189   </xsl:choose>
190 </xsl:template>
191
192 <xsl:template match="affiliation" mode="titlepage.mode">
193   <div>
194     <xsl:apply-templates select="." mode="common.html.attributes"/>
195     <xsl:apply-templates mode="titlepage.mode"/>
196   </div>
197 </xsl:template>
198
199 <xsl:template match="artpagenums" mode="titlepage.mode">
200   <span>
201     <xsl:apply-templates select="." mode="common.html.attributes"/>
202     <xsl:apply-templates mode="titlepage.mode"/>
203     <br/>
204   </span>
205 </xsl:template>
206
207 <xsl:template match="author|editor" mode="titlepage.mode">
208   <xsl:call-template name="credits.div"/>
209 </xsl:template>
210
211 <xsl:template name="credits.div">
212   <div>
213     <xsl:apply-templates select="." mode="common.html.attributes"/>
214     <xsl:if test="self::editor[position()=1] and not($editedby.enabled = 0)">
215       <h4 class="editedby"><xsl:call-template name="gentext.edited.by"/></h4>
216     </xsl:if>
217     <h3>
218       <xsl:apply-templates select="." mode="common.html.attributes"/>
219       <xsl:choose>
220         <xsl:when test="orgname">
221           <xsl:apply-templates/>
222         </xsl:when>
223         <xsl:otherwise>
224           <xsl:call-template name="person.name"/>
225         </xsl:otherwise>
226       </xsl:choose>
227     </h3>
228     <xsl:if test="not($contrib.inline.enabled = 0)">
229       <xsl:apply-templates mode="titlepage.mode" select="contrib"/>
230     </xsl:if>
231     <xsl:apply-templates mode="titlepage.mode" select="affiliation"/>
232     <xsl:apply-templates mode="titlepage.mode" select="email"/>
233     <xsl:if test="not($blurb.on.titlepage.enabled = 0)">
234       <xsl:choose>
235         <xsl:when test="$contrib.inline.enabled = 0">
236           <xsl:apply-templates mode="titlepage.mode"
237                                select="contrib|authorblurb|personblurb"/>
238         </xsl:when>
239         <xsl:otherwise>
240           <xsl:apply-templates mode="titlepage.mode"
241                                select="authorblurb|personblurb"/>
242         </xsl:otherwise>
243       </xsl:choose>
244     </xsl:if>
245   </div>
246 </xsl:template>
247
248 <xsl:template match="authorblurb|personblurb" mode="titlepage.mode">
249   <div>
250     <xsl:apply-templates select="." mode="common.html.attributes"/>
251     <xsl:apply-templates mode="titlepage.mode"/>
252   </div>
253 </xsl:template>
254
255 <xsl:template match="authorgroup" mode="titlepage.mode">
256   <div>
257     <xsl:apply-templates select="." mode="common.html.attributes"/>
258     <xsl:if test="parent::refentryinfo">
259       <h2>Authors</h2>
260     </xsl:if>
261       
262     <xsl:call-template name="anchor"/>
263     <xsl:apply-templates mode="titlepage.mode"/>
264   </div>
265 </xsl:template>
266
267 <xsl:template match="authorinitials" mode="titlepage.mode">
268   <span>
269     <xsl:apply-templates select="." mode="common.html.attributes"/>
270     <xsl:apply-templates mode="titlepage.mode"/>
271     <br/>
272   </span>
273 </xsl:template>
274
275 <xsl:template match="bibliomisc" mode="titlepage.mode">
276   <xsl:apply-templates mode="titlepage.mode"/>
277 </xsl:template>
278
279 <xsl:template match="bibliomset" mode="titlepage.mode">
280   <xsl:apply-templates mode="titlepage.mode"/>
281 </xsl:template>
282
283 <xsl:template match="collab" mode="titlepage.mode">
284   <span>
285     <xsl:apply-templates select="." mode="common.html.attributes"/>
286     <xsl:apply-templates mode="titlepage.mode"/>
287     <br/>
288   </span>
289 </xsl:template>
290
291 <xsl:template match="collabname" mode="titlepage.mode">
292   <span>
293     <xsl:apply-templates select="." mode="common.html.attributes"/>
294     <xsl:apply-templates mode="titlepage.mode"/>
295   </span>
296 </xsl:template>
297
298 <xsl:template match="confgroup" mode="titlepage.mode">
299   <div>
300     <xsl:apply-templates select="." mode="common.html.attributes"/>
301     <xsl:apply-templates mode="titlepage.mode"/>
302   </div>
303 </xsl:template>
304
305 <xsl:template match="confdates" mode="titlepage.mode">
306   <span>
307     <xsl:apply-templates select="." mode="common.html.attributes"/>
308     <xsl:apply-templates mode="titlepage.mode"/>
309     <br/>
310   </span>
311 </xsl:template>
312
313 <xsl:template match="confsponsor" mode="titlepage.mode">
314   <span>
315     <xsl:apply-templates select="." mode="common.html.attributes"/>
316     <xsl:apply-templates mode="titlepage.mode"/>
317     <br/>
318   </span>
319 </xsl:template>
320
321 <xsl:template match="conftitle" mode="titlepage.mode">
322   <span>
323     <xsl:apply-templates select="." mode="common.html.attributes"/>
324     <xsl:apply-templates mode="titlepage.mode"/>
325     <br/>
326   </span>
327 </xsl:template>
328
329 <xsl:template match="confnum" mode="titlepage.mode">
330   <!-- suppress -->
331 </xsl:template>
332
333 <xsl:template match="contractnum" mode="titlepage.mode">
334   <span>
335     <xsl:apply-templates select="." mode="common.html.attributes"/>
336     <xsl:apply-templates mode="titlepage.mode"/>
337     <br/>
338   </span>
339 </xsl:template>
340
341 <xsl:template match="contractsponsor" mode="titlepage.mode">
342   <span>
343     <xsl:apply-templates select="." mode="common.html.attributes"/>
344     <xsl:apply-templates mode="titlepage.mode"/>
345     <br/>
346   </span>
347 </xsl:template>
348
349 <xsl:template match="contrib" mode="titlepage.mode">
350   <xsl:choose>
351     <xsl:when test="not($contrib.inline.enabled = 0)">
352       <span>
353         <xsl:apply-templates select="." mode="common.html.attributes"/>
354         <xsl:apply-templates mode="titlepage.mode"/>
355       </span><xsl:text>&#160;</xsl:text>
356     </xsl:when>
357     <xsl:otherwise>
358       <div>
359         <xsl:apply-templates select="." mode="common.html.attributes"/>
360         <p><xsl:apply-templates mode="titlepage.mode"/></p>
361       </div>
362     </xsl:otherwise>
363   </xsl:choose>
364 </xsl:template>
365
366 <xsl:template match="copyright" mode="titlepage.mode">
367
368   <xsl:if test="generate-id() = generate-id(//refentryinfo/copyright[1])
369       and ($stylesheet.result.type = 'html' or $stylesheet.result.type = 'xhtml')">
370     <h2>Copyright</h2>
371   </xsl:if>
372
373   <p>
374     <xsl:apply-templates select="." mode="common.html.attributes"/>
375     <xsl:call-template name="gentext">
376       <xsl:with-param name="key" select="'Copyright'"/>
377     </xsl:call-template>
378     <xsl:call-template name="gentext.space"/>
379     <xsl:call-template name="dingbat">
380       <xsl:with-param name="dingbat">copyright</xsl:with-param>
381     </xsl:call-template>
382     <xsl:call-template name="gentext.space"/>
383     <xsl:call-template name="copyright.years">
384       <xsl:with-param name="years" select="year"/>
385       <xsl:with-param name="print.ranges" select="$make.year.ranges"/>
386       <xsl:with-param name="single.year.ranges"
387                       select="$make.single.year.ranges"/>
388     </xsl:call-template>
389     <xsl:call-template name="gentext.space"/>
390     <xsl:apply-templates select="holder" mode="titlepage.mode"/>
391   </p>
392 </xsl:template>
393
394 <xsl:template match="year" mode="titlepage.mode">
395   <xsl:choose>
396     <xsl:when test="$show.revisionflag != 0 and @revisionflag">
397       <span class="{@revisionflag}">
398         <xsl:apply-templates mode="titlepage.mode"/>
399       </span>
400     </xsl:when>
401     <xsl:otherwise>
402       <xsl:apply-templates mode="titlepage.mode"/>
403     </xsl:otherwise>
404   </xsl:choose>
405 </xsl:template>
406
407 <xsl:template match="holder" mode="titlepage.mode">
408   <xsl:choose>
409     <xsl:when test="$show.revisionflag != 0 and @revisionflag">
410       <span class="{@revisionflag}">
411         <xsl:apply-templates mode="titlepage.mode"/>
412       </span>
413     </xsl:when>
414     <xsl:otherwise>
415       <xsl:apply-templates mode="titlepage.mode"/>
416     </xsl:otherwise>
417   </xsl:choose>
418   <xsl:if test="position() &lt; last()">
419     <xsl:text>, </xsl:text>
420   </xsl:if>
421 </xsl:template>
422
423 <xsl:template match="corpauthor" mode="titlepage.mode">
424   <h3>
425     <xsl:apply-templates select="." mode="common.html.attributes"/>
426     <xsl:apply-templates mode="titlepage.mode"/>
427   </h3>
428 </xsl:template>
429
430 <xsl:template match="corpcredit" mode="titlepage.mode">
431   <span>
432     <xsl:apply-templates select="." mode="common.html.attributes"/>
433     <xsl:apply-templates mode="titlepage.mode"/>
434     <br/>
435   </span>
436 </xsl:template>
437
438 <xsl:template match="corpname" mode="titlepage.mode">
439   <span>
440     <xsl:apply-templates select="." mode="common.html.attributes"/>
441     <xsl:apply-templates mode="titlepage.mode"/>
442     <br/>
443   </span>
444 </xsl:template>
445
446 <xsl:template match="date" mode="titlepage.mode">
447   <span>
448     <xsl:apply-templates select="." mode="common.html.attributes"/>
449     <xsl:apply-templates mode="titlepage.mode"/>
450     <br/>
451   </span>
452 </xsl:template>
453
454 <xsl:template match="edition" mode="titlepage.mode">
455   <p>
456     <xsl:apply-templates select="." mode="common.html.attributes"/>
457     <xsl:apply-templates mode="titlepage.mode"/>
458     <xsl:call-template name="gentext.space"/>
459     <xsl:call-template name="gentext">
460       <xsl:with-param name="key" select="'Edition'"/>
461     </xsl:call-template>
462   </p>
463 </xsl:template>
464
465 <xsl:template match="email" mode="titlepage.mode">
466   <!-- use the normal e-mail handling code -->
467   <xsl:apply-templates select="."/>
468 </xsl:template>
469
470 <xsl:template match="firstname" mode="titlepage.mode">
471   <span>
472     <xsl:apply-templates select="." mode="common.html.attributes"/>
473     <xsl:apply-templates mode="titlepage.mode"/>
474     <br/>
475   </span>
476 </xsl:template>
477
478 <xsl:template match="graphic" mode="titlepage.mode">
479   <!-- use the normal graphic handling code -->
480   <xsl:apply-templates select="."/>
481 </xsl:template>
482
483 <xsl:template match="honorific" mode="titlepage.mode">
484   <span>
485     <xsl:apply-templates select="." mode="common.html.attributes"/>
486     <xsl:apply-templates mode="titlepage.mode"/>
487     <br/>
488   </span>
489 </xsl:template>
490
491 <xsl:template match="isbn" mode="titlepage.mode">
492   <span>
493     <xsl:apply-templates select="." mode="common.html.attributes"/>
494     <xsl:apply-templates mode="titlepage.mode"/>
495     <br/>
496   </span>
497 </xsl:template>
498
499 <xsl:template match="issn" mode="titlepage.mode">
500   <span>
501     <xsl:apply-templates select="." mode="common.html.attributes"/>
502     <xsl:apply-templates mode="titlepage.mode"/>
503     <br/>
504   </span>
505 </xsl:template>
506
507 <xsl:template match="biblioid" mode="titlepage.mode">
508   <span>
509     <xsl:apply-templates select="." mode="common.html.attributes"/>
510     <xsl:apply-templates mode="titlepage.mode"/>
511     <br/>
512   </span>
513 </xsl:template>
514
515 <xsl:template match="itermset" mode="titlepage.mode">
516 </xsl:template>
517
518 <xsl:template match="invpartnumber" mode="titlepage.mode">
519   <span>
520     <xsl:apply-templates select="." mode="common.html.attributes"/>
521     <xsl:apply-templates mode="titlepage.mode"/>
522     <br/>
523   </span>
524 </xsl:template>
525
526 <xsl:template match="issuenum" mode="titlepage.mode">
527   <span>
528     <xsl:apply-templates select="." mode="common.html.attributes"/>
529     <xsl:apply-templates mode="titlepage.mode"/>
530     <br/>
531   </span>
532 </xsl:template>
533
534 <xsl:template match="jobtitle" mode="titlepage.mode">
535   <span>
536     <xsl:apply-templates select="." mode="common.html.attributes"/>
537     <xsl:apply-templates mode="titlepage.mode"/>
538     <br/>
539   </span>
540 </xsl:template>
541
542 <xsl:template match="keywordset" mode="titlepage.mode">
543 </xsl:template>
544
545 <xsl:template match="legalnotice" mode="titlepage.mode">
546   <xsl:variable name="id"><xsl:call-template name="object.id"/></xsl:variable>
547
548   <xsl:choose>
549     <xsl:when test="$generate.legalnotice.link != 0">
550       
551       <!-- Compute name of legalnotice file -->
552       <xsl:variable name="file">
553         <xsl:call-template name="ln.or.rh.filename"/>
554       </xsl:variable>
555
556       <xsl:variable name="filename">
557         <xsl:call-template name="make-relative-filename">
558           <xsl:with-param name="base.dir" select="$base.dir"/>
559           <xsl:with-param name="base.name" select="$file"/>
560         </xsl:call-template>
561       </xsl:variable>
562
563       <xsl:variable name="title">
564         <xsl:apply-templates select="." mode="title.markup"/>
565       </xsl:variable>
566
567       <a href="{$file}">
568         <xsl:copy-of select="$title"/>
569       </a>
570
571       <xsl:call-template name="write.chunk">
572         <xsl:with-param name="filename" select="$filename"/>
573         <xsl:with-param name="quiet" select="$chunk.quietly"/>
574         <xsl:with-param name="content">
575         <xsl:call-template name="user.preroot"/>
576           <html>
577             <head>
578               <xsl:call-template name="system.head.content"/>
579               <xsl:call-template name="head.content"/>
580               <xsl:call-template name="user.head.content"/>
581             </head>
582             <body>
583               <xsl:call-template name="body.attributes"/>
584               <div>
585                 <xsl:apply-templates select="." mode="common.html.attributes"/>
586                 <xsl:apply-templates mode="titlepage.mode"/>
587               </div>
588             </body>
589           </html>
590           <xsl:value-of select="$chunk.append"/>
591         </xsl:with-param>
592       </xsl:call-template>
593     </xsl:when>
594     <xsl:otherwise>
595       <div>
596         <xsl:apply-templates select="." mode="common.html.attributes"/>
597         <a name="{$id}"/>
598         <xsl:apply-templates mode="titlepage.mode"/>
599       </div>
600     </xsl:otherwise>
601   </xsl:choose>
602 </xsl:template>
603
604 <xsl:template match="legalnotice/title" mode="titlepage.mode">
605   <p class="legalnotice-title"><b><xsl:apply-templates/></b></p>
606 </xsl:template>
607
608 <xsl:template match="lineage" mode="titlepage.mode">
609   <span>
610     <xsl:apply-templates select="." mode="common.html.attributes"/>
611     <xsl:apply-templates mode="titlepage.mode"/>
612     <br/>
613   </span>
614 </xsl:template>
615
616 <xsl:template match="modespec" mode="titlepage.mode">
617 </xsl:template>
618
619 <xsl:template match="orgdiv" mode="titlepage.mode">
620   <xsl:if test="preceding-sibling::*[1][self::orgname]">
621     <xsl:text> </xsl:text>
622   </xsl:if>
623   <span>
624     <xsl:apply-templates select="." mode="common.html.attributes"/>
625     <xsl:apply-templates mode="titlepage.mode"/>
626     <br/>
627   </span>
628 </xsl:template>
629
630 <xsl:template match="orgname" mode="titlepage.mode">
631   <span>
632     <xsl:apply-templates select="." mode="common.html.attributes"/>
633     <xsl:apply-templates mode="titlepage.mode"/>
634     <br/>
635   </span>
636 </xsl:template>
637
638 <xsl:template match="othercredit" mode="titlepage.mode">
639 <xsl:choose>
640   <xsl:when test="not($othercredit.like.author.enabled = 0)">
641   <xsl:variable name="contrib" select="string(contrib)"/>
642   <xsl:choose>
643     <xsl:when test="contrib">
644       <xsl:if test="not(preceding-sibling::othercredit[string(contrib)=$contrib])">
645         <xsl:call-template name="paragraph">
646           <xsl:with-param name="class" select="local-name(.)"/>
647           <xsl:with-param name="content">
648             <xsl:apply-templates mode="titlepage.mode" select="contrib"/>
649             <xsl:text>: </xsl:text>
650             <xsl:call-template name="person.name"/>
651             <xsl:apply-templates mode="titlepage.mode" select="affiliation"/>
652             <xsl:apply-templates select="following-sibling::othercredit[string(contrib)=$contrib]" mode="titlepage.othercredits"/>
653           </xsl:with-param>
654         </xsl:call-template>
655       </xsl:if>
656     </xsl:when>
657     <xsl:otherwise>
658       <xsl:call-template name="paragraph">
659         <xsl:with-param name="class" select="local-name(.)"/>
660         <xsl:with-param name="content">
661           <xsl:call-template name="person.name"/>
662         </xsl:with-param>
663       </xsl:call-template>
664       <xsl:apply-templates mode="titlepage.mode" select="affiliation"/>
665     </xsl:otherwise>
666   </xsl:choose>
667   </xsl:when>
668   <xsl:otherwise>
669     <xsl:call-template name="credits.div"/>
670   </xsl:otherwise>
671 </xsl:choose>
672 </xsl:template>
673
674 <xsl:template match="othercredit" mode="titlepage.othercredits">
675   <xsl:text>, </xsl:text>
676   <xsl:call-template name="person.name"/>
677 </xsl:template>
678
679 <xsl:template match="othername" mode="titlepage.mode">
680   <span>
681     <xsl:apply-templates select="." mode="common.html.attributes"/>
682     <xsl:apply-templates mode="titlepage.mode"/>
683     <br/>
684   </span>
685 </xsl:template>
686
687 <xsl:template match="pagenums" mode="titlepage.mode">
688   <span>
689     <xsl:apply-templates select="." mode="common.html.attributes"/>
690     <xsl:apply-templates mode="titlepage.mode"/>
691     <br/>
692   </span>
693 </xsl:template>
694
695 <xsl:template match="printhistory" mode="titlepage.mode">
696   <div>
697     <xsl:apply-templates select="." mode="common.html.attributes"/>
698     <xsl:apply-templates mode="titlepage.mode"/>
699   </div>
700 </xsl:template>
701
702 <xsl:template match="productname" mode="titlepage.mode">
703   <span>
704     <xsl:apply-templates select="." mode="common.html.attributes"/>
705     <xsl:apply-templates mode="titlepage.mode"/>
706     <br/>
707   </span>
708 </xsl:template>
709
710 <xsl:template match="productnumber" mode="titlepage.mode">
711   <span>
712     <xsl:apply-templates select="." mode="common.html.attributes"/>
713     <xsl:apply-templates mode="titlepage.mode"/>
714     <br/>
715   </span>
716 </xsl:template>
717
718 <xsl:template match="pubdate" mode="titlepage.mode">
719   <xsl:call-template name="paragraph">
720     <xsl:with-param name="class" select="local-name(.)"/>
721     <xsl:with-param name="content">
722       <xsl:apply-templates mode="titlepage.mode"/>
723     </xsl:with-param>
724   </xsl:call-template>
725 </xsl:template>
726
727 <xsl:template match="publisher" mode="titlepage.mode">
728   <xsl:call-template name="paragraph">
729     <xsl:with-param name="class" select="local-name(.)"/>
730     <xsl:with-param name="content">
731       <xsl:apply-templates mode="titlepage.mode"/>
732     </xsl:with-param>
733   </xsl:call-template>
734 </xsl:template>
735
736 <xsl:template match="publishername" mode="titlepage.mode">
737   <span>
738     <xsl:apply-templates select="." mode="common.html.attributes"/>
739     <xsl:apply-templates mode="titlepage.mode"/>
740     <br/>
741   </span>
742 </xsl:template>
743
744 <xsl:template match="pubsnumber" mode="titlepage.mode">
745   <span>
746     <xsl:apply-templates select="." mode="common.html.attributes"/>
747     <xsl:apply-templates mode="titlepage.mode"/>
748     <br/>
749   </span>
750 </xsl:template>
751
752 <xsl:template match="releaseinfo" mode="titlepage.mode">
753   <xsl:call-template name="paragraph">
754     <xsl:with-param name="class" select="local-name(.)"/>
755     <xsl:with-param name="content">
756       <xsl:apply-templates mode="titlepage.mode"/>
757     </xsl:with-param>
758   </xsl:call-template>
759 </xsl:template>
760
761 <xsl:template match="revhistory" mode="titlepage.mode">
762   <xsl:variable name="numcols">
763     <xsl:choose>
764       <xsl:when test=".//authorinitials|.//author">3</xsl:when>
765       <xsl:otherwise>2</xsl:otherwise>
766     </xsl:choose>
767   </xsl:variable>
768
769   <xsl:variable name="id"><xsl:call-template name="object.id"/></xsl:variable>
770
771   <xsl:variable name="title">
772     <xsl:call-template name="gentext">
773       <xsl:with-param name="key">RevHistory</xsl:with-param>
774     </xsl:call-template>
775   </xsl:variable>
776
777   <xsl:variable name="contents">
778     <div>
779       <xsl:apply-templates select="." mode="common.html.attributes"/>
780       <table border="1" width="100%" summary="Revision history">
781         <tr>
782           <th align="{$direction.align.start}" valign="top" colspan="{$numcols}">
783             <b>
784               <xsl:call-template name="gentext">
785                 <xsl:with-param name="key" select="'RevHistory'"/>
786               </xsl:call-template>
787             </b>
788           </th>
789         </tr>
790         <xsl:apply-templates mode="titlepage.mode">
791           <xsl:with-param name="numcols" select="$numcols"/>
792         </xsl:apply-templates>
793       </table>
794     </div>
795   </xsl:variable>
796   
797   <xsl:choose>
798     <xsl:when test="$generate.revhistory.link != 0">
799       
800       <!-- Compute name of revhistory file -->
801       <xsl:variable name="file">
802         <xsl:call-template name="ln.or.rh.filename">
803           <xsl:with-param name="is.ln" select="false()"/>
804         </xsl:call-template>
805       </xsl:variable>
806
807       <xsl:variable name="filename">
808         <xsl:call-template name="make-relative-filename">
809           <xsl:with-param name="base.dir" select="$base.dir"/>
810           <xsl:with-param name="base.name" select="$file"/>
811         </xsl:call-template>
812       </xsl:variable>
813
814       <a href="{$file}">
815         <xsl:copy-of select="$title"/>
816       </a>
817
818       <xsl:call-template name="write.chunk">
819         <xsl:with-param name="filename" select="$filename"/>
820         <xsl:with-param name="quiet" select="$chunk.quietly"/>
821         <xsl:with-param name="content">
822         <xsl:call-template name="user.preroot"/>
823           <html>
824             <head>
825               <xsl:call-template name="system.head.content"/>
826               <xsl:call-template name="head.content">
827                 <xsl:with-param name="title">
828                     <xsl:value-of select="$title"/>
829                     <xsl:if test="../../title">
830                         <xsl:value-of select="concat(' (', ../../title, ')')"/>
831                     </xsl:if>
832                 </xsl:with-param>
833               </xsl:call-template>
834               <xsl:call-template name="user.head.content"/>
835             </head>
836             <body>
837               <xsl:call-template name="body.attributes"/>
838               <xsl:copy-of select="$contents"/>
839             </body>
840           </html>
841           <xsl:text>&#x0a;</xsl:text>
842         </xsl:with-param>
843       </xsl:call-template>
844     </xsl:when>
845     <xsl:otherwise>
846       <xsl:copy-of select="$contents"/>
847     </xsl:otherwise>
848   </xsl:choose>
849 </xsl:template>
850
851 <xsl:template match="revhistory/revision" mode="titlepage.mode">
852   <xsl:param name="numcols" select="'3'"/>
853   <xsl:variable name="revnumber" select="revnumber"/>
854   <xsl:variable name="revdate"   select="date"/>
855   <xsl:variable name="revauthor" select="authorinitials|author"/>
856   <xsl:variable name="revremark" select="revremark|revdescription"/>
857   <tr>
858     <td align="{$direction.align.start}">
859       <xsl:if test="$revnumber">
860         <xsl:call-template name="gentext">
861           <xsl:with-param name="key" select="'Revision'"/>
862         </xsl:call-template>
863         <xsl:call-template name="gentext.space"/>
864         <xsl:apply-templates select="$revnumber[1]" mode="titlepage.mode"/>
865       </xsl:if>
866     </td>
867     <td align="{$direction.align.start}">
868       <xsl:apply-templates select="$revdate[1]" mode="titlepage.mode"/>
869     </td>
870     <xsl:choose>
871       <xsl:when test="$revauthor">
872         <td align="{$direction.align.start}">
873           <xsl:for-each select="$revauthor">
874             <xsl:apply-templates select="." mode="titlepage.mode"/>
875             <xsl:if test="position() != last()">
876               <xsl:text>, </xsl:text>
877             </xsl:if>
878           </xsl:for-each>
879         </td>
880       </xsl:when>
881       <xsl:when test="$numcols &gt; 2">
882         <td>&#160;</td>
883       </xsl:when>
884       <xsl:otherwise></xsl:otherwise>
885     </xsl:choose>
886   </tr>
887   <xsl:if test="$revremark">
888     <tr>
889       <td align="{$direction.align.start}" colspan="{$numcols}">
890         <xsl:apply-templates select="$revremark[1]" mode="titlepage.mode"/>
891       </td>
892     </tr>
893   </xsl:if>
894 </xsl:template>
895
896 <xsl:template match="revision/revnumber" mode="titlepage.mode">
897   <xsl:apply-templates mode="titlepage.mode"/>
898 </xsl:template>
899
900 <xsl:template match="revision/date" mode="titlepage.mode">
901   <xsl:apply-templates mode="titlepage.mode"/>
902 </xsl:template>
903
904 <xsl:template match="revision/authorinitials" mode="titlepage.mode">
905   <xsl:apply-templates mode="titlepage.mode"/>
906 </xsl:template>
907
908 <xsl:template match="revision/author" mode="titlepage.mode">
909   <xsl:apply-templates mode="titlepage.mode"/>
910 </xsl:template>
911
912 <xsl:template match="revision/revremark" mode="titlepage.mode">
913   <xsl:apply-templates mode="titlepage.mode"/>
914 </xsl:template>
915
916 <xsl:template match="revision/revdescription" mode="titlepage.mode">
917   <xsl:apply-templates mode="titlepage.mode"/>
918 </xsl:template>
919
920 <xsl:template match="seriesvolnums" mode="titlepage.mode">
921   <span>
922     <xsl:apply-templates select="." mode="common.html.attributes"/>
923     <xsl:apply-templates mode="titlepage.mode"/>
924     <br/>
925   </span>
926 </xsl:template>
927
928 <xsl:template match="shortaffil" mode="titlepage.mode">
929   <span>
930     <xsl:apply-templates select="." mode="common.html.attributes"/>
931     <xsl:apply-templates mode="titlepage.mode"/>
932     <br/>
933   </span>
934 </xsl:template>
935
936 <xsl:template match="subjectset" mode="titlepage.mode">
937 </xsl:template>
938
939 <xsl:template match="subtitle" mode="titlepage.mode">
940   <h2>
941     <xsl:apply-templates select="." mode="common.html.attributes"/>
942     <xsl:apply-templates mode="titlepage.mode"/>
943   </h2>
944 </xsl:template>
945
946 <xsl:template match="surname" mode="titlepage.mode">
947   <span>
948     <xsl:apply-templates select="." mode="common.html.attributes"/>
949     <xsl:apply-templates mode="titlepage.mode"/>
950     <br/>
951   </span>
952 </xsl:template>
953
954 <xsl:template match="title" mode="titlepage.mode">
955   <xsl:variable name="id">
956     <xsl:choose>
957       <!-- if title is in an *info wrapper, get the grandparent -->
958       <xsl:when test="contains(local-name(..), 'info')">
959         <xsl:call-template name="object.id">
960           <xsl:with-param name="object" select="../.."/>
961         </xsl:call-template>
962       </xsl:when>
963       <xsl:otherwise>
964         <xsl:call-template name="object.id">
965           <xsl:with-param name="object" select=".."/>
966         </xsl:call-template>
967       </xsl:otherwise>
968     </xsl:choose>
969   </xsl:variable>
970
971   <h1>
972     <xsl:apply-templates select="." mode="common.html.attributes"/>
973     <xsl:if test="$generate.id.attributes = 0">
974       <a name="{$id}"/>
975     </xsl:if>
976     <xsl:choose>
977       <xsl:when test="$show.revisionflag != 0 and @revisionflag">
978         <span class="{@revisionflag}">
979           <xsl:apply-templates mode="titlepage.mode"/>
980         </span>
981       </xsl:when>
982       <xsl:otherwise>
983         <xsl:apply-templates mode="titlepage.mode"/>
984       </xsl:otherwise>
985     </xsl:choose>
986   </h1>
987 </xsl:template>
988
989 <xsl:template match="titleabbrev" mode="titlepage.mode">
990   <!-- nop; title abbreviations don't belong on the title page! -->
991 </xsl:template>
992
993 <xsl:template match="volumenum" mode="titlepage.mode">
994   <span>
995     <xsl:apply-templates select="." mode="common.html.attributes"/>
996     <xsl:apply-templates mode="titlepage.mode"/>
997     <br/>
998   </span>
999 </xsl:template>
1000
1001 <!-- This template computes the filename for legalnotice and revhistory chunks -->
1002 <xsl:template name="ln.or.rh.filename">
1003   <xsl:param name="node" select="."/>
1004   <xsl:param name="is.ln" select="true()"/>
1005
1006   <xsl:variable name="dbhtml-filename">
1007     <xsl:call-template name="pi.dbhtml_filename">
1008       <xsl:with-param name="node" select="$node"/>
1009     </xsl:call-template>
1010   </xsl:variable>
1011  
1012   <xsl:choose>
1013     <!--  1. If there is a dbhtml_filename PI, use that -->
1014     <xsl:when test="$dbhtml-filename != ''">
1015       <xsl:value-of select="$dbhtml-filename"/>
1016     </xsl:when>
1017     <xsl:when test="($node/@id or $node/@xml:id) and not($use.id.as.filename = 0)">
1018       <!-- * 2. If this legalnotice/revhistory has an ID, then go ahead and use -->
1019       <!-- * just the value of that ID as the basename for the file -->
1020       <!-- * (that is, without prepending an "ln-" or "rh-" to it) -->
1021       <xsl:value-of select="($node/@id|$node/@xml:id)[1]"/>
1022       <xsl:value-of select="$html.ext"/>
1023     </xsl:when>
1024     <xsl:when test="not ($node/@id or $node/@xml:id) or $use.id.as.filename = 0">
1025       <!-- * 3. Otherwise, if this legalnotice/revhistory does not have an ID, or -->
1026       <!-- * if $use.id.as.filename = 0 -->
1027       <!-- * then we generate an ID... -->
1028       <xsl:variable name="id">
1029         <xsl:value-of select="generate-id($node)"/>
1030       </xsl:variable>
1031       <!-- * ...and then we take that generated ID, prepend a -->
1032       <!-- * prefix to it, and use that as the basename for the file -->
1033       <xsl:choose>
1034         <xsl:when test="$is.ln">
1035           <xsl:value-of select="concat('ln-',$id,$html.ext)"/>
1036         </xsl:when>
1037         <xsl:otherwise>
1038           <xsl:value-of select="concat('rh-',$id,$html.ext)"/>
1039         </xsl:otherwise>
1040       </xsl:choose>
1041     </xsl:when>
1042   </xsl:choose>
1043 </xsl:template>
1044     
1045 <!-- ==================================================================== -->
1046
1047 </xsl:stylesheet>