Imported Upstream version 1.79.0
[platform/upstream/docbook-xsl-stylesheets.git] / fo / inline.xsl
1 <?xml version='1.0'?>
2 <!DOCTYPE xsl:stylesheet [
3 <!ENTITY % common.entities SYSTEM "../common/entities.ent">
4 %common.entities;
5 ]>
6 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
7                 xmlns:fo="http://www.w3.org/1999/XSL/Format"
8                 xmlns:xlink='http://www.w3.org/1999/xlink'
9                 exclude-result-prefixes="xlink"
10                 version='1.0'>
11
12 <!-- ********************************************************************
13      $Id: inline.xsl 9963 2015-05-20 18:37:42Z bobstayton $
14      ********************************************************************
15
16      This file is part of the XSL DocBook Stylesheet distribution.
17      See ../README or http://docbook.sf.net/release/xsl/current/ for
18      copyright and other information.
19
20      ******************************************************************** -->
21
22 <xsl:key name="glossentries" match="glossentry" use="normalize-space(glossterm)"/>
23 <xsl:key name="glossentries" match="glossentry" use="normalize-space(glossterm/@baseform)"/>
24
25 <xsl:template name="simple.xlink">
26   <xsl:param name="node" select="."/>
27   <xsl:param name="content">
28     <xsl:apply-templates/>
29   </xsl:param>
30   <xsl:param name="linkend" select="$node/@linkend"/>
31   <xsl:param name="xhref" select="$node/@xlink:href"/>
32
33   <!-- check for nested links, which are undefined in the output -->
34   <xsl:if test="($linkend or $xhref) and $node/ancestor::*[@xlink:href or @linkend]">
35     <xsl:message>
36       <xsl:text>WARNING: nested link may be undefined in output: </xsl:text>
37       <xsl:text>&lt;</xsl:text>
38       <xsl:value-of select="name($node)"/>
39       <xsl:text> </xsl:text>
40       <xsl:choose>
41         <xsl:when test="$linkend">
42           <xsl:text>@linkend = '</xsl:text>
43           <xsl:value-of select="$linkend"/>
44           <xsl:text>'&gt;</xsl:text>
45         </xsl:when>
46         <xsl:when test="$xhref">
47           <xsl:text>@xlink:href = '</xsl:text>
48           <xsl:value-of select="$xhref"/>
49           <xsl:text>'&gt;</xsl:text>
50         </xsl:when>
51       </xsl:choose>
52       <xsl:text> nested inside parent element </xsl:text>
53       <xsl:value-of select="name($node/parent::*)"/>
54     </xsl:message>
55   </xsl:if>
56
57   <xsl:choose>
58     <xsl:when test="$xhref
59                     and (not($node/@xlink:type) or 
60                          $node/@xlink:type='simple')">
61
62       <!-- Is it a local idref? -->
63       <xsl:variable name="is.idref">
64         <xsl:choose>
65           <!-- if the href starts with # and does not contain an "(" -->
66           <!-- or if the href starts with #xpointer(id(, it's just an ID -->
67           <xsl:when test="starts-with($xhref,'#')
68                           and (not(contains($xhref,'&#40;'))
69                           or starts-with($xhref,
70                                      '#xpointer&#40;id&#40;'))">1</xsl:when>
71           <xsl:otherwise>0</xsl:otherwise>
72         </xsl:choose>
73       </xsl:variable>
74
75       <!-- Is it an olink ? -->
76       <xsl:variable name="is.olink">
77         <xsl:choose>
78           <!-- If xlink:role="http://docbook.org/xlink/role/olink" -->
79           <!-- and if the href contains # -->
80           <xsl:when test="contains($xhref,'#') and
81                @xlink:role = $xolink.role">1</xsl:when>
82           <xsl:otherwise>0</xsl:otherwise>
83         </xsl:choose>
84       </xsl:variable>
85
86       <xsl:choose>
87         <xsl:when test="$is.olink = 1">
88           <xsl:call-template name="olink">
89             <xsl:with-param name="content" select="$content"/>
90           </xsl:call-template>
91         </xsl:when>
92
93         <xsl:when test="$is.idref = 1">
94
95           <xsl:variable name="idref">
96             <xsl:call-template name="xpointer.idref">
97               <xsl:with-param name="xpointer" select="$xhref"/>
98             </xsl:call-template>
99           </xsl:variable>
100
101           <xsl:variable name="targets" select="key('id',$idref)"/>
102           <xsl:variable name="target" select="$targets[1]"/>
103
104           <xsl:call-template name="check.id.unique">
105             <xsl:with-param name="linkend" select="$idref"/>
106           </xsl:call-template>
107
108           <xsl:choose>
109             <xsl:when test="count($target) = 0">
110               <xsl:message>
111                 <xsl:text>XLink to nonexistent id: </xsl:text>
112                 <xsl:value-of select="$idref"/>
113               </xsl:message>
114               <xsl:copy-of select="$content"/>
115             </xsl:when>
116
117             <xsl:otherwise>
118               <fo:basic-link internal-destination="{$idref}">
119                 <xsl:apply-templates select="." mode="simple.xlink.properties"/>
120                 <xsl:copy-of select="$content"/>
121               </fo:basic-link>
122             </xsl:otherwise>
123           </xsl:choose>
124         </xsl:when>
125
126         <!-- otherwise it's a URI -->
127         <xsl:otherwise>
128           <fo:basic-link external-destination="url({$xhref})">
129             <xsl:apply-templates select="." mode="simple.xlink.properties"/>
130             <xsl:copy-of select="$content"/>
131           </fo:basic-link>
132           <!-- * Call the template for determining whether the URL for this -->
133           <!-- * hyperlink is displayed, and how to display it (either inline or -->
134           <!-- * as a numbered footnote). -->
135           <xsl:call-template name="hyperlink.url.display">
136             <xsl:with-param name="url" select="$xhref"/>
137           </xsl:call-template>
138         </xsl:otherwise>
139       </xsl:choose>
140     </xsl:when>
141
142     <xsl:when test="$linkend">
143       <xsl:variable name="targets" select="key('id',$linkend)"/>
144       <xsl:variable name="target" select="$targets[1]"/>
145
146       <xsl:call-template name="check.id.unique">
147         <xsl:with-param name="linkend" select="$linkend"/>
148       </xsl:call-template>
149
150       <xsl:choose>
151         <xsl:when test="count($target) = 0">
152           <xsl:message>
153             <xsl:text>XLink to nonexistent id: </xsl:text>
154             <xsl:value-of select="$linkend"/>
155           </xsl:message>
156           <xsl:copy-of select="$content"/>
157         </xsl:when>
158
159         <xsl:otherwise>
160           <fo:basic-link internal-destination="{$linkend}">
161             <xsl:apply-templates select="." mode="simple.xlink.properties"/>
162             <xsl:copy-of select="$content"/>
163           </fo:basic-link>
164         </xsl:otherwise>
165       </xsl:choose>
166     </xsl:when>
167
168     <xsl:otherwise>
169       <xsl:copy-of select="$content"/>
170     </xsl:otherwise>
171   </xsl:choose>
172 </xsl:template>
173
174 <xsl:template name="inline.sansseq">
175   <xsl:param name="content">
176     <xsl:apply-templates/>
177   </xsl:param>
178
179   <xsl:param name="contentwithlink">
180     <xsl:call-template name="simple.xlink">
181       <xsl:with-param name="content" select="$content"/>
182     </xsl:call-template>
183   </xsl:param>
184
185   <fo:inline font-family="{$sans.font.family}">
186     <xsl:choose>
187       <xsl:when test="@dir">
188         <fo:inline>
189           <xsl:attribute name="direction">
190             <xsl:choose>
191               <xsl:when test="@dir = 'ltr' or @dir = 'lro'">ltr</xsl:when>
192               <xsl:otherwise>rtl</xsl:otherwise>
193             </xsl:choose>
194           </xsl:attribute>
195           <xsl:copy-of select="$contentwithlink"/>
196         </fo:inline>
197       </xsl:when>
198       <xsl:otherwise>
199         <xsl:copy-of select="$contentwithlink"/>
200       </xsl:otherwise>
201     </xsl:choose>
202   </fo:inline>
203 </xsl:template>
204
205 <xsl:template name="inline.charseq">
206   <xsl:param name="content">
207     <xsl:apply-templates/>
208   </xsl:param>
209
210   <xsl:param name="contentwithlink">
211     <xsl:call-template name="simple.xlink">
212       <xsl:with-param name="content" select="$content"/>
213     </xsl:call-template>
214   </xsl:param>
215
216   <xsl:choose>
217     <xsl:when test="@dir">
218       <fo:inline>
219         <xsl:attribute name="direction">
220           <xsl:choose>
221             <xsl:when test="@dir = 'ltr' or @dir = 'lro'">ltr</xsl:when>
222             <xsl:otherwise>rtl</xsl:otherwise>
223           </xsl:choose>
224         </xsl:attribute>
225         <xsl:copy-of select="$contentwithlink"/>
226       </fo:inline>
227     </xsl:when>
228     <xsl:otherwise>
229       <xsl:copy-of select="$contentwithlink"/>
230     </xsl:otherwise>
231   </xsl:choose>
232 </xsl:template>
233
234 <xsl:template name="inline.monoseq">
235   <xsl:param name="content">
236     <xsl:apply-templates/>
237   </xsl:param>
238
239   <xsl:param name="contentwithlink">
240     <xsl:call-template name="simple.xlink">
241       <xsl:with-param name="content" select="$content"/>
242     </xsl:call-template>
243   </xsl:param>
244
245
246   <fo:inline xsl:use-attribute-sets="monospace.properties">
247     <xsl:call-template name="anchor"/>
248     <xsl:if test="@dir">
249       <xsl:attribute name="direction">
250         <xsl:choose>
251           <xsl:when test="@dir = 'ltr' or @dir = 'lro'">ltr</xsl:when>
252           <xsl:otherwise>rtl</xsl:otherwise>
253         </xsl:choose>
254       </xsl:attribute>
255     </xsl:if>
256     <xsl:copy-of select="$contentwithlink"/>
257   </fo:inline>
258 </xsl:template>
259
260 <xsl:template name="inline.boldseq">
261   <xsl:param name="content">
262     <xsl:apply-templates/>
263   </xsl:param>
264
265   <xsl:param name="contentwithlink">
266     <xsl:call-template name="simple.xlink">
267       <xsl:with-param name="content" select="$content"/>
268     </xsl:call-template>
269   </xsl:param>
270
271   <fo:inline font-weight="bold">
272     <xsl:if test="@dir">
273       <xsl:attribute name="direction">
274         <xsl:choose>
275           <xsl:when test="@dir = 'ltr' or @dir = 'lro'">ltr</xsl:when>
276           <xsl:otherwise>rtl</xsl:otherwise>
277         </xsl:choose>
278       </xsl:attribute>
279     </xsl:if>
280     <xsl:copy-of select="$contentwithlink"/>
281   </fo:inline>
282 </xsl:template>
283
284 <xsl:template name="inline.italicseq">
285   <xsl:param name="content">
286     <xsl:apply-templates/>
287   </xsl:param>
288
289   <xsl:param name="contentwithlink">
290     <xsl:call-template name="simple.xlink">
291       <xsl:with-param name="content" select="$content"/>
292     </xsl:call-template>
293   </xsl:param>
294
295   <fo:inline font-style="italic">
296     <xsl:call-template name="anchor"/>
297     <xsl:if test="@dir">
298       <xsl:attribute name="direction">
299         <xsl:choose>
300           <xsl:when test="@dir = 'ltr' or @dir = 'lro'">ltr</xsl:when>
301           <xsl:otherwise>rtl</xsl:otherwise>
302         </xsl:choose>
303       </xsl:attribute>
304     </xsl:if>
305     <xsl:copy-of select="$contentwithlink"/>
306   </fo:inline>
307 </xsl:template>
308
309 <xsl:template name="inline.boldmonoseq">
310   <xsl:param name="content">
311     <xsl:apply-templates/>
312   </xsl:param>
313
314   <xsl:param name="contentwithlink">
315     <xsl:call-template name="simple.xlink">
316       <xsl:with-param name="content" select="$content"/>
317     </xsl:call-template>
318   </xsl:param>
319
320   <fo:inline font-weight="bold" xsl:use-attribute-sets="monospace.properties">
321     <xsl:call-template name="anchor"/>
322     <xsl:if test="@dir">
323       <xsl:attribute name="direction">
324         <xsl:choose>
325           <xsl:when test="@dir = 'ltr' or @dir = 'lro'">ltr</xsl:when>
326           <xsl:otherwise>rtl</xsl:otherwise>
327         </xsl:choose>
328       </xsl:attribute>
329     </xsl:if>
330     <xsl:copy-of select="$contentwithlink"/>
331   </fo:inline>
332 </xsl:template>
333
334 <xsl:template name="inline.italicmonoseq">
335   <xsl:param name="content">
336     <xsl:apply-templates/>
337   </xsl:param>
338
339   <xsl:param name="contentwithlink">
340     <xsl:call-template name="simple.xlink">
341       <xsl:with-param name="content" select="$content"/>
342     </xsl:call-template>
343   </xsl:param>
344
345   <fo:inline font-style="italic" xsl:use-attribute-sets="monospace.properties">
346     <xsl:call-template name="anchor"/>
347     <xsl:if test="@dir">
348       <xsl:attribute name="direction">
349         <xsl:choose>
350           <xsl:when test="@dir = 'ltr' or @dir = 'lro'">ltr</xsl:when>
351           <xsl:otherwise>rtl</xsl:otherwise>
352         </xsl:choose>
353       </xsl:attribute>
354     </xsl:if>
355     <xsl:copy-of select="$contentwithlink"/>
356   </fo:inline>
357 </xsl:template>
358
359 <xsl:template name="inline.superscriptseq">
360   <xsl:param name="content">
361     <xsl:apply-templates/>
362   </xsl:param>
363
364   <xsl:param name="contentwithlink">
365     <xsl:call-template name="simple.xlink">
366       <xsl:with-param name="content" select="$content"/>
367     </xsl:call-template>
368   </xsl:param>
369
370   <fo:inline xsl:use-attribute-sets="superscript.properties">
371     <xsl:call-template name="anchor"/>
372     <xsl:if test="@dir">
373       <xsl:attribute name="direction">
374         <xsl:choose>
375           <xsl:when test="@dir = 'ltr' or @dir = 'lro'">ltr</xsl:when>
376           <xsl:otherwise>rtl</xsl:otherwise>
377         </xsl:choose>
378       </xsl:attribute>
379     </xsl:if>
380     <xsl:choose>
381       <xsl:when test="$fop.extensions != 0">
382         <xsl:attribute name="vertical-align">super</xsl:attribute>
383       </xsl:when>
384       <xsl:otherwise>
385         <xsl:attribute name="baseline-shift">super</xsl:attribute>
386       </xsl:otherwise>
387     </xsl:choose>
388     <xsl:copy-of select="$contentwithlink"/>
389   </fo:inline>
390 </xsl:template>
391
392 <xsl:template name="inline.subscriptseq">
393   <xsl:param name="content">
394     <xsl:apply-templates/>
395   </xsl:param>
396
397   <xsl:param name="contentwithlink">
398     <xsl:call-template name="simple.xlink">
399       <xsl:with-param name="content" select="$content"/>
400     </xsl:call-template>
401   </xsl:param>
402
403   <fo:inline xsl:use-attribute-sets="subscript.properties">
404     <xsl:call-template name="anchor"/>
405     <xsl:if test="@dir">
406       <xsl:attribute name="direction">
407         <xsl:choose>
408           <xsl:when test="@dir = 'ltr' or @dir = 'lro'">ltr</xsl:when>
409           <xsl:otherwise>rtl</xsl:otherwise>
410         </xsl:choose>
411       </xsl:attribute>
412     </xsl:if>
413     <xsl:choose>
414       <xsl:when test="$fop.extensions != 0">
415         <xsl:attribute name="vertical-align">sub</xsl:attribute>
416       </xsl:when>
417       <xsl:otherwise>
418         <xsl:attribute name="baseline-shift">sub</xsl:attribute>
419       </xsl:otherwise>
420     </xsl:choose>
421     <xsl:copy-of select="$contentwithlink"/>
422   </fo:inline>
423 </xsl:template>
424
425 <!-- ==================================================================== -->
426 <!-- some special cases -->
427
428 <xsl:template match="author">
429   <xsl:call-template name="simple.xlink">
430     <xsl:with-param name="content">
431       <xsl:call-template name="person.name"/>
432     </xsl:with-param>
433   </xsl:call-template>
434 </xsl:template>
435
436 <xsl:template match="editor">
437   <xsl:call-template name="simple.xlink">
438     <xsl:with-param name="content">
439       <xsl:call-template name="person.name"/>
440     </xsl:with-param>
441   </xsl:call-template>
442 </xsl:template>
443
444 <xsl:template match="othercredit">
445   <xsl:call-template name="simple.xlink">
446     <xsl:with-param name="content">
447       <xsl:call-template name="person.name"/>
448     </xsl:with-param>
449   </xsl:call-template>
450 </xsl:template>
451
452 <xsl:template match="authorinitials">
453   <xsl:call-template name="inline.charseq"/>
454 </xsl:template>
455
456 <!-- ==================================================================== -->
457
458 <xsl:template match="accel">
459   <xsl:call-template name="inline.charseq"/>
460 </xsl:template>
461
462 <xsl:template match="action">
463   <xsl:call-template name="inline.charseq"/>
464 </xsl:template>
465
466 <xsl:template match="application">
467   <xsl:call-template name="inline.charseq"/>
468 </xsl:template>
469
470 <xsl:template match="classname">
471   <xsl:call-template name="inline.monoseq"/>
472 </xsl:template>
473
474 <xsl:template match="exceptionname">
475   <xsl:call-template name="inline.monoseq"/>
476 </xsl:template>
477
478 <xsl:template match="interfacename">
479   <xsl:call-template name="inline.monoseq"/>
480 </xsl:template>
481
482 <xsl:template match="methodname">
483   <xsl:call-template name="inline.monoseq"/>
484 </xsl:template>
485
486 <xsl:template match="command">
487   <xsl:call-template name="inline.boldseq"/>
488 </xsl:template>
489
490 <xsl:template match="computeroutput">
491   <xsl:call-template name="inline.monoseq"/>
492 </xsl:template>
493
494 <xsl:template match="constant">
495   <xsl:call-template name="inline.monoseq"/>
496 </xsl:template>
497
498 <xsl:template match="database">
499   <xsl:call-template name="inline.charseq"/>
500 </xsl:template>
501
502 <xsl:template match="date">
503   <!-- should this support locale-specific formatting? how? -->
504   <xsl:call-template name="inline.charseq"/>
505 </xsl:template>
506
507 <xsl:template match="errorcode">
508   <xsl:call-template name="inline.charseq"/>
509 </xsl:template>
510
511 <xsl:template match="errorname">
512   <xsl:call-template name="inline.charseq"/>
513 </xsl:template>
514
515 <xsl:template match="errortype">
516   <xsl:call-template name="inline.charseq"/>
517 </xsl:template>
518
519 <xsl:template match="errortext">
520   <xsl:call-template name="inline.charseq"/>
521 </xsl:template>
522
523 <xsl:template match="envar">
524   <xsl:call-template name="inline.monoseq"/>
525 </xsl:template>
526
527 <xsl:template match="filename">
528   <xsl:call-template name="inline.monoseq"/>
529 </xsl:template>
530
531 <xsl:template match="function">
532   <xsl:choose>
533     <xsl:when test="$function.parens != '0'
534                     and (parameter or function or replaceable)">
535       <xsl:variable name="nodes" select="text()|*"/>
536       <xsl:call-template name="inline.monoseq">
537         <xsl:with-param name="content">
538           <xsl:call-template name="simple.xlink">
539             <xsl:with-param name="content">
540               <xsl:apply-templates select="$nodes[1]"/>
541             </xsl:with-param>
542           </xsl:call-template>
543         </xsl:with-param>
544       </xsl:call-template>
545       <xsl:text>(</xsl:text>
546       <xsl:apply-templates select="$nodes[position()>1]"/>
547       <xsl:text>)</xsl:text>
548     </xsl:when>
549     <xsl:otherwise>
550      <xsl:call-template name="inline.monoseq"/>
551     </xsl:otherwise>
552   </xsl:choose>
553 </xsl:template>
554
555 <xsl:template match="function/parameter" priority="2">
556   <xsl:call-template name="inline.italicmonoseq"/>
557   <xsl:if test="$function.parens != 0 and following-sibling::*">
558     <xsl:text>, </xsl:text>
559   </xsl:if>
560 </xsl:template>
561
562 <xsl:template match="function/replaceable" priority="2">
563   <xsl:call-template name="inline.italicmonoseq"/>
564   <xsl:if test="$function.parens != 0 and following-sibling::*">
565     <xsl:text>, </xsl:text>
566   </xsl:if>
567 </xsl:template>
568
569 <xsl:template match="guibutton">
570   <xsl:call-template name="inline.charseq"/>
571 </xsl:template>
572
573 <xsl:template match="guiicon">
574   <xsl:call-template name="inline.charseq"/>
575 </xsl:template>
576
577 <xsl:template match="guilabel">
578   <xsl:call-template name="inline.charseq"/>
579 </xsl:template>
580
581 <xsl:template match="guimenu">
582   <xsl:call-template name="inline.charseq"/>
583 </xsl:template>
584
585 <xsl:template match="guimenuitem">
586   <xsl:call-template name="inline.charseq"/>
587 </xsl:template>
588
589 <xsl:template match="guisubmenu">
590   <xsl:call-template name="inline.charseq"/>
591 </xsl:template>
592
593 <xsl:template match="hardware">
594   <xsl:call-template name="inline.charseq"/>
595 </xsl:template>
596
597 <xsl:template match="interface">
598   <xsl:call-template name="inline.charseq"/>
599 </xsl:template>
600
601 <xsl:template match="interfacedefinition">
602   <xsl:call-template name="inline.charseq"/>
603 </xsl:template>
604
605 <xsl:template match="keycap">
606   <xsl:choose>
607     <xsl:when test="@function and normalize-space(.) = ''">
608       <xsl:call-template name="inline.boldseq">
609         <xsl:with-param name="content">
610           <xsl:call-template name="gentext.template">
611             <xsl:with-param name="context" select="'keycap'"/>
612             <xsl:with-param name="name" select="@function"/>
613           </xsl:call-template>
614         </xsl:with-param>
615       </xsl:call-template>
616     </xsl:when>
617     <xsl:otherwise>
618       <xsl:call-template name="inline.boldseq"/>
619     </xsl:otherwise>
620   </xsl:choose>
621 </xsl:template>
622
623 <xsl:template match="keycode">
624   <xsl:call-template name="inline.charseq"/>
625 </xsl:template>
626
627 <xsl:template match="keysym">
628   <xsl:call-template name="inline.charseq"/>
629 </xsl:template>
630
631 <xsl:template match="literal">
632   <xsl:call-template name="inline.monoseq"/>
633 </xsl:template>
634
635 <xsl:template match="code">
636   <xsl:call-template name="inline.monoseq"/>
637 </xsl:template>
638
639 <xsl:template match="medialabel">
640   <xsl:call-template name="inline.italicseq"/>
641 </xsl:template>
642
643 <xsl:template match="shortcut">
644   <xsl:call-template name="inline.boldseq"/>
645 </xsl:template>
646
647 <xsl:template match="mousebutton">
648   <xsl:call-template name="inline.charseq"/>
649 </xsl:template>
650
651 <xsl:template match="option">
652   <xsl:call-template name="inline.monoseq"/>
653 </xsl:template>
654
655 <xsl:template match="package">
656   <xsl:call-template name="inline.charseq"/>
657 </xsl:template>
658
659 <xsl:template match="parameter">
660   <xsl:call-template name="inline.italicmonoseq"/>
661 </xsl:template>
662
663 <xsl:template match="property">
664   <xsl:call-template name="inline.charseq"/>
665 </xsl:template>
666
667 <xsl:template match="prompt">
668   <xsl:call-template name="inline.monoseq"/>
669 </xsl:template>
670
671 <xsl:template match="replaceable">
672   <xsl:call-template name="inline.italicmonoseq"/>
673 </xsl:template>
674
675 <xsl:template match="returnvalue">
676   <xsl:call-template name="inline.charseq"/>
677 </xsl:template>
678
679 <xsl:template match="structfield">
680   <xsl:call-template name="inline.italicmonoseq"/>
681 </xsl:template>
682
683 <xsl:template match="structname">
684   <xsl:call-template name="inline.charseq"/>
685 </xsl:template>
686
687 <xsl:template match="symbol">
688   <xsl:call-template name="inline.charseq"/>
689 </xsl:template>
690
691 <xsl:template match="systemitem">
692   <xsl:call-template name="inline.monoseq"/>
693 </xsl:template>
694
695 <xsl:template match="token">
696   <xsl:call-template name="inline.charseq"/>
697 </xsl:template>
698
699 <xsl:template match="type">
700   <xsl:call-template name="inline.charseq"/>
701 </xsl:template>
702
703 <xsl:template match="userinput">
704   <xsl:call-template name="inline.boldmonoseq"/>
705 </xsl:template>
706
707 <xsl:template match="abbrev">
708   <xsl:call-template name="inline.charseq"/>
709 </xsl:template>
710
711 <xsl:template match="acronym">
712   <xsl:call-template name="inline.charseq"/>
713 </xsl:template>
714
715 <xsl:template match="citerefentry">
716   <xsl:call-template name="inline.charseq"/>
717 </xsl:template>
718
719 <xsl:template match="citetitle">
720   <xsl:choose>
721     <xsl:when test="@pubwork = 'article'">
722       <xsl:call-template name="gentext.startquote"/>
723       <xsl:call-template name="inline.charseq"/>
724       <xsl:call-template name="gentext.endquote"/>
725     </xsl:when>
726     <xsl:otherwise>
727       <xsl:call-template name="inline.italicseq"/>
728     </xsl:otherwise>
729   </xsl:choose>
730 </xsl:template>
731
732 <xsl:template match="emphasis">
733   <xsl:choose>
734     <xsl:when test="@role='bold' or @role='strong'">
735       <xsl:call-template name="inline.boldseq"/>
736     </xsl:when>
737     <xsl:when test="@role='underline'">
738       <fo:inline text-decoration="underline">
739         <xsl:call-template name="inline.charseq"/>
740       </fo:inline>
741     </xsl:when>
742     <xsl:when test="@role='strikethrough'">
743       <fo:inline text-decoration="line-through">
744         <xsl:call-template name="inline.charseq"/>
745       </fo:inline>
746     </xsl:when>
747     <xsl:otherwise>
748       <!-- How many regular emphasis ancestors does this element have -->
749       <xsl:variable name="depth" select="count(ancestor::emphasis
750         [not(contains(' bold strong underline strikethrough ', concat(' ', @role, ' ')))]
751         )"/>
752
753       <xsl:choose>
754         <xsl:when test="$depth mod 2 = 1">
755           <fo:inline font-style="normal">
756             <xsl:apply-templates/>
757           </fo:inline>
758         </xsl:when>
759         <xsl:otherwise>
760           <xsl:call-template name="inline.italicseq"/>
761         </xsl:otherwise>
762       </xsl:choose>
763     </xsl:otherwise>
764   </xsl:choose>
765 </xsl:template>
766
767 <xsl:template match="foreignphrase">
768   <xsl:call-template name="inline.italicseq"/>
769 </xsl:template>
770
771 <xsl:template match="markup">
772   <xsl:call-template name="inline.charseq"/>
773 </xsl:template>
774
775 <xsl:template match="phrase">
776   <fo:inline>
777     <xsl:call-template name="anchor"/>
778     <xsl:call-template name="inline.charseq"/>
779   </fo:inline>
780 </xsl:template>
781
782 <xsl:template match="quote">
783   <xsl:variable name="depth">
784     <xsl:call-template name="dot.count">
785       <xsl:with-param name="string"><xsl:number level="multiple"/></xsl:with-param>
786     </xsl:call-template>
787   </xsl:variable>
788   <xsl:variable name="content">
789     <xsl:choose>
790       <xsl:when test="$depth mod 2 = 0">
791         <xsl:call-template name="gentext.startquote"/>
792         <xsl:call-template name="inline.charseq"/>
793         <xsl:call-template name="gentext.endquote"/>
794       </xsl:when>
795       <xsl:otherwise>
796         <xsl:call-template name="gentext.nestedstartquote"/>
797         <xsl:call-template name="inline.charseq"/>
798         <xsl:call-template name="gentext.nestedendquote"/>
799       </xsl:otherwise>
800     </xsl:choose>
801   </xsl:variable>
802
803   <fo:inline>
804     <xsl:call-template name="anchor"/>
805     <xsl:copy-of select="$content"/>
806   </fo:inline>
807
808 </xsl:template>
809
810 <xsl:template match="varname">
811   <xsl:call-template name="inline.monoseq"/>
812 </xsl:template>
813
814 <xsl:template match="wordasword">
815   <xsl:call-template name="inline.italicseq"/>
816 </xsl:template>
817
818 <xsl:template match="lineannotation">
819   <fo:inline font-style="italic">
820     <xsl:call-template name="inline.charseq"/>
821   </fo:inline>
822 </xsl:template>
823
824 <xsl:template match="superscript">
825   <xsl:call-template name="inline.superscriptseq"/>
826 </xsl:template>
827
828 <xsl:template match="subscript">
829   <xsl:call-template name="inline.subscriptseq"/>
830 </xsl:template>
831
832 <xsl:template match="trademark">
833   <xsl:call-template name="inline.charseq"/>
834   <xsl:choose>
835     <xsl:when test="@class = 'copyright'
836                     or @class = 'registered'">
837       <xsl:call-template name="dingbat">
838         <xsl:with-param name="dingbat" select="@class"/>
839       </xsl:call-template>
840     </xsl:when>
841     <xsl:when test="@class = 'service'">
842       <xsl:call-template name="inline.superscriptseq">
843         <xsl:with-param name="content" select="'SM'"/>
844       </xsl:call-template>
845     </xsl:when>
846     <xsl:otherwise>
847       <xsl:call-template name="dingbat">
848         <xsl:with-param name="dingbat" select="'trademark'"/>
849       </xsl:call-template>
850     </xsl:otherwise>
851   </xsl:choose>
852 </xsl:template>
853
854 <xsl:template match="firstterm">
855   <xsl:call-template name="glossterm">
856     <xsl:with-param name="firstterm" select="1"/>
857   </xsl:call-template>
858 </xsl:template>
859
860 <xsl:template match="glossterm" name="glossterm">
861   <xsl:param name="firstterm" select="0"/>
862
863   <xsl:choose>
864     <xsl:when test="($firstterm.only.link = 0 or $firstterm = 1) and @linkend">
865       <xsl:variable name="targets" select="key('id',@linkend)"/>
866       <xsl:variable name="target" select="$targets[1]"/>
867
868       <xsl:choose>
869         <xsl:when test="$target">
870           <fo:basic-link internal-destination="{@linkend}" 
871                          xsl:use-attribute-sets="xref.properties">
872             <xsl:call-template name="inline.italicseq"/>
873           </fo:basic-link>
874         </xsl:when>
875         <xsl:otherwise>
876           <xsl:call-template name="inline.italicseq"/>
877         </xsl:otherwise>
878       </xsl:choose>
879     </xsl:when>
880
881     <xsl:when test="not(@linkend)
882                     and ($firstterm.only.link = 0 or $firstterm = 1)
883                     and ($glossterm.auto.link != 0)
884                     and $glossary.collection != ''">
885       <xsl:variable name="term">
886         <xsl:choose>
887           <xsl:when test="@baseform"><xsl:value-of select="@baseform"/></xsl:when>
888           <xsl:otherwise><xsl:value-of select="."/></xsl:otherwise>
889         </xsl:choose>
890       </xsl:variable>
891       <xsl:variable name="cterm"
892            select="(document($glossary.collection,.)//glossentry[glossterm=$term])[1]"/>
893
894       <xsl:choose>
895         <xsl:when test="not($cterm)">
896           <xsl:message>
897             <xsl:text>There's no entry for </xsl:text>
898             <xsl:value-of select="$term"/>
899             <xsl:text> in </xsl:text>
900             <xsl:value-of select="$glossary.collection"/>
901           </xsl:message>
902           <xsl:call-template name="inline.italicseq"/>
903         </xsl:when>
904         <xsl:otherwise>
905           <xsl:variable name="id">
906             <xsl:call-template name="object.id">
907               <xsl:with-param name="object" select="$cterm"/>
908             </xsl:call-template>
909           </xsl:variable>
910           <fo:basic-link internal-destination="{$id}"
911                          xsl:use-attribute-sets="xref.properties">
912             <xsl:call-template name="inline.italicseq"/>
913           </fo:basic-link>
914         </xsl:otherwise>
915       </xsl:choose>
916     </xsl:when>
917
918     <xsl:when test="not(@linkend)
919                     and ($firstterm.only.link = 0 or $firstterm = 1)
920                     and $glossterm.auto.link != 0">
921       <xsl:variable name="term">
922         <xsl:choose>
923           <xsl:when test="@baseform">
924             <xsl:value-of select="normalize-space(@baseform)"/>
925           </xsl:when>
926           <xsl:otherwise>
927             <xsl:value-of select="normalize-space(.)"/>
928           </xsl:otherwise>
929         </xsl:choose>
930       </xsl:variable>
931
932       <xsl:variable name="targets"
933                     select="key('glossentries', $term)"/>
934       <xsl:variable name="target" select="$targets[1]"/>
935
936       <xsl:choose>
937         <xsl:when test="count($targets)=0">
938           <xsl:message>
939             <xsl:text>Error: no glossentry for glossterm: </xsl:text>
940             <xsl:value-of select="."/>
941             <xsl:text>.</xsl:text>
942           </xsl:message>
943           <xsl:call-template name="inline.italicseq"/>
944         </xsl:when>
945         <xsl:otherwise>
946           <xsl:variable name="termid">
947             <xsl:call-template name="object.id">
948               <xsl:with-param name="object" select="$target"/>
949             </xsl:call-template>
950           </xsl:variable>
951
952           <fo:basic-link internal-destination="{$termid}"
953                          xsl:use-attribute-sets="xref.properties">
954             <xsl:call-template name="inline.italicseq"/>
955           </fo:basic-link>
956         </xsl:otherwise>
957       </xsl:choose>
958     </xsl:when>
959     <xsl:otherwise>
960       <xsl:call-template name="inline.italicseq"/>
961     </xsl:otherwise>
962   </xsl:choose>
963 </xsl:template>
964
965 <xsl:template match="termdef">
966   <fo:inline>
967     <xsl:call-template name="gentext.template">
968       <xsl:with-param name="context" select="'termdef'"/>
969       <xsl:with-param name="name" select="'prefix'"/>
970     </xsl:call-template>
971     <xsl:apply-templates/>
972     <xsl:call-template name="gentext.template">
973       <xsl:with-param name="context" select="'termdef'"/>
974       <xsl:with-param name="name" select="'suffix'"/>
975     </xsl:call-template>
976   </fo:inline>
977 </xsl:template>
978
979 <xsl:template match="sgmltag|tag">
980   <xsl:variable name="class">
981     <xsl:choose>
982       <xsl:when test="@class">
983         <xsl:value-of select="@class"/>
984       </xsl:when>
985       <xsl:otherwise>element</xsl:otherwise>
986     </xsl:choose>
987   </xsl:variable>
988
989   <xsl:choose>
990     <xsl:when test="$class='attribute'">
991       <xsl:call-template name="inline.monoseq"/>
992     </xsl:when>
993     <xsl:when test="$class='attvalue'">
994       <xsl:call-template name="inline.monoseq"/>
995     </xsl:when>
996     <xsl:when test="$class='element'">
997       <xsl:call-template name="inline.monoseq"/>
998     </xsl:when>
999     <xsl:when test="$class='endtag'">
1000       <xsl:call-template name="inline.monoseq">
1001         <xsl:with-param name="content">
1002           <xsl:text>&lt;/</xsl:text>
1003           <xsl:apply-templates/>
1004           <xsl:text>&gt;</xsl:text>
1005         </xsl:with-param>
1006       </xsl:call-template>
1007     </xsl:when>
1008     <xsl:when test="$class='genentity'">
1009       <xsl:call-template name="inline.monoseq">
1010         <xsl:with-param name="content">
1011           <xsl:text>&amp;</xsl:text>
1012           <xsl:apply-templates/>
1013           <xsl:text>;</xsl:text>
1014         </xsl:with-param>
1015       </xsl:call-template>
1016     </xsl:when>
1017     <xsl:when test="$class='numcharref'">
1018       <xsl:call-template name="inline.monoseq">
1019         <xsl:with-param name="content">
1020           <xsl:text>&amp;#</xsl:text>
1021           <xsl:apply-templates/>
1022           <xsl:text>;</xsl:text>
1023         </xsl:with-param>
1024       </xsl:call-template>
1025     </xsl:when>
1026     <xsl:when test="$class='paramentity'">
1027       <xsl:call-template name="inline.monoseq">
1028         <xsl:with-param name="content">
1029           <xsl:text>%</xsl:text>
1030           <xsl:apply-templates/>
1031           <xsl:text>;</xsl:text>
1032         </xsl:with-param>
1033       </xsl:call-template>
1034     </xsl:when>
1035     <xsl:when test="$class='pi'">
1036       <xsl:call-template name="inline.monoseq">
1037         <xsl:with-param name="content">
1038           <xsl:text>&lt;?</xsl:text>
1039           <xsl:apply-templates/>
1040           <xsl:text>&gt;</xsl:text>
1041         </xsl:with-param>
1042       </xsl:call-template>
1043     </xsl:when>
1044     <xsl:when test="$class='xmlpi'">
1045       <xsl:call-template name="inline.monoseq">
1046         <xsl:with-param name="content">
1047           <xsl:text>&lt;?</xsl:text>
1048           <xsl:apply-templates/>
1049           <xsl:text>?&gt;</xsl:text>
1050         </xsl:with-param>
1051       </xsl:call-template>
1052     </xsl:when>
1053     <xsl:when test="$class='starttag'">
1054       <xsl:call-template name="inline.monoseq">
1055         <xsl:with-param name="content">
1056           <xsl:text>&lt;</xsl:text>
1057           <xsl:apply-templates/>
1058           <xsl:text>&gt;</xsl:text>
1059         </xsl:with-param>
1060       </xsl:call-template>
1061     </xsl:when>
1062     <xsl:when test="$class='emptytag'">
1063       <xsl:call-template name="inline.monoseq">
1064         <xsl:with-param name="content">
1065           <xsl:text>&lt;</xsl:text>
1066           <xsl:apply-templates/>
1067           <xsl:text>/&gt;</xsl:text>
1068         </xsl:with-param>
1069       </xsl:call-template>
1070     </xsl:when>
1071     <xsl:when test="$class='sgmlcomment' or $class='comment'">
1072       <xsl:call-template name="inline.monoseq">
1073         <xsl:with-param name="content">
1074           <xsl:text>&lt;!--</xsl:text>
1075           <xsl:apply-templates/>
1076           <xsl:text>--&gt;</xsl:text>
1077         </xsl:with-param>
1078       </xsl:call-template>
1079     </xsl:when>
1080     <xsl:otherwise>
1081       <xsl:call-template name="inline.charseq"/>
1082     </xsl:otherwise>
1083   </xsl:choose>
1084 </xsl:template>
1085
1086 <xsl:template match="email">
1087   <xsl:call-template name="inline.monoseq">
1088     <xsl:with-param name="content">
1089       <fo:inline keep-together.within-line="always" hyphenate="false">
1090         <xsl:if test="not($email.delimiters.enabled = 0)">
1091           <xsl:text>&lt;</xsl:text>
1092         </xsl:if>
1093         <xsl:choose>
1094           <xsl:when test="not($email.mailto.enabled = 0)">
1095             <fo:basic-link xsl:use-attribute-sets="xref.properties"
1096                            keep-together.within-line="always" hyphenate="false">
1097               <xsl:attribute name="external-destination">
1098                 mailto:<xsl:value-of select="string(.)" />
1099               </xsl:attribute>
1100               <xsl:apply-templates/>
1101             </fo:basic-link>
1102           </xsl:when>
1103           <xsl:otherwise>
1104             <xsl:apply-templates/>
1105           </xsl:otherwise>
1106         </xsl:choose>
1107         <xsl:if test="not($email.delimiters.enabled = 0)">
1108           <xsl:text>&gt;</xsl:text>
1109         </xsl:if>
1110       </fo:inline>
1111     </xsl:with-param>
1112   </xsl:call-template>
1113 </xsl:template>
1114
1115 <xsl:template match="keycombo">
1116   <xsl:variable name="action" select="@action"/>
1117   <xsl:variable name="joinchar">
1118     <xsl:choose>
1119       <xsl:when test="$action='seq'"><xsl:text> </xsl:text></xsl:when>
1120       <xsl:when test="$action='simul'">+</xsl:when>
1121       <xsl:when test="$action='press'">-</xsl:when>
1122       <xsl:when test="$action='click'">-</xsl:when>
1123       <xsl:when test="$action='double-click'">-</xsl:when>
1124       <xsl:when test="$action='other'"></xsl:when>
1125       <xsl:otherwise>+</xsl:otherwise>
1126     </xsl:choose>
1127   </xsl:variable>
1128   <xsl:for-each select="*">
1129     <xsl:if test="position()>1"><xsl:value-of select="$joinchar"/></xsl:if>
1130     <xsl:apply-templates select="."/>
1131   </xsl:for-each>
1132 </xsl:template>
1133
1134 <xsl:template match="uri">
1135   <xsl:call-template name="inline.monoseq"/>
1136 </xsl:template>
1137
1138 <!-- ==================================================================== -->
1139
1140 <xsl:template match="menuchoice">
1141   <xsl:variable name="shortcut" select="./shortcut"/>
1142   <xsl:call-template name="process.menuchoice"/>
1143   <xsl:if test="$shortcut">
1144     <xsl:text> (</xsl:text>
1145     <xsl:apply-templates select="$shortcut"/>
1146     <xsl:text>)</xsl:text>
1147   </xsl:if>
1148 </xsl:template>
1149
1150 <xsl:template name="process.menuchoice">
1151   <xsl:param name="nodelist" select="guibutton|guiicon|guilabel|guimenu|guimenuitem|guisubmenu|interface"/><!-- not(shortcut) -->
1152   <xsl:param name="count" select="1"/>
1153
1154   <xsl:variable name="mm.separator">
1155     <xsl:choose>
1156       <xsl:when test="($fop.extensions != 0 or $fop1.extensions != 0 ) and
1157                 contains($menuchoice.menu.separator, '&#x2192;') and
1158                 $symbol.font.family != ''">
1159         <fo:inline font-size=".75em" font-family="{$symbol.font.family}">
1160           <xsl:copy-of select="$menuchoice.menu.separator"/>
1161         </fo:inline>
1162       </xsl:when>
1163       <xsl:otherwise>
1164         <xsl:copy-of select="$menuchoice.menu.separator"/>
1165       </xsl:otherwise>
1166     </xsl:choose>
1167   </xsl:variable>
1168
1169   <xsl:choose>
1170     <xsl:when test="$count>count($nodelist)"></xsl:when>
1171     <xsl:when test="$count=1">
1172       <xsl:apply-templates select="$nodelist[$count=position()]"/>
1173       <xsl:call-template name="process.menuchoice">
1174         <xsl:with-param name="nodelist" select="$nodelist"/>
1175         <xsl:with-param name="count" select="$count+1"/>
1176       </xsl:call-template>
1177     </xsl:when>
1178     <xsl:otherwise>
1179       <xsl:variable name="node" select="$nodelist[$count=position()]"/>
1180       <xsl:choose>
1181         <xsl:when test="local-name($node)='guimenuitem'
1182                         or local-name($node)='guisubmenu'">
1183           <xsl:copy-of select="$mm.separator"/>
1184         </xsl:when>
1185         <xsl:otherwise>
1186           <xsl:copy-of select="$menuchoice.separator"/>
1187         </xsl:otherwise>
1188       </xsl:choose>
1189       <xsl:apply-templates select="$node"/>
1190       <xsl:call-template name="process.menuchoice">
1191         <xsl:with-param name="nodelist" select="$nodelist"/>
1192         <xsl:with-param name="count" select="$count+1"/>
1193       </xsl:call-template>
1194     </xsl:otherwise>
1195   </xsl:choose>
1196 </xsl:template>
1197
1198 <!-- ==================================================================== -->
1199
1200 <xsl:template match="optional">
1201   <xsl:value-of select="$arg.choice.opt.open.str"/>
1202   <xsl:call-template name="inline.charseq"/>
1203   <xsl:value-of select="$arg.choice.opt.close.str"/>
1204 </xsl:template>
1205
1206 <xsl:template match="citation">
1207   <!-- todo: integrate with bibliography collection -->
1208   <xsl:variable name="targets" select="(//biblioentry | //bibliomixed)[abbrev = string(current())]"/>
1209   <xsl:variable name="target" select="$targets[1]"/>
1210
1211   <xsl:choose>
1212     <!-- try automatic linking based on match to abbrev -->
1213     <xsl:when test="$target and not(xref) and not(link)">
1214
1215       <xsl:text>[</xsl:text>
1216       <fo:basic-link>
1217         <xsl:attribute name="internal-destination">
1218           <xsl:call-template name="object.id">
1219             <xsl:with-param name="object" select="$target"/>
1220           </xsl:call-template>
1221         </xsl:attribute>
1222
1223         <xsl:choose>
1224           <xsl:when test="$bibliography.numbered != 0">
1225             <xsl:apply-templates select="$target" mode="citation"/>
1226           </xsl:when>
1227           <xsl:otherwise>
1228             <xsl:call-template name="inline.charseq"/>
1229           </xsl:otherwise>
1230         </xsl:choose>
1231      
1232       </fo:basic-link>
1233       <xsl:text>]</xsl:text>
1234     </xsl:when>
1235
1236     <xsl:otherwise>
1237       <xsl:text>[</xsl:text>
1238       <xsl:call-template name="inline.charseq"/>
1239       <xsl:text>]</xsl:text>
1240     </xsl:otherwise>
1241   </xsl:choose>
1242 </xsl:template>
1243
1244 <xsl:template match="citebiblioid">
1245   <xsl:variable name="targets" select="//*[biblioid = string(current())]"/>
1246   <xsl:variable name="target" select="$targets[1]"/>
1247
1248   <xsl:choose>
1249     <!-- try automatic linking based on match to parent of biblioid -->
1250     <xsl:when test="$target and not(xref) and not(link)">
1251
1252       <xsl:text>[</xsl:text>
1253       <fo:basic-link>
1254         <xsl:attribute name="internal-destination">
1255           <xsl:call-template name="object.id">
1256             <xsl:with-param name="object" select="$target"/>
1257           </xsl:call-template>
1258         </xsl:attribute>
1259
1260         <xsl:call-template name="inline.charseq"/>
1261             
1262       </fo:basic-link>
1263       <xsl:text>]</xsl:text>
1264     </xsl:when>
1265
1266     <xsl:otherwise>
1267       <xsl:text>[</xsl:text>
1268       <xsl:call-template name="inline.charseq"/>
1269       <xsl:text>]</xsl:text>
1270     </xsl:otherwise>
1271   </xsl:choose>
1272 </xsl:template>
1273
1274 <xsl:template match="biblioentry|bibliomixed" mode="citation">
1275   <xsl:number from="bibliography" count="biblioentry|bibliomixed"
1276               level="any" format="1"/>
1277 </xsl:template>
1278
1279 <!-- ==================================================================== -->
1280
1281 <xsl:template match="comment[&comment.block.parents;]|remark[&comment.block.parents;]">
1282   <xsl:if test="$show.comments != 0">
1283     <fo:block font-style="italic">
1284       <xsl:call-template name="inline.charseq"/>
1285     </fo:block>
1286   </xsl:if>
1287 </xsl:template>
1288
1289 <xsl:template match="comment|remark">
1290   <xsl:if test="$show.comments != 0">
1291     <fo:inline font-style="italic">
1292       <xsl:call-template name="inline.charseq"/>
1293     </fo:inline>
1294   </xsl:if>
1295 </xsl:template>
1296
1297 <!-- ==================================================================== -->
1298
1299 <xsl:template match="productname">
1300   <xsl:call-template name="inline.charseq"/>
1301   <xsl:if test="@class">
1302     <xsl:call-template name="dingbat">
1303       <xsl:with-param name="dingbat" select="@class"/>
1304     </xsl:call-template>
1305   </xsl:if>
1306 </xsl:template>
1307
1308 <xsl:template match="productnumber">
1309   <xsl:call-template name="inline.charseq"/>
1310 </xsl:template>
1311
1312 <!-- ==================================================================== -->
1313
1314 <xsl:template match="pob|street|city|state|postcode|country|otheraddr">
1315   <xsl:call-template name="inline.charseq"/>
1316 </xsl:template>
1317
1318 <xsl:template match="phone|fax">
1319   <xsl:call-template name="inline.charseq"/>
1320 </xsl:template>
1321
1322 <!-- in Addresses, for example -->
1323 <xsl:template match="honorific|firstname|surname|lineage|othername">
1324   <xsl:call-template name="inline.charseq"/>
1325 </xsl:template>
1326
1327 <!-- ==================================================================== -->
1328
1329 <xsl:template match="person">
1330   <xsl:apply-templates select="personname"/>
1331 </xsl:template>
1332
1333 <xsl:template match="personname">
1334   <xsl:call-template name="simple.xlink">
1335     <xsl:with-param name="content">
1336       <xsl:call-template name="person.name"/>
1337     </xsl:with-param>
1338   </xsl:call-template>
1339 </xsl:template>
1340
1341 <xsl:template match="jobtitle">
1342   <xsl:call-template name="simple.xlink">
1343     <xsl:with-param name="content">
1344       <xsl:apply-templates/>
1345     </xsl:with-param>
1346   </xsl:call-template>
1347 </xsl:template>
1348
1349 <!-- ==================================================================== -->
1350
1351 <xsl:template match="org">
1352   <xsl:call-template name="inline.charseq"/>
1353 </xsl:template>
1354
1355 <xsl:template match="orgname">
1356   <xsl:call-template name="inline.charseq"/>
1357 </xsl:template>
1358
1359 <xsl:template match="orgdiv">
1360   <xsl:call-template name="inline.charseq"/>
1361 </xsl:template>
1362
1363 <xsl:template match="affiliation">
1364   <xsl:call-template name="inline.charseq"/>
1365 </xsl:template>
1366
1367 <!-- ==================================================================== -->
1368
1369 <xsl:template match="beginpage">
1370   <!-- does nothing; this *is not* markup to force a page break. -->
1371 </xsl:template>
1372
1373 <xsl:template match="*" mode="simple.xlink.properties">
1374   <!-- Placeholder template to apply properties to links made from
1375        elements other than xref, link, and olink.
1376        This template should generate attributes only, as it is
1377        applied right after the opening <fo:basic-link> tag.
1378        -->
1379   <!-- for example
1380   <xsl:attribute name="color">blue</xsl:attribute>
1381   -->
1382   <!-- Since this is a mode, you can create different
1383        templates with different properties for different linking elements -->
1384 </xsl:template>
1385
1386 </xsl:stylesheet>
1387