Imported Upstream version 1.79.2
[platform/upstream/docbook-xsl-stylesheets.git] / fo / biblio.xsl
1 <?xml version='1.0'?>
2 <xsl:stylesheet exclude-result-prefixes="d"
3                 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
4                 xmlns:d="http://docbook.org/ns/docbook"
5                 xmlns:fo="http://www.w3.org/1999/XSL/Format"
6                 version='1.0'>
7
8 <!-- ********************************************************************
9
10      This file is part of the XSL DocBook Stylesheet distribution.
11      See ../README or http://cdn.docbook.org/release/xsl/current/ for
12      copyright and other information.
13
14      ******************************************************************** -->
15
16 <!-- ==================================================================== -->
17
18 <xsl:template match="d:bibliography">
19   <xsl:variable name="id">
20     <xsl:call-template name="object.id"/>
21   </xsl:variable>
22
23   <xsl:choose>
24     <xsl:when test="not(parent::*) or parent::d:part or parent::d:book">
25       <xsl:variable name="master-reference">
26         <xsl:call-template name="select.pagemaster"/>
27       </xsl:variable>
28
29       <fo:page-sequence hyphenate="{$hyphenate}"
30                         master-reference="{$master-reference}">
31         <xsl:attribute name="language">
32           <xsl:call-template name="l10n.language"/>
33         </xsl:attribute>
34         <xsl:attribute name="format">
35           <xsl:call-template name="page.number.format">
36             <xsl:with-param name="master-reference" select="$master-reference"/>
37           </xsl:call-template>
38         </xsl:attribute>
39         <xsl:attribute name="initial-page-number">
40           <xsl:call-template name="initial.page.number">
41             <xsl:with-param name="master-reference" select="$master-reference"/>
42           </xsl:call-template>
43         </xsl:attribute>
44         <xsl:attribute name="force-page-count">
45           <xsl:call-template name="force.page.count">
46             <xsl:with-param name="master-reference" select="$master-reference"/>
47           </xsl:call-template>
48         </xsl:attribute>
49         <xsl:attribute name="hyphenation-character">
50           <xsl:call-template name="gentext">
51             <xsl:with-param name="key" select="'hyphenation-character'"/>
52           </xsl:call-template>
53         </xsl:attribute>
54         <xsl:attribute name="hyphenation-push-character-count">
55           <xsl:call-template name="gentext">
56             <xsl:with-param name="key" select="'hyphenation-push-character-count'"/>
57           </xsl:call-template>
58         </xsl:attribute>
59         <xsl:attribute name="hyphenation-remain-character-count">
60           <xsl:call-template name="gentext">
61             <xsl:with-param name="key" select="'hyphenation-remain-character-count'"/>
62           </xsl:call-template>
63         </xsl:attribute>
64
65         <xsl:apply-templates select="." mode="running.head.mode">
66           <xsl:with-param name="master-reference" select="$master-reference"/>
67         </xsl:apply-templates>
68         <xsl:apply-templates select="." mode="running.foot.mode">
69           <xsl:with-param name="master-reference" select="$master-reference"/>
70         </xsl:apply-templates>
71
72         <fo:flow flow-name="xsl-region-body">
73           <xsl:call-template name="set.flow.properties">
74             <xsl:with-param name="element" select="local-name(.)"/>
75             <xsl:with-param name="master-reference" select="$master-reference"/>
76           </xsl:call-template>
77
78           <fo:block id="{$id}">
79             <xsl:call-template name="bibliography.titlepage"/>
80           </fo:block>
81           <xsl:apply-templates/>
82         </fo:flow>
83       </fo:page-sequence>
84     </xsl:when>
85     <xsl:otherwise>
86       <fo:block id="{$id}"
87                 space-before.minimum="1em"
88                 space-before.optimum="1.5em"
89                 space-before.maximum="2em">
90         <xsl:call-template name="bibliography.titlepage"/>
91       </fo:block>
92       <xsl:apply-templates/>
93     </xsl:otherwise>
94   </xsl:choose>
95 </xsl:template>
96
97 <xsl:template match="d:bibliography/d:bibliographyinfo"></xsl:template>
98 <xsl:template match="d:bibliography/d:info"></xsl:template>
99 <xsl:template match="d:bibliography/d:title"></xsl:template>
100 <xsl:template match="d:bibliography/d:subtitle"></xsl:template>
101 <xsl:template match="d:bibliography/d:titleabbrev"></xsl:template>
102
103 <!-- ==================================================================== -->
104
105 <xsl:template match="d:bibliodiv">
106   <fo:block>
107     <xsl:attribute name="id">
108       <xsl:call-template name="object.id"/>
109     </xsl:attribute>
110     <xsl:call-template name="bibliodiv.titlepage"/>
111     <xsl:apply-templates/>
112   </fo:block>
113 </xsl:template>
114
115 <xsl:template match="d:bibliodiv/d:title"/>
116 <xsl:template match="d:bibliodiv/d:subtitle"/>
117 <xsl:template match="d:bibliodiv/d:titleabbrev"/>
118
119 <!-- ==================================================================== -->
120
121 <xsl:template match="d:bibliolist">
122   <xsl:variable name="id">
123     <xsl:call-template name="object.id"/>
124   </xsl:variable>
125
126   <fo:block id="{$id}"
127             space-before.minimum="1em"
128             space-before.optimum="1.5em"
129             space-before.maximum="2em">
130
131     <xsl:if test="d:blockinfo/d:title|d:info/d:title|d:title">
132       <xsl:call-template name="formal.object.heading"/>
133     </xsl:if>
134
135     <xsl:apply-templates select="*[not(self::d:blockinfo)
136                                    and not(self::d:info)
137                                    and not(self::d:title)
138                                    and not(self::d:titleabbrev)]"/>
139   </fo:block>
140 </xsl:template>
141
142 <!-- ==================================================================== -->
143
144 <xsl:template match="d:biblioentry">
145   <xsl:param name="label">
146     <xsl:call-template name="biblioentry.label"/>
147   </xsl:param>
148
149   <xsl:variable name="id">
150     <xsl:call-template name="object.id"/>
151   </xsl:variable>
152
153   <xsl:choose>
154     <xsl:when test="string(.) = ''">
155       <xsl:variable name="bib" select="document($bibliography.collection,.)"/>
156       <xsl:variable name="entry" select="$bib/d:bibliography//
157                                          *[@id=$id or @xml:id=$id][1]"/>
158       <xsl:choose>
159         <xsl:when test="$entry">
160           <xsl:choose>
161             <xsl:when test="$bibliography.numbered != 0">
162               <xsl:apply-templates select="$entry">
163                 <xsl:with-param name="label" select="$label"/>
164               </xsl:apply-templates>
165             </xsl:when>
166             <xsl:otherwise>
167               <xsl:apply-templates select="$entry"/>
168             </xsl:otherwise>
169           </xsl:choose>
170         </xsl:when>
171         <xsl:otherwise>
172           <xsl:message>
173             <xsl:text>No bibliography entry: </xsl:text>
174             <xsl:value-of select="$id"/>
175             <xsl:text> found in </xsl:text>
176             <xsl:value-of select="$bibliography.collection"/>
177           </xsl:message>
178           <fo:block id="{$id}" xsl:use-attribute-sets="normal.para.spacing">
179             <xsl:text>Error: no bibliography entry: </xsl:text>
180             <xsl:value-of select="$id"/>
181             <xsl:text> found in </xsl:text>
182             <xsl:value-of select="$bibliography.collection"/>
183           </fo:block>
184         </xsl:otherwise>
185       </xsl:choose>
186     </xsl:when>
187     <xsl:otherwise>
188       <fo:block id="{$id}" xsl:use-attribute-sets="biblioentry.properties">
189         <xsl:copy-of select="$label"/>
190         <xsl:choose>
191           <xsl:when test="$bibliography.style = 'iso690'">
192             <xsl:call-template name="iso690.makecitation"/>
193           </xsl:when>
194           <xsl:otherwise>
195             <xsl:apply-templates mode="bibliography.mode"/>
196           </xsl:otherwise>
197         </xsl:choose>
198       </fo:block>
199     </xsl:otherwise>
200   </xsl:choose>
201 </xsl:template>
202
203 <xsl:template match="d:bibliomixed">
204   <xsl:param name="label">
205     <xsl:call-template name="biblioentry.label"/>
206   </xsl:param>
207
208   <xsl:variable name="id">
209     <xsl:call-template name="object.id"/>
210   </xsl:variable>
211
212   <xsl:choose>
213     <xsl:when test="string(.) = ''">
214       <xsl:variable name="bib" select="document($bibliography.collection,.)"/>
215       <xsl:variable name="entry" select="$bib/d:bibliography//
216                                          *[@id=$id or @xml:id=$id][1]"/>
217       <xsl:choose>
218         <xsl:when test="$entry">
219           <xsl:choose>
220             <xsl:when test="$bibliography.numbered != 0">
221               <xsl:apply-templates select="$entry">
222                 <xsl:with-param name="label" select="$label"/>
223               </xsl:apply-templates>
224             </xsl:when>
225             <xsl:otherwise>
226               <xsl:apply-templates select="$entry"/>
227             </xsl:otherwise>
228           </xsl:choose>
229         </xsl:when>
230         <xsl:otherwise>
231           <xsl:message>
232             <xsl:text>No bibliography entry: </xsl:text>
233             <xsl:value-of select="$id"/>
234             <xsl:text> found in </xsl:text>
235             <xsl:value-of select="$bibliography.collection"/>
236           </xsl:message>
237           <fo:block id="{$id}" xsl:use-attribute-sets="normal.para.spacing">
238             <xsl:text>Error: no bibliography entry: </xsl:text>
239             <xsl:value-of select="$id"/>
240             <xsl:text> found in </xsl:text>
241             <xsl:value-of select="$bibliography.collection"/>
242           </fo:block>
243         </xsl:otherwise>
244       </xsl:choose>
245     </xsl:when>
246     <xsl:otherwise>
247       <fo:block id="{$id}" xsl:use-attribute-sets="biblioentry.properties">
248         <xsl:copy-of select="$label"/>
249         <xsl:apply-templates mode="bibliomixed.mode"/>
250       </fo:block>
251     </xsl:otherwise>
252   </xsl:choose>
253 </xsl:template>
254
255 <xsl:template name="biblioentry.label">
256   <xsl:param name="node" select="."/>
257
258   <xsl:choose>
259     <xsl:when test="$bibliography.numbered != 0">
260       <xsl:text>[</xsl:text>
261       <xsl:number from="d:bibliography" count="d:biblioentry|d:bibliomixed"
262                   level="any" format="1"/>
263       <xsl:text>] </xsl:text>
264     </xsl:when>
265     <xsl:when test="local-name($node/child::*[1]) = 'abbrev'">
266       <xsl:text>[</xsl:text>
267       <xsl:apply-templates select="$node/d:abbrev[1]"/>
268       <xsl:text>] </xsl:text>
269     </xsl:when>
270     <xsl:when test="$node/@xreflabel">
271       <xsl:text>[</xsl:text>
272       <xsl:value-of select="$node/@xreflabel"/>
273       <xsl:text>] </xsl:text>
274     </xsl:when>
275     <xsl:when test="$node/@id or $node/@xml:id">
276       <xsl:text>[</xsl:text>
277       <xsl:value-of select="($node/@id|$node/@xml:id)[1]"/>
278       <xsl:text>] </xsl:text>
279     </xsl:when>
280     <xsl:otherwise><!-- nop --></xsl:otherwise>
281   </xsl:choose>
282 </xsl:template>
283
284 <!-- ==================================================================== -->
285
286 <xsl:template match="*" mode="bibliography.mode">
287   <xsl:apply-templates select="."/><!-- try the default mode -->
288 </xsl:template>
289
290 <xsl:template match="d:abbrev" mode="bibliography.mode">
291   <xsl:if test="preceding-sibling::*">
292     <fo:inline>
293       <xsl:apply-templates mode="bibliography.mode"/>
294     </fo:inline>
295   </xsl:if>
296 </xsl:template>
297
298 <xsl:template match="d:abstract" mode="bibliography.mode">
299   <!-- suppressed -->
300 </xsl:template>
301
302 <xsl:template match="d:address" mode="bibliography.mode">
303   <fo:inline>
304     <xsl:apply-templates mode="bibliography.mode"/>
305     <xsl:value-of select="$biblioentry.item.separator"/>
306   </fo:inline>
307 </xsl:template>
308
309 <xsl:template match="d:affiliation" mode="bibliography.mode">
310   <fo:inline>
311     <xsl:apply-templates mode="bibliography.mode"/>
312     <xsl:value-of select="$biblioentry.item.separator"/>
313   </fo:inline>
314 </xsl:template>
315
316 <xsl:template match="d:shortaffil" mode="bibliography.mode">
317   <fo:inline>
318     <xsl:apply-templates mode="bibliography.mode"/>
319     <xsl:value-of select="$biblioentry.item.separator"/>
320   </fo:inline>
321 </xsl:template>
322
323 <xsl:template match="d:jobtitle" mode="bibliography.mode">
324   <fo:inline>
325     <xsl:apply-templates mode="bibliography.mode"/>
326     <xsl:value-of select="$biblioentry.item.separator"/>
327   </fo:inline>
328 </xsl:template>
329
330 <xsl:template match="d:artheader|d:articleinfo|d:article/d:info"
331               mode="bibliography.mode">
332   <fo:inline>
333     <xsl:apply-templates mode="bibliography.mode"/>
334     <xsl:value-of select="$biblioentry.item.separator"/>
335   </fo:inline>
336 </xsl:template>
337
338 <xsl:template match="d:artpagenums" mode="bibliography.mode">
339   <fo:inline>
340     <xsl:apply-templates mode="bibliography.mode"/>
341     <xsl:value-of select="$biblioentry.item.separator"/>
342   </fo:inline>
343 </xsl:template>
344
345 <xsl:template match="d:author" mode="bibliography.mode">
346   <fo:inline>
347     <xsl:choose>
348       <xsl:when test="d:orgname">
349         <xsl:apply-templates select="d:orgname" mode="bibliography.mode"/>
350       </xsl:when>
351       <xsl:otherwise>
352         <xsl:call-template name="person.name"/>
353         <xsl:value-of select="$biblioentry.item.separator"/>
354       </xsl:otherwise>
355     </xsl:choose>
356   </fo:inline>
357 </xsl:template>
358
359 <xsl:template match="d:authorblurb|d:personblurb" mode="bibliography.mode">
360   <fo:inline>
361     <xsl:apply-templates mode="bibliography.mode"/>
362     <xsl:value-of select="$biblioentry.item.separator"/>
363   </fo:inline>
364 </xsl:template>
365
366 <xsl:template match="d:authorgroup" mode="bibliography.mode">
367   <fo:inline>
368     <xsl:call-template name="person.name.list"/>
369     <xsl:value-of select="$biblioentry.item.separator"/>
370   </fo:inline>
371 </xsl:template>
372
373 <xsl:template match="d:authorinitials" mode="bibliography.mode">
374   <fo:inline>
375     <xsl:apply-templates mode="bibliography.mode"/>
376     <xsl:value-of select="$biblioentry.item.separator"/>
377   </fo:inline>
378 </xsl:template>
379
380 <xsl:template match="d:bibliomisc" mode="bibliography.mode">
381   <fo:inline>
382     <xsl:apply-templates mode="bibliography.mode"/>
383     <xsl:value-of select="$biblioentry.item.separator"/>
384   </fo:inline>
385 </xsl:template>
386
387 <xsl:template match="d:bibliomset" mode="bibliography.mode">
388   <fo:inline>
389     <xsl:apply-templates mode="bibliography.mode"/>
390     <xsl:value-of select="$biblioentry.item.separator"/>
391   </fo:inline>
392 </xsl:template>
393
394 <!-- ================================================== -->
395
396 <xsl:template match="d:biblioset" mode="bibliography.mode">
397   <fo:inline>
398     <xsl:if test="@id">
399       <xsl:attribute name="id">
400         <xsl:value-of select="@id"/>
401       </xsl:attribute>
402     </xsl:if>
403     <xsl:apply-templates mode="bibliography.mode"/>
404   </fo:inline>
405 </xsl:template>
406
407 <xsl:template match="d:biblioset/d:title|d:biblioset/d:citetitle"
408               mode="bibliography.mode">
409   <xsl:variable name="relation" select="../@relation"/>
410   <xsl:choose>
411     <xsl:when test="$relation='article' or @pubwork='article'">
412       <xsl:call-template name="gentext.startquote"/>
413       <xsl:apply-templates mode="bibliography.mode"/>
414       <xsl:call-template name="gentext.endquote"/>
415     </xsl:when>
416     <xsl:otherwise>
417       <fo:inline font-style="italic">
418         <xsl:apply-templates/>
419       </fo:inline>
420     </xsl:otherwise>
421   </xsl:choose>
422   <xsl:value-of select="$biblioentry.item.separator"/>
423 </xsl:template>
424
425 <!-- ================================================== -->
426
427 <xsl:template match="d:citetitle" mode="bibliography.mode">
428   <fo:inline>
429     <xsl:choose>
430       <xsl:when test="@pubwork = 'article'">
431         <xsl:call-template name="gentext.startquote"/>
432         <xsl:apply-templates mode="bibliography.mode"/>
433         <xsl:call-template name="gentext.endquote"/>
434       </xsl:when>
435       <xsl:otherwise>
436         <fo:inline font-style="italic">
437           <xsl:apply-templates mode="bibliography.mode"/>
438         </fo:inline>
439       </xsl:otherwise>
440     </xsl:choose>
441     <xsl:value-of select="$biblioentry.item.separator"/>
442   </fo:inline>
443 </xsl:template>
444
445 <xsl:template match="d:collab" mode="bibliography.mode">
446   <fo:inline>
447     <xsl:apply-templates mode="bibliography.mode"/>
448     <xsl:value-of select="$biblioentry.item.separator"/>
449   </fo:inline>
450 </xsl:template>
451
452 <xsl:template match="d:confgroup" mode="bibliography.mode">
453   <fo:inline>
454     <xsl:apply-templates mode="bibliography.mode"/>
455     <xsl:value-of select="$biblioentry.item.separator"/>
456   </fo:inline>
457 </xsl:template>
458
459 <xsl:template match="d:contractnum" mode="bibliography.mode">
460   <fo:inline>
461     <xsl:apply-templates mode="bibliography.mode"/>
462     <xsl:value-of select="$biblioentry.item.separator"/>
463   </fo:inline>
464 </xsl:template>
465
466 <xsl:template match="d:contractsponsor" mode="bibliography.mode">
467   <fo:inline>
468     <xsl:apply-templates mode="bibliography.mode"/>
469     <xsl:value-of select="$biblioentry.item.separator"/>
470   </fo:inline>
471 </xsl:template>
472
473 <xsl:template match="d:contrib" mode="bibliography.mode">
474   <fo:inline>
475     <xsl:apply-templates mode="bibliography.mode"/>
476     <xsl:value-of select="$biblioentry.item.separator"/>
477   </fo:inline>
478 </xsl:template>
479
480 <!-- ================================================== -->
481
482 <xsl:template match="d:copyright" mode="bibliography.mode">
483   <fo:inline>
484     <xsl:call-template name="gentext">
485       <xsl:with-param name="key" select="'Copyright'"/>
486     </xsl:call-template>
487     <xsl:call-template name="gentext.space"/>
488     <xsl:call-template name="dingbat">
489       <xsl:with-param name="dingbat">copyright</xsl:with-param>
490     </xsl:call-template>
491     <xsl:call-template name="gentext.space"/>
492     <xsl:apply-templates select="d:year" mode="bibliography.mode"/>
493     <xsl:if test="d:holder">
494       <xsl:call-template name="gentext.space"/>
495       <xsl:apply-templates select="d:holder" mode="bibliography.mode"/>
496     </xsl:if>
497     <xsl:value-of select="$biblioentry.item.separator"/>
498   </fo:inline>
499 </xsl:template>
500
501 <xsl:template match="d:year" mode="bibliography.mode">
502   <xsl:apply-templates/><xsl:text>, </xsl:text>
503 </xsl:template>
504
505 <xsl:template match="d:year[position()=last()]" mode="bibliography.mode">
506   <xsl:apply-templates/>
507 </xsl:template>
508
509 <xsl:template match="d:holder" mode="bibliography.mode">
510   <xsl:apply-templates/>
511 </xsl:template>
512
513 <!-- ================================================== -->
514
515 <xsl:template match="d:corpauthor" mode="bibliography.mode">
516   <fo:inline>
517     <xsl:apply-templates mode="bibliography.mode"/>
518     <xsl:value-of select="$biblioentry.item.separator"/>
519   </fo:inline>
520 </xsl:template>
521
522 <xsl:template match="d:corpcredit" mode="bibliography.mode">
523   <fo:inline>
524     <xsl:apply-templates mode="bibliography.mode"/>
525     <xsl:value-of select="$biblioentry.item.separator"/>
526   </fo:inline>
527 </xsl:template>
528
529 <xsl:template match="d:corpname" mode="bibliography.mode">
530   <fo:inline>
531     <xsl:apply-templates mode="bibliography.mode"/>
532     <xsl:value-of select="$biblioentry.item.separator"/>
533   </fo:inline>
534 </xsl:template>
535
536 <xsl:template match="d:date" mode="bibliography.mode">
537   <fo:inline>
538     <xsl:apply-templates mode="bibliography.mode"/>
539     <xsl:value-of select="$biblioentry.item.separator"/>
540   </fo:inline>
541 </xsl:template>
542
543 <xsl:template match="d:edition" mode="bibliography.mode">
544   <fo:inline>
545     <xsl:apply-templates mode="bibliography.mode"/>
546     <xsl:value-of select="$biblioentry.item.separator"/>
547   </fo:inline>
548 </xsl:template>
549
550 <xsl:template match="d:editor" mode="bibliography.mode">
551   <fo:inline>
552     <xsl:call-template name="person.name"/>
553     <xsl:value-of select="$biblioentry.item.separator"/>
554   </fo:inline>
555 </xsl:template>
556
557 <xsl:template match="d:firstname" mode="bibliography.mode">
558   <fo:inline>
559     <xsl:apply-templates mode="bibliography.mode"/>
560     <xsl:value-of select="$biblioentry.item.separator"/>
561   </fo:inline>
562 </xsl:template>
563
564 <xsl:template match="d:honorific" mode="bibliography.mode">
565   <fo:inline>
566     <xsl:apply-templates mode="bibliography.mode"/>
567     <xsl:value-of select="$biblioentry.item.separator"/>
568   </fo:inline>
569 </xsl:template>
570
571 <xsl:template match="d:indexterm" mode="bibliography.mode">
572   <xsl:apply-templates select="."/> 
573 </xsl:template>
574
575 <xsl:template match="d:invpartnumber" mode="bibliography.mode">
576   <fo:inline>
577     <xsl:apply-templates mode="bibliography.mode"/>
578     <xsl:value-of select="$biblioentry.item.separator"/>
579   </fo:inline>
580 </xsl:template>
581
582 <xsl:template match="d:isbn" mode="bibliography.mode">
583   <fo:inline>
584     <xsl:apply-templates mode="bibliography.mode"/>
585     <xsl:value-of select="$biblioentry.item.separator"/>
586   </fo:inline>
587 </xsl:template>
588
589 <xsl:template match="d:issn" mode="bibliography.mode">
590   <fo:inline>
591     <xsl:apply-templates mode="bibliography.mode"/>
592     <xsl:value-of select="$biblioentry.item.separator"/>
593   </fo:inline>
594 </xsl:template>
595
596 <xsl:template match="d:issuenum" mode="bibliography.mode">
597   <fo:inline>
598     <xsl:apply-templates mode="bibliography.mode"/>
599     <xsl:value-of select="$biblioentry.item.separator"/>
600   </fo:inline>
601 </xsl:template>
602
603 <xsl:template match="d:lineage" mode="bibliography.mode">
604   <fo:inline>
605     <xsl:apply-templates mode="bibliography.mode"/>
606     <xsl:value-of select="$biblioentry.item.separator"/>
607   </fo:inline>
608 </xsl:template>
609
610 <xsl:template match="d:orgname" mode="bibliography.mode">
611   <fo:inline>
612     <xsl:apply-templates mode="bibliography.mode"/>
613     <xsl:value-of select="$biblioentry.item.separator"/>
614   </fo:inline>
615 </xsl:template>
616
617 <xsl:template match="d:othercredit" mode="bibliography.mode">
618   <fo:inline>
619     <xsl:apply-templates mode="bibliography.mode"/>
620     <xsl:value-of select="$biblioentry.item.separator"/>
621   </fo:inline>
622 </xsl:template>
623
624 <xsl:template match="d:othername" mode="bibliography.mode">
625   <fo:inline>
626     <xsl:apply-templates mode="bibliography.mode"/>
627     <xsl:value-of select="$biblioentry.item.separator"/>
628   </fo:inline>
629 </xsl:template>
630
631 <xsl:template match="d:pagenums" mode="bibliography.mode">
632   <fo:inline>
633     <xsl:apply-templates mode="bibliography.mode"/>
634     <xsl:value-of select="$biblioentry.item.separator"/>
635   </fo:inline>
636 </xsl:template>
637
638 <xsl:template match="d:printhistory" mode="bibliography.mode">
639   <fo:inline>
640     <xsl:apply-templates mode="bibliography.mode"/>
641     <xsl:value-of select="$biblioentry.item.separator"/>
642   </fo:inline>
643 </xsl:template>
644
645 <xsl:template match="d:productname" mode="bibliography.mode">
646   <fo:inline>
647     <xsl:apply-templates mode="bibliography.mode"/>
648     <xsl:value-of select="$biblioentry.item.separator"/>
649   </fo:inline>
650 </xsl:template>
651
652 <xsl:template match="d:productnumber" mode="bibliography.mode">
653   <fo:inline>
654     <xsl:apply-templates mode="bibliography.mode"/>
655     <xsl:value-of select="$biblioentry.item.separator"/>
656   </fo:inline>
657 </xsl:template>
658
659 <xsl:template match="d:pubdate" mode="bibliography.mode">
660   <fo:inline>
661     <xsl:apply-templates mode="bibliography.mode"/>
662     <xsl:value-of select="$biblioentry.item.separator"/>
663   </fo:inline>
664 </xsl:template>
665
666 <xsl:template match="d:publisher" mode="bibliography.mode">
667   <fo:inline>
668     <xsl:apply-templates mode="bibliography.mode"/>
669   </fo:inline>
670 </xsl:template>
671
672 <xsl:template match="d:publishername" mode="bibliography.mode">
673   <fo:inline>
674     <xsl:apply-templates mode="bibliography.mode"/>
675     <xsl:value-of select="$biblioentry.item.separator"/>
676   </fo:inline>
677 </xsl:template>
678
679 <xsl:template match="d:pubsnumber" mode="bibliography.mode">
680   <fo:inline>
681     <xsl:apply-templates mode="bibliography.mode"/>
682     <xsl:value-of select="$biblioentry.item.separator"/>
683   </fo:inline>
684 </xsl:template>
685
686 <xsl:template match="d:releaseinfo" mode="bibliography.mode">
687   <fo:inline>
688     <xsl:apply-templates mode="bibliography.mode"/>
689     <xsl:value-of select="$biblioentry.item.separator"/>
690   </fo:inline>
691 </xsl:template>
692
693 <xsl:template match="d:revhistory" mode="bibliography.mode">
694   <fo:block>
695     <xsl:apply-templates select="."/> <!-- use normal mode -->
696   </fo:block>
697 </xsl:template>
698
699 <xsl:template match="d:seriesinfo" mode="bibliography.mode">
700   <fo:inline>
701     <xsl:apply-templates mode="bibliography.mode"/>
702   </fo:inline>
703 </xsl:template>
704
705 <xsl:template match="d:seriesvolnums" mode="bibliography.mode">
706   <fo:inline>
707     <xsl:apply-templates mode="bibliography.mode"/>
708     <xsl:value-of select="$biblioentry.item.separator"/>
709   </fo:inline>
710 </xsl:template>
711
712 <xsl:template match="d:subtitle" mode="bibliography.mode">
713   <fo:inline>
714     <xsl:apply-templates mode="bibliography.mode"/>
715     <xsl:value-of select="$biblioentry.item.separator"/>
716   </fo:inline>
717 </xsl:template>
718
719 <xsl:template match="d:surname" mode="bibliography.mode">
720   <fo:inline>
721     <xsl:apply-templates mode="bibliography.mode"/>
722     <xsl:value-of select="$biblioentry.item.separator"/>
723   </fo:inline>
724 </xsl:template>
725
726 <xsl:template match="d:title" mode="bibliography.mode">
727   <fo:inline>
728     <fo:inline font-style="italic">
729       <xsl:apply-templates mode="bibliography.mode"/>
730     </fo:inline>
731     <xsl:value-of select="$biblioentry.item.separator"/>
732   </fo:inline>
733 </xsl:template>
734
735 <xsl:template match="d:titleabbrev" mode="bibliography.mode">
736   <fo:inline>
737     <xsl:apply-templates mode="bibliography.mode"/>
738     <xsl:value-of select="$biblioentry.item.separator"/>
739   </fo:inline>
740 </xsl:template>
741
742 <xsl:template match="d:volumenum" mode="bibliography.mode">
743   <fo:inline>
744     <xsl:apply-templates mode="bibliography.mode"/>
745     <xsl:value-of select="$biblioentry.item.separator"/>
746   </fo:inline>
747 </xsl:template>
748
749 <xsl:template match="d:orgdiv" mode="bibliography.mode">
750   <fo:inline>
751     <xsl:apply-templates mode="bibliography.mode"/>
752     <xsl:value-of select="$biblioentry.item.separator"/>
753   </fo:inline>
754 </xsl:template>
755
756 <xsl:template match="d:collabname" mode="bibliography.mode">
757   <fo:inline>
758     <xsl:apply-templates mode="bibliography.mode"/>
759     <xsl:value-of select="$biblioentry.item.separator"/>
760   </fo:inline>
761 </xsl:template>
762
763 <xsl:template match="d:confdates" mode="bibliography.mode">
764   <fo:inline>
765     <xsl:apply-templates mode="bibliography.mode"/>
766     <xsl:value-of select="$biblioentry.item.separator"/>
767   </fo:inline>
768 </xsl:template>
769
770 <xsl:template match="d:conftitle" mode="bibliography.mode">
771   <fo:inline>
772     <xsl:apply-templates mode="bibliography.mode"/>
773     <xsl:value-of select="$biblioentry.item.separator"/>
774   </fo:inline>
775 </xsl:template>
776
777 <xsl:template match="d:confnum" mode="bibliography.mode">
778   <fo:inline>
779     <xsl:apply-templates mode="bibliography.mode"/>
780     <xsl:value-of select="$biblioentry.item.separator"/>
781   </fo:inline>
782 </xsl:template>
783
784 <xsl:template match="d:confsponsor" mode="bibliography.mode">
785   <fo:inline>
786     <xsl:apply-templates mode="bibliography.mode"/>
787     <xsl:value-of select="$biblioentry.item.separator"/>
788   </fo:inline>
789 </xsl:template>
790
791 <xsl:template match="d:bibliocoverage|d:biblioid|d:bibliorelation|d:bibliosource"
792               mode="bibliography.mode">
793   <fo:inline>
794     <xsl:apply-templates mode="bibliography.mode"/>
795     <xsl:value-of select="$biblioentry.item.separator"/>
796   </fo:inline>
797 </xsl:template>
798
799 <!-- ==================================================================== -->
800
801 <xsl:template match="*" mode="bibliomixed.mode">
802   <xsl:apply-templates select="."/><!-- try the default mode -->
803 </xsl:template>
804
805 <xsl:template match="d:abbrev" mode="bibliomixed.mode">
806   <xsl:if test="preceding-sibling::*">
807     <fo:inline>
808       <xsl:apply-templates mode="bibliomixed.mode"/>
809     </fo:inline>
810   </xsl:if>
811 </xsl:template>
812
813 <xsl:template match="d:abstract" mode="bibliomixed.mode">
814   <fo:block start-indent="1in">
815     <xsl:apply-templates mode="bibliomixed.mode"/>
816   </fo:block>
817 </xsl:template>
818
819 <xsl:template match="d:para" mode="bibliomixed.mode">
820   <fo:block>
821     <xsl:apply-templates mode="bibliomixed.mode"/>
822   </fo:block>
823 </xsl:template>
824
825 <xsl:template match="d:address" mode="bibliomixed.mode">
826   <fo:inline>
827     <xsl:apply-templates mode="bibliomixed.mode"/>
828   </fo:inline>
829 </xsl:template>
830
831 <xsl:template match="d:affiliation" mode="bibliomixed.mode">
832   <fo:inline>
833     <xsl:apply-templates mode="bibliomixed.mode"/>
834   </fo:inline>
835 </xsl:template>
836
837 <xsl:template match="d:shortaffil" mode="bibliomixed.mode">
838   <fo:inline>
839     <xsl:apply-templates mode="bibliography.mode"/>
840   </fo:inline>
841 </xsl:template>
842
843 <xsl:template match="d:jobtitle" mode="bibliomixed.mode">
844   <fo:inline>
845     <xsl:apply-templates mode="bibliography.mode"/>
846   </fo:inline>
847 </xsl:template>
848
849 <xsl:template match="d:artpagenums" mode="bibliomixed.mode">
850   <fo:inline>
851     <xsl:apply-templates mode="bibliomixed.mode"/>
852   </fo:inline>
853 </xsl:template>
854
855 <xsl:template match="d:author" mode="bibliomixed.mode">
856   <fo:inline>
857     <xsl:choose>
858       <xsl:when test="d:orgname">
859         <xsl:apply-templates select="d:orgname" mode="bibliomixed.mode"/>
860       </xsl:when>
861       <xsl:otherwise>
862         <xsl:call-template name="person.name"/>
863       </xsl:otherwise>
864     </xsl:choose>
865   </fo:inline>
866 </xsl:template>
867
868 <xsl:template match="d:authorblurb|d:personblurb" mode="bibliomixed.mode">
869   <fo:inline>
870     <xsl:apply-templates mode="bibliomixed.mode"/>
871   </fo:inline>
872 </xsl:template>
873
874 <xsl:template match="d:authorgroup" mode="bibliomixed.mode">
875   <fo:inline>
876     <xsl:apply-templates mode="bibliomixed.mode"/>
877   </fo:inline>
878 </xsl:template>
879
880 <xsl:template match="d:authorinitials" mode="bibliomixed.mode">
881   <fo:inline>
882     <xsl:apply-templates mode="bibliomixed.mode"/>
883   </fo:inline>
884 </xsl:template>
885
886 <xsl:template match="d:bibliomisc" mode="bibliomixed.mode">
887   <fo:inline>
888     <xsl:apply-templates mode="bibliomixed.mode"/>
889   </fo:inline>
890 </xsl:template>
891
892 <!-- ================================================== -->
893
894 <xsl:template match="d:bibliomset" mode="bibliomixed.mode">
895   <fo:inline>
896     <xsl:apply-templates mode="bibliomixed.mode"/>
897   </fo:inline>
898 </xsl:template>
899
900 <xsl:template match="d:bibliomset/d:title|d:bibliomset/d:citetitle" 
901               mode="bibliomixed.mode">
902   <xsl:variable name="relation" select="../@relation"/>
903   <xsl:choose>
904     <xsl:when test="$relation='article' or @pubwork='article'">
905       <xsl:call-template name="gentext.startquote"/>
906       <xsl:apply-templates mode="bibliomixed.mode"/>
907       <xsl:call-template name="gentext.endquote"/>
908     </xsl:when>
909     <xsl:otherwise>
910       <fo:inline font-style="italic">
911         <xsl:apply-templates/>
912       </fo:inline>
913     </xsl:otherwise>
914   </xsl:choose>
915 </xsl:template>
916
917 <!-- ================================================== -->
918
919 <xsl:template match="d:biblioset" mode="bibliomixed.mode">
920   <fo:inline>
921     <xsl:apply-templates mode="bibliomixed.mode"/>
922   </fo:inline>
923 </xsl:template>
924
925 <xsl:template match="d:citetitle" mode="bibliomixed.mode">
926   <xsl:choose>
927     <xsl:when test="@pubwork = 'article'">
928       <xsl:call-template name="gentext.startquote"/>
929       <xsl:apply-templates mode="bibliomixed.mode"/>
930       <xsl:call-template name="gentext.endquote"/>
931     </xsl:when>
932     <xsl:otherwise>
933       <fo:inline font-style="italic">
934         <xsl:apply-templates mode="bibliography.mode"/>
935       </fo:inline>
936     </xsl:otherwise>
937   </xsl:choose>
938 </xsl:template>
939
940 <xsl:template match="d:collab" mode="bibliomixed.mode">
941   <fo:inline>
942     <xsl:apply-templates mode="bibliomixed.mode"/>
943   </fo:inline>
944 </xsl:template>
945
946 <xsl:template match="d:confgroup" mode="bibliomixed.mode">
947   <fo:inline>
948     <xsl:apply-templates mode="bibliomixed.mode"/>
949   </fo:inline>
950 </xsl:template>
951
952 <xsl:template match="d:contractnum" mode="bibliomixed.mode">
953   <fo:inline>
954     <xsl:apply-templates mode="bibliomixed.mode"/>
955   </fo:inline>
956 </xsl:template>
957
958 <xsl:template match="d:contractsponsor" mode="bibliomixed.mode">
959   <fo:inline>
960     <xsl:apply-templates mode="bibliomixed.mode"/>
961   </fo:inline>
962 </xsl:template>
963
964 <xsl:template match="d:contrib" mode="bibliomixed.mode">
965   <fo:inline>
966     <xsl:apply-templates mode="bibliomixed.mode"/>
967   </fo:inline>
968 </xsl:template>
969
970 <xsl:template match="d:copyright" mode="bibliomixed.mode">
971   <fo:inline>
972     <xsl:apply-templates mode="bibliomixed.mode"/>
973   </fo:inline>
974 </xsl:template>
975
976 <xsl:template match="d:corpauthor" mode="bibliomixed.mode">
977   <fo:inline>
978     <xsl:apply-templates mode="bibliomixed.mode"/>
979   </fo:inline>
980 </xsl:template>
981
982 <xsl:template match="d:corpcredit" mode="bibliomixed.mode">
983   <fo:inline>
984     <xsl:apply-templates mode="bibliomixed.mode"/>
985   </fo:inline>
986 </xsl:template>
987
988 <xsl:template match="d:corpname" mode="bibliomixed.mode">
989   <fo:inline>
990     <xsl:apply-templates mode="bibliomixed.mode"/>
991   </fo:inline>
992 </xsl:template>
993
994 <xsl:template match="d:date" mode="bibliomixed.mode">
995   <fo:inline>
996     <xsl:apply-templates mode="bibliomixed.mode"/>
997   </fo:inline>
998 </xsl:template>
999
1000 <xsl:template match="d:edition" mode="bibliomixed.mode">
1001   <fo:inline>
1002     <xsl:apply-templates mode="bibliomixed.mode"/>
1003   </fo:inline>
1004 </xsl:template>
1005
1006 <xsl:template match="d:editor" mode="bibliomixed.mode">
1007   <fo:inline>
1008     <xsl:apply-templates mode="bibliomixed.mode"/>
1009   </fo:inline>
1010 </xsl:template>
1011
1012 <xsl:template match="d:firstname" mode="bibliomixed.mode">
1013   <fo:inline>
1014     <xsl:apply-templates mode="bibliomixed.mode"/>
1015   </fo:inline>
1016 </xsl:template>
1017
1018 <xsl:template match="d:honorific" mode="bibliomixed.mode">
1019   <fo:inline>
1020     <xsl:apply-templates mode="bibliomixed.mode"/>
1021   </fo:inline>
1022 </xsl:template>
1023
1024 <xsl:template match="d:indexterm" mode="bibliomixed.mode">
1025   <xsl:apply-templates select="."/> 
1026 </xsl:template>
1027
1028 <xsl:template match="d:invpartnumber" mode="bibliomixed.mode">
1029   <fo:inline>
1030     <xsl:apply-templates mode="bibliomixed.mode"/>
1031   </fo:inline>
1032 </xsl:template>
1033
1034 <xsl:template match="d:isbn" mode="bibliomixed.mode">
1035   <fo:inline>
1036     <xsl:apply-templates mode="bibliomixed.mode"/>
1037   </fo:inline>
1038 </xsl:template>
1039
1040 <xsl:template match="d:issn" mode="bibliomixed.mode">
1041   <fo:inline>
1042     <xsl:apply-templates mode="bibliomixed.mode"/>
1043   </fo:inline>
1044 </xsl:template>
1045
1046 <xsl:template match="d:issuenum" mode="bibliomixed.mode">
1047   <fo:inline>
1048     <xsl:apply-templates mode="bibliomixed.mode"/>
1049   </fo:inline>
1050 </xsl:template>
1051
1052 <xsl:template match="d:lineage" mode="bibliomixed.mode">
1053   <fo:inline>
1054     <xsl:apply-templates mode="bibliomixed.mode"/>
1055   </fo:inline>
1056 </xsl:template>
1057
1058 <xsl:template match="d:orgname" mode="bibliomixed.mode">
1059   <fo:inline>
1060     <xsl:apply-templates mode="bibliomixed.mode"/>
1061   </fo:inline>
1062 </xsl:template>
1063
1064 <xsl:template match="d:othercredit" mode="bibliomixed.mode">
1065   <fo:inline>
1066     <xsl:apply-templates mode="bibliomixed.mode"/>
1067   </fo:inline>
1068 </xsl:template>
1069
1070 <xsl:template match="d:othername" mode="bibliomixed.mode">
1071   <fo:inline>
1072     <xsl:apply-templates mode="bibliomixed.mode"/>
1073   </fo:inline>
1074 </xsl:template>
1075
1076 <xsl:template match="d:pagenums" mode="bibliomixed.mode">
1077   <fo:inline>
1078     <xsl:apply-templates mode="bibliomixed.mode"/>
1079   </fo:inline>
1080 </xsl:template>
1081
1082 <xsl:template match="d:printhistory" mode="bibliomixed.mode">
1083   <fo:inline>
1084     <xsl:apply-templates mode="bibliomixed.mode"/>
1085   </fo:inline>
1086 </xsl:template>
1087
1088 <xsl:template match="d:productname" mode="bibliomixed.mode">
1089   <fo:inline>
1090     <xsl:apply-templates mode="bibliomixed.mode"/>
1091   </fo:inline>
1092 </xsl:template>
1093
1094 <xsl:template match="d:productnumber" mode="bibliomixed.mode">
1095   <fo:inline>
1096     <xsl:apply-templates mode="bibliomixed.mode"/>
1097   </fo:inline>
1098 </xsl:template>
1099
1100 <xsl:template match="d:pubdate" mode="bibliomixed.mode">
1101   <fo:inline>
1102     <xsl:apply-templates mode="bibliomixed.mode"/>
1103   </fo:inline>
1104 </xsl:template>
1105
1106 <xsl:template match="d:publisher" mode="bibliomixed.mode">
1107   <fo:inline>
1108     <xsl:apply-templates mode="bibliomixed.mode"/>
1109   </fo:inline>
1110 </xsl:template>
1111
1112 <xsl:template match="d:publishername" mode="bibliomixed.mode">
1113   <fo:inline>
1114     <xsl:apply-templates mode="bibliomixed.mode"/>
1115   </fo:inline>
1116 </xsl:template>
1117
1118 <xsl:template match="d:pubsnumber" mode="bibliomixed.mode">
1119   <fo:inline>
1120     <xsl:apply-templates mode="bibliomixed.mode"/>
1121   </fo:inline>
1122 </xsl:template>
1123
1124 <xsl:template match="d:releaseinfo" mode="bibliomixed.mode">
1125   <fo:inline>
1126     <xsl:apply-templates mode="bibliomixed.mode"/>
1127   </fo:inline>
1128 </xsl:template>
1129
1130 <xsl:template match="d:revhistory" mode="bibliomixed.mode">
1131   <fo:inline>
1132     <xsl:apply-templates mode="bibliomixed.mode"/>
1133   </fo:inline>
1134 </xsl:template>
1135
1136 <xsl:template match="d:seriesvolnums" mode="bibliomixed.mode">
1137   <fo:inline>
1138     <xsl:apply-templates mode="bibliomixed.mode"/>
1139   </fo:inline>
1140 </xsl:template>
1141
1142 <xsl:template match="d:subtitle" mode="bibliomixed.mode">
1143   <fo:inline>
1144     <xsl:apply-templates mode="bibliomixed.mode"/>
1145   </fo:inline>
1146 </xsl:template>
1147
1148 <xsl:template match="d:surname" mode="bibliomixed.mode">
1149   <fo:inline>
1150     <xsl:apply-templates mode="bibliomixed.mode"/>
1151   </fo:inline>
1152 </xsl:template>
1153
1154 <xsl:template match="d:title" mode="bibliomixed.mode">
1155   <fo:inline>
1156     <xsl:apply-templates mode="bibliomixed.mode"/>
1157   </fo:inline>
1158 </xsl:template>
1159
1160 <xsl:template match="d:titleabbrev" mode="bibliomixed.mode">
1161   <fo:inline>
1162     <xsl:apply-templates mode="bibliomixed.mode"/>
1163   </fo:inline>
1164 </xsl:template>
1165
1166 <xsl:template match="d:volumenum" mode="bibliomixed.mode">
1167   <fo:inline>
1168     <xsl:apply-templates mode="bibliomixed.mode"/>
1169   </fo:inline>
1170 </xsl:template>
1171
1172 <xsl:template match="d:bibliocoverage|d:biblioid|d:bibliorelation|d:bibliosource"
1173               mode="bibliomixed.mode">
1174   <fo:inline>
1175     <xsl:apply-templates mode="bibliomixed.mode"/>
1176   </fo:inline>
1177 </xsl:template>
1178
1179 <!-- ==================================================================== -->
1180
1181 </xsl:stylesheet>