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