2 <!DOCTYPE xsl:stylesheet [
3 <!ENTITY % common.entities SYSTEM "../common/entities.ent">
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"
12 <!-- ********************************************************************
13 $Id: inline.xsl 9963 2015-05-20 18:37:42Z bobstayton $
14 ********************************************************************
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.
20 ******************************************************************** -->
22 <xsl:key name="glossentries" match="glossentry" use="normalize-space(glossterm)"/>
23 <xsl:key name="glossentries" match="glossentry" use="normalize-space(glossterm/@baseform)"/>
25 <xsl:template name="simple.xlink">
26 <xsl:param name="node" select="."/>
27 <xsl:param name="content">
28 <xsl:apply-templates/>
30 <xsl:param name="linkend" select="$node/@linkend"/>
31 <xsl:param name="xhref" select="$node/@xlink:href"/>
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]">
36 <xsl:text>WARNING: nested link may be undefined in output: </xsl:text>
37 <xsl:text><</xsl:text>
38 <xsl:value-of select="name($node)"/>
39 <xsl:text> </xsl:text>
41 <xsl:when test="$linkend">
42 <xsl:text>@linkend = '</xsl:text>
43 <xsl:value-of select="$linkend"/>
44 <xsl:text>'></xsl:text>
46 <xsl:when test="$xhref">
47 <xsl:text>@xlink:href = '</xsl:text>
48 <xsl:value-of select="$xhref"/>
49 <xsl:text>'></xsl:text>
52 <xsl:text> nested inside parent element </xsl:text>
53 <xsl:value-of select="name($node/parent::*)"/>
58 <xsl:when test="$xhref
59 and (not($node/@xlink:type) or
60 $node/@xlink:type='simple')">
62 <!-- Is it a local idref? -->
63 <xsl:variable name="is.idref">
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,'('))
69 or starts-with($xhref,
70 '#xpointer(id('))">1</xsl:when>
71 <xsl:otherwise>0</xsl:otherwise>
75 <!-- Is it an olink ? -->
76 <xsl:variable name="is.olink">
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>
87 <xsl:when test="$is.olink = 1">
88 <xsl:call-template name="olink">
89 <xsl:with-param name="content" select="$content"/>
93 <xsl:when test="$is.idref = 1">
95 <xsl:variable name="idref">
96 <xsl:call-template name="xpointer.idref">
97 <xsl:with-param name="xpointer" select="$xhref"/>
101 <xsl:variable name="targets" select="key('id',$idref)"/>
102 <xsl:variable name="target" select="$targets[1]"/>
104 <xsl:call-template name="check.id.unique">
105 <xsl:with-param name="linkend" select="$idref"/>
109 <xsl:when test="count($target) = 0">
111 <xsl:text>XLink to nonexistent id: </xsl:text>
112 <xsl:value-of select="$idref"/>
114 <xsl:copy-of select="$content"/>
118 <fo:basic-link internal-destination="{$idref}">
119 <xsl:apply-templates select="." mode="simple.xlink.properties"/>
120 <xsl:copy-of select="$content"/>
126 <!-- otherwise it's a URI -->
128 <fo:basic-link external-destination="url({$xhref})">
129 <xsl:apply-templates select="." mode="simple.xlink.properties"/>
130 <xsl:copy-of select="$content"/>
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"/>
142 <xsl:when test="$linkend">
143 <xsl:variable name="targets" select="key('id',$linkend)"/>
144 <xsl:variable name="target" select="$targets[1]"/>
146 <xsl:call-template name="check.id.unique">
147 <xsl:with-param name="linkend" select="$linkend"/>
151 <xsl:when test="count($target) = 0">
153 <xsl:text>XLink to nonexistent id: </xsl:text>
154 <xsl:value-of select="$linkend"/>
156 <xsl:copy-of select="$content"/>
160 <fo:basic-link internal-destination="{$linkend}">
161 <xsl:apply-templates select="." mode="simple.xlink.properties"/>
162 <xsl:copy-of select="$content"/>
169 <xsl:copy-of select="$content"/>
174 <xsl:template name="inline.sansseq">
175 <xsl:param name="content">
176 <xsl:apply-templates/>
179 <xsl:param name="contentwithlink">
180 <xsl:call-template name="simple.xlink">
181 <xsl:with-param name="content" select="$content"/>
185 <fo:inline font-family="{$sans.font.family}">
187 <xsl:when test="@dir">
189 <xsl:attribute name="direction">
191 <xsl:when test="@dir = 'ltr' or @dir = 'lro'">ltr</xsl:when>
192 <xsl:otherwise>rtl</xsl:otherwise>
195 <xsl:copy-of select="$contentwithlink"/>
199 <xsl:copy-of select="$contentwithlink"/>
205 <xsl:template name="inline.charseq">
206 <xsl:param name="content">
207 <xsl:apply-templates/>
210 <xsl:param name="contentwithlink">
211 <xsl:call-template name="simple.xlink">
212 <xsl:with-param name="content" select="$content"/>
217 <xsl:when test="@dir">
219 <xsl:attribute name="direction">
221 <xsl:when test="@dir = 'ltr' or @dir = 'lro'">ltr</xsl:when>
222 <xsl:otherwise>rtl</xsl:otherwise>
225 <xsl:copy-of select="$contentwithlink"/>
229 <xsl:copy-of select="$contentwithlink"/>
234 <xsl:template name="inline.monoseq">
235 <xsl:param name="content">
236 <xsl:apply-templates/>
239 <xsl:param name="contentwithlink">
240 <xsl:call-template name="simple.xlink">
241 <xsl:with-param name="content" select="$content"/>
246 <fo:inline xsl:use-attribute-sets="monospace.properties">
247 <xsl:call-template name="anchor"/>
249 <xsl:attribute name="direction">
251 <xsl:when test="@dir = 'ltr' or @dir = 'lro'">ltr</xsl:when>
252 <xsl:otherwise>rtl</xsl:otherwise>
256 <xsl:copy-of select="$contentwithlink"/>
260 <xsl:template name="inline.boldseq">
261 <xsl:param name="content">
262 <xsl:apply-templates/>
265 <xsl:param name="contentwithlink">
266 <xsl:call-template name="simple.xlink">
267 <xsl:with-param name="content" select="$content"/>
271 <fo:inline font-weight="bold">
273 <xsl:attribute name="direction">
275 <xsl:when test="@dir = 'ltr' or @dir = 'lro'">ltr</xsl:when>
276 <xsl:otherwise>rtl</xsl:otherwise>
280 <xsl:copy-of select="$contentwithlink"/>
284 <xsl:template name="inline.italicseq">
285 <xsl:param name="content">
286 <xsl:apply-templates/>
289 <xsl:param name="contentwithlink">
290 <xsl:call-template name="simple.xlink">
291 <xsl:with-param name="content" select="$content"/>
295 <fo:inline font-style="italic">
296 <xsl:call-template name="anchor"/>
298 <xsl:attribute name="direction">
300 <xsl:when test="@dir = 'ltr' or @dir = 'lro'">ltr</xsl:when>
301 <xsl:otherwise>rtl</xsl:otherwise>
305 <xsl:copy-of select="$contentwithlink"/>
309 <xsl:template name="inline.boldmonoseq">
310 <xsl:param name="content">
311 <xsl:apply-templates/>
314 <xsl:param name="contentwithlink">
315 <xsl:call-template name="simple.xlink">
316 <xsl:with-param name="content" select="$content"/>
320 <fo:inline font-weight="bold" xsl:use-attribute-sets="monospace.properties">
321 <xsl:call-template name="anchor"/>
323 <xsl:attribute name="direction">
325 <xsl:when test="@dir = 'ltr' or @dir = 'lro'">ltr</xsl:when>
326 <xsl:otherwise>rtl</xsl:otherwise>
330 <xsl:copy-of select="$contentwithlink"/>
334 <xsl:template name="inline.italicmonoseq">
335 <xsl:param name="content">
336 <xsl:apply-templates/>
339 <xsl:param name="contentwithlink">
340 <xsl:call-template name="simple.xlink">
341 <xsl:with-param name="content" select="$content"/>
345 <fo:inline font-style="italic" xsl:use-attribute-sets="monospace.properties">
346 <xsl:call-template name="anchor"/>
348 <xsl:attribute name="direction">
350 <xsl:when test="@dir = 'ltr' or @dir = 'lro'">ltr</xsl:when>
351 <xsl:otherwise>rtl</xsl:otherwise>
355 <xsl:copy-of select="$contentwithlink"/>
359 <xsl:template name="inline.superscriptseq">
360 <xsl:param name="content">
361 <xsl:apply-templates/>
364 <xsl:param name="contentwithlink">
365 <xsl:call-template name="simple.xlink">
366 <xsl:with-param name="content" select="$content"/>
370 <fo:inline xsl:use-attribute-sets="superscript.properties">
371 <xsl:call-template name="anchor"/>
373 <xsl:attribute name="direction">
375 <xsl:when test="@dir = 'ltr' or @dir = 'lro'">ltr</xsl:when>
376 <xsl:otherwise>rtl</xsl:otherwise>
381 <xsl:when test="$fop.extensions != 0">
382 <xsl:attribute name="vertical-align">super</xsl:attribute>
385 <xsl:attribute name="baseline-shift">super</xsl:attribute>
388 <xsl:copy-of select="$contentwithlink"/>
392 <xsl:template name="inline.subscriptseq">
393 <xsl:param name="content">
394 <xsl:apply-templates/>
397 <xsl:param name="contentwithlink">
398 <xsl:call-template name="simple.xlink">
399 <xsl:with-param name="content" select="$content"/>
403 <fo:inline xsl:use-attribute-sets="subscript.properties">
404 <xsl:call-template name="anchor"/>
406 <xsl:attribute name="direction">
408 <xsl:when test="@dir = 'ltr' or @dir = 'lro'">ltr</xsl:when>
409 <xsl:otherwise>rtl</xsl:otherwise>
414 <xsl:when test="$fop.extensions != 0">
415 <xsl:attribute name="vertical-align">sub</xsl:attribute>
418 <xsl:attribute name="baseline-shift">sub</xsl:attribute>
421 <xsl:copy-of select="$contentwithlink"/>
425 <!-- ==================================================================== -->
426 <!-- some special cases -->
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"/>
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"/>
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"/>
452 <xsl:template match="authorinitials">
453 <xsl:call-template name="inline.charseq"/>
456 <!-- ==================================================================== -->
458 <xsl:template match="accel">
459 <xsl:call-template name="inline.charseq"/>
462 <xsl:template match="action">
463 <xsl:call-template name="inline.charseq"/>
466 <xsl:template match="application">
467 <xsl:call-template name="inline.charseq"/>
470 <xsl:template match="classname">
471 <xsl:call-template name="inline.monoseq"/>
474 <xsl:template match="exceptionname">
475 <xsl:call-template name="inline.monoseq"/>
478 <xsl:template match="interfacename">
479 <xsl:call-template name="inline.monoseq"/>
482 <xsl:template match="methodname">
483 <xsl:call-template name="inline.monoseq"/>
486 <xsl:template match="command">
487 <xsl:call-template name="inline.boldseq"/>
490 <xsl:template match="computeroutput">
491 <xsl:call-template name="inline.monoseq"/>
494 <xsl:template match="constant">
495 <xsl:call-template name="inline.monoseq"/>
498 <xsl:template match="database">
499 <xsl:call-template name="inline.charseq"/>
502 <xsl:template match="date">
503 <!-- should this support locale-specific formatting? how? -->
504 <xsl:call-template name="inline.charseq"/>
507 <xsl:template match="errorcode">
508 <xsl:call-template name="inline.charseq"/>
511 <xsl:template match="errorname">
512 <xsl:call-template name="inline.charseq"/>
515 <xsl:template match="errortype">
516 <xsl:call-template name="inline.charseq"/>
519 <xsl:template match="errortext">
520 <xsl:call-template name="inline.charseq"/>
523 <xsl:template match="envar">
524 <xsl:call-template name="inline.monoseq"/>
527 <xsl:template match="filename">
528 <xsl:call-template name="inline.monoseq"/>
531 <xsl:template match="function">
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]"/>
545 <xsl:text>(</xsl:text>
546 <xsl:apply-templates select="$nodes[position()>1]"/>
547 <xsl:text>)</xsl:text>
550 <xsl:call-template name="inline.monoseq"/>
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>
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>
569 <xsl:template match="guibutton">
570 <xsl:call-template name="inline.charseq"/>
573 <xsl:template match="guiicon">
574 <xsl:call-template name="inline.charseq"/>
577 <xsl:template match="guilabel">
578 <xsl:call-template name="inline.charseq"/>
581 <xsl:template match="guimenu">
582 <xsl:call-template name="inline.charseq"/>
585 <xsl:template match="guimenuitem">
586 <xsl:call-template name="inline.charseq"/>
589 <xsl:template match="guisubmenu">
590 <xsl:call-template name="inline.charseq"/>
593 <xsl:template match="hardware">
594 <xsl:call-template name="inline.charseq"/>
597 <xsl:template match="interface">
598 <xsl:call-template name="inline.charseq"/>
601 <xsl:template match="interfacedefinition">
602 <xsl:call-template name="inline.charseq"/>
605 <xsl:template match="keycap">
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"/>
618 <xsl:call-template name="inline.boldseq"/>
623 <xsl:template match="keycode">
624 <xsl:call-template name="inline.charseq"/>
627 <xsl:template match="keysym">
628 <xsl:call-template name="inline.charseq"/>
631 <xsl:template match="literal">
632 <xsl:call-template name="inline.monoseq"/>
635 <xsl:template match="code">
636 <xsl:call-template name="inline.monoseq"/>
639 <xsl:template match="medialabel">
640 <xsl:call-template name="inline.italicseq"/>
643 <xsl:template match="shortcut">
644 <xsl:call-template name="inline.boldseq"/>
647 <xsl:template match="mousebutton">
648 <xsl:call-template name="inline.charseq"/>
651 <xsl:template match="option">
652 <xsl:call-template name="inline.monoseq"/>
655 <xsl:template match="package">
656 <xsl:call-template name="inline.charseq"/>
659 <xsl:template match="parameter">
660 <xsl:call-template name="inline.italicmonoseq"/>
663 <xsl:template match="property">
664 <xsl:call-template name="inline.charseq"/>
667 <xsl:template match="prompt">
668 <xsl:call-template name="inline.monoseq"/>
671 <xsl:template match="replaceable">
672 <xsl:call-template name="inline.italicmonoseq"/>
675 <xsl:template match="returnvalue">
676 <xsl:call-template name="inline.charseq"/>
679 <xsl:template match="structfield">
680 <xsl:call-template name="inline.italicmonoseq"/>
683 <xsl:template match="structname">
684 <xsl:call-template name="inline.charseq"/>
687 <xsl:template match="symbol">
688 <xsl:call-template name="inline.charseq"/>
691 <xsl:template match="systemitem">
692 <xsl:call-template name="inline.monoseq"/>
695 <xsl:template match="token">
696 <xsl:call-template name="inline.charseq"/>
699 <xsl:template match="type">
700 <xsl:call-template name="inline.charseq"/>
703 <xsl:template match="userinput">
704 <xsl:call-template name="inline.boldmonoseq"/>
707 <xsl:template match="abbrev">
708 <xsl:call-template name="inline.charseq"/>
711 <xsl:template match="acronym">
712 <xsl:call-template name="inline.charseq"/>
715 <xsl:template match="citerefentry">
716 <xsl:call-template name="inline.charseq"/>
719 <xsl:template match="citetitle">
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"/>
727 <xsl:call-template name="inline.italicseq"/>
732 <xsl:template match="emphasis">
734 <xsl:when test="@role='bold' or @role='strong'">
735 <xsl:call-template name="inline.boldseq"/>
737 <xsl:when test="@role='underline'">
738 <fo:inline text-decoration="underline">
739 <xsl:call-template name="inline.charseq"/>
742 <xsl:when test="@role='strikethrough'">
743 <fo:inline text-decoration="line-through">
744 <xsl:call-template name="inline.charseq"/>
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, ' ')))]
754 <xsl:when test="$depth mod 2 = 1">
755 <fo:inline font-style="normal">
756 <xsl:apply-templates/>
760 <xsl:call-template name="inline.italicseq"/>
767 <xsl:template match="foreignphrase">
768 <xsl:call-template name="inline.italicseq"/>
771 <xsl:template match="markup">
772 <xsl:call-template name="inline.charseq"/>
775 <xsl:template match="phrase">
777 <xsl:call-template name="anchor"/>
778 <xsl:call-template name="inline.charseq"/>
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>
788 <xsl:variable name="content">
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"/>
796 <xsl:call-template name="gentext.nestedstartquote"/>
797 <xsl:call-template name="inline.charseq"/>
798 <xsl:call-template name="gentext.nestedendquote"/>
804 <xsl:call-template name="anchor"/>
805 <xsl:copy-of select="$content"/>
810 <xsl:template match="varname">
811 <xsl:call-template name="inline.monoseq"/>
814 <xsl:template match="wordasword">
815 <xsl:call-template name="inline.italicseq"/>
818 <xsl:template match="lineannotation">
819 <fo:inline font-style="italic">
820 <xsl:call-template name="inline.charseq"/>
824 <xsl:template match="superscript">
825 <xsl:call-template name="inline.superscriptseq"/>
828 <xsl:template match="subscript">
829 <xsl:call-template name="inline.subscriptseq"/>
832 <xsl:template match="trademark">
833 <xsl:call-template name="inline.charseq"/>
835 <xsl:when test="@class = 'copyright'
836 or @class = 'registered'">
837 <xsl:call-template name="dingbat">
838 <xsl:with-param name="dingbat" select="@class"/>
841 <xsl:when test="@class = 'service'">
842 <xsl:call-template name="inline.superscriptseq">
843 <xsl:with-param name="content" select="'SM'"/>
847 <xsl:call-template name="dingbat">
848 <xsl:with-param name="dingbat" select="'trademark'"/>
854 <xsl:template match="firstterm">
855 <xsl:call-template name="glossterm">
856 <xsl:with-param name="firstterm" select="1"/>
860 <xsl:template match="glossterm" name="glossterm">
861 <xsl:param name="firstterm" select="0"/>
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]"/>
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"/>
876 <xsl:call-template name="inline.italicseq"/>
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">
887 <xsl:when test="@baseform"><xsl:value-of select="@baseform"/></xsl:when>
888 <xsl:otherwise><xsl:value-of select="."/></xsl:otherwise>
891 <xsl:variable name="cterm"
892 select="(document($glossary.collection,.)//glossentry[glossterm=$term])[1]"/>
895 <xsl:when test="not($cterm)">
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"/>
902 <xsl:call-template name="inline.italicseq"/>
905 <xsl:variable name="id">
906 <xsl:call-template name="object.id">
907 <xsl:with-param name="object" select="$cterm"/>
910 <fo:basic-link internal-destination="{$id}"
911 xsl:use-attribute-sets="xref.properties">
912 <xsl:call-template name="inline.italicseq"/>
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">
923 <xsl:when test="@baseform">
924 <xsl:value-of select="normalize-space(@baseform)"/>
927 <xsl:value-of select="normalize-space(.)"/>
932 <xsl:variable name="targets"
933 select="key('glossentries', $term)"/>
934 <xsl:variable name="target" select="$targets[1]"/>
937 <xsl:when test="count($targets)=0">
939 <xsl:text>Error: no glossentry for glossterm: </xsl:text>
940 <xsl:value-of select="."/>
941 <xsl:text>.</xsl:text>
943 <xsl:call-template name="inline.italicseq"/>
946 <xsl:variable name="termid">
947 <xsl:call-template name="object.id">
948 <xsl:with-param name="object" select="$target"/>
952 <fo:basic-link internal-destination="{$termid}"
953 xsl:use-attribute-sets="xref.properties">
954 <xsl:call-template name="inline.italicseq"/>
960 <xsl:call-template name="inline.italicseq"/>
965 <xsl:template match="termdef">
967 <xsl:call-template name="gentext.template">
968 <xsl:with-param name="context" select="'termdef'"/>
969 <xsl:with-param name="name" select="'prefix'"/>
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'"/>
979 <xsl:template match="sgmltag|tag">
980 <xsl:variable name="class">
982 <xsl:when test="@class">
983 <xsl:value-of select="@class"/>
985 <xsl:otherwise>element</xsl:otherwise>
990 <xsl:when test="$class='attribute'">
991 <xsl:call-template name="inline.monoseq"/>
993 <xsl:when test="$class='attvalue'">
994 <xsl:call-template name="inline.monoseq"/>
996 <xsl:when test="$class='element'">
997 <xsl:call-template name="inline.monoseq"/>
999 <xsl:when test="$class='endtag'">
1000 <xsl:call-template name="inline.monoseq">
1001 <xsl:with-param name="content">
1002 <xsl:text></</xsl:text>
1003 <xsl:apply-templates/>
1004 <xsl:text>></xsl:text>
1006 </xsl:call-template>
1008 <xsl:when test="$class='genentity'">
1009 <xsl:call-template name="inline.monoseq">
1010 <xsl:with-param name="content">
1011 <xsl:text>&</xsl:text>
1012 <xsl:apply-templates/>
1013 <xsl:text>;</xsl:text>
1015 </xsl:call-template>
1017 <xsl:when test="$class='numcharref'">
1018 <xsl:call-template name="inline.monoseq">
1019 <xsl:with-param name="content">
1020 <xsl:text>&#</xsl:text>
1021 <xsl:apply-templates/>
1022 <xsl:text>;</xsl:text>
1024 </xsl:call-template>
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>
1033 </xsl:call-template>
1035 <xsl:when test="$class='pi'">
1036 <xsl:call-template name="inline.monoseq">
1037 <xsl:with-param name="content">
1038 <xsl:text><?</xsl:text>
1039 <xsl:apply-templates/>
1040 <xsl:text>></xsl:text>
1042 </xsl:call-template>
1044 <xsl:when test="$class='xmlpi'">
1045 <xsl:call-template name="inline.monoseq">
1046 <xsl:with-param name="content">
1047 <xsl:text><?</xsl:text>
1048 <xsl:apply-templates/>
1049 <xsl:text>?></xsl:text>
1051 </xsl:call-template>
1053 <xsl:when test="$class='starttag'">
1054 <xsl:call-template name="inline.monoseq">
1055 <xsl:with-param name="content">
1056 <xsl:text><</xsl:text>
1057 <xsl:apply-templates/>
1058 <xsl:text>></xsl:text>
1060 </xsl:call-template>
1062 <xsl:when test="$class='emptytag'">
1063 <xsl:call-template name="inline.monoseq">
1064 <xsl:with-param name="content">
1065 <xsl:text><</xsl:text>
1066 <xsl:apply-templates/>
1067 <xsl:text>/></xsl:text>
1069 </xsl:call-template>
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><!--</xsl:text>
1075 <xsl:apply-templates/>
1076 <xsl:text>--></xsl:text>
1078 </xsl:call-template>
1081 <xsl:call-template name="inline.charseq"/>
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><</xsl:text>
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(.)" />
1100 <xsl:apply-templates/>
1104 <xsl:apply-templates/>
1107 <xsl:if test="not($email.delimiters.enabled = 0)">
1108 <xsl:text>></xsl:text>
1112 </xsl:call-template>
1115 <xsl:template match="keycombo">
1116 <xsl:variable name="action" select="@action"/>
1117 <xsl:variable name="joinchar">
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>
1128 <xsl:for-each select="*">
1129 <xsl:if test="position()>1"><xsl:value-of select="$joinchar"/></xsl:if>
1130 <xsl:apply-templates select="."/>
1134 <xsl:template match="uri">
1135 <xsl:call-template name="inline.monoseq"/>
1138 <!-- ==================================================================== -->
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>
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"/>
1154 <xsl:variable name="mm.separator">
1156 <xsl:when test="($fop.extensions != 0 or $fop1.extensions != 0 ) and
1157 contains($menuchoice.menu.separator, '→') and
1158 $symbol.font.family != ''">
1159 <fo:inline font-size=".75em" font-family="{$symbol.font.family}">
1160 <xsl:copy-of select="$menuchoice.menu.separator"/>
1164 <xsl:copy-of select="$menuchoice.menu.separator"/>
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>
1179 <xsl:variable name="node" select="$nodelist[$count=position()]"/>
1181 <xsl:when test="local-name($node)='guimenuitem'
1182 or local-name($node)='guisubmenu'">
1183 <xsl:copy-of select="$mm.separator"/>
1186 <xsl:copy-of select="$menuchoice.separator"/>
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>
1198 <!-- ==================================================================== -->
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"/>
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]"/>
1212 <!-- try automatic linking based on match to abbrev -->
1213 <xsl:when test="$target and not(xref) and not(link)">
1215 <xsl:text>[</xsl:text>
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>
1224 <xsl:when test="$bibliography.numbered != 0">
1225 <xsl:apply-templates select="$target" mode="citation"/>
1228 <xsl:call-template name="inline.charseq"/>
1233 <xsl:text>]</xsl:text>
1237 <xsl:text>[</xsl:text>
1238 <xsl:call-template name="inline.charseq"/>
1239 <xsl:text>]</xsl:text>
1244 <xsl:template match="citebiblioid">
1245 <xsl:variable name="targets" select="//*[biblioid = string(current())]"/>
1246 <xsl:variable name="target" select="$targets[1]"/>
1249 <!-- try automatic linking based on match to parent of biblioid -->
1250 <xsl:when test="$target and not(xref) and not(link)">
1252 <xsl:text>[</xsl:text>
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>
1260 <xsl:call-template name="inline.charseq"/>
1263 <xsl:text>]</xsl:text>
1267 <xsl:text>[</xsl:text>
1268 <xsl:call-template name="inline.charseq"/>
1269 <xsl:text>]</xsl:text>
1274 <xsl:template match="biblioentry|bibliomixed" mode="citation">
1275 <xsl:number from="bibliography" count="biblioentry|bibliomixed"
1276 level="any" format="1"/>
1279 <!-- ==================================================================== -->
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"/>
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"/>
1297 <!-- ==================================================================== -->
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>
1308 <xsl:template match="productnumber">
1309 <xsl:call-template name="inline.charseq"/>
1312 <!-- ==================================================================== -->
1314 <xsl:template match="pob|street|city|state|postcode|country|otheraddr">
1315 <xsl:call-template name="inline.charseq"/>
1318 <xsl:template match="phone|fax">
1319 <xsl:call-template name="inline.charseq"/>
1322 <!-- in Addresses, for example -->
1323 <xsl:template match="honorific|firstname|surname|lineage|othername">
1324 <xsl:call-template name="inline.charseq"/>
1327 <!-- ==================================================================== -->
1329 <xsl:template match="person">
1330 <xsl:apply-templates select="personname"/>
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"/>
1338 </xsl:call-template>
1341 <xsl:template match="jobtitle">
1342 <xsl:call-template name="simple.xlink">
1343 <xsl:with-param name="content">
1344 <xsl:apply-templates/>
1346 </xsl:call-template>
1349 <!-- ==================================================================== -->
1351 <xsl:template match="org">
1352 <xsl:call-template name="inline.charseq"/>
1355 <xsl:template match="orgname">
1356 <xsl:call-template name="inline.charseq"/>
1359 <xsl:template match="orgdiv">
1360 <xsl:call-template name="inline.charseq"/>
1363 <xsl:template match="affiliation">
1364 <xsl:call-template name="inline.charseq"/>
1367 <!-- ==================================================================== -->
1369 <xsl:template match="beginpage">
1370 <!-- does nothing; this *is not* markup to force a page break. -->
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.
1380 <xsl:attribute name="color">blue</xsl:attribute>
1382 <!-- Since this is a mode, you can create different
1383 templates with different properties for different linking elements -->