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 9228 2012-02-01 21:50:25Z 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"/>
34 <xsl:when test="$xhref
35 and (not($node/@xlink:type) or
36 $node/@xlink:type='simple')">
38 <!-- Is it a local idref? -->
39 <xsl:variable name="is.idref">
41 <!-- if the href starts with # and does not contain an "(" -->
42 <!-- or if the href starts with #xpointer(id(, it's just an ID -->
43 <xsl:when test="starts-with($xhref,'#')
44 and (not(contains($xhref,'('))
45 or starts-with($xhref,
46 '#xpointer(id('))">1</xsl:when>
47 <xsl:otherwise>0</xsl:otherwise>
51 <!-- Is it an olink ? -->
52 <xsl:variable name="is.olink">
54 <!-- If xlink:role="http://docbook.org/xlink/role/olink" -->
55 <!-- and if the href contains # -->
56 <xsl:when test="contains($xhref,'#') and
57 @xlink:role = $xolink.role">1</xsl:when>
58 <xsl:otherwise>0</xsl:otherwise>
63 <xsl:when test="$is.olink = 1">
64 <xsl:call-template name="olink">
65 <xsl:with-param name="content" select="$content"/>
69 <xsl:when test="$is.idref = 1">
71 <xsl:variable name="idref">
72 <xsl:call-template name="xpointer.idref">
73 <xsl:with-param name="xpointer" select="$xhref"/>
77 <xsl:variable name="targets" select="key('id',$idref)"/>
78 <xsl:variable name="target" select="$targets[1]"/>
80 <xsl:call-template name="check.id.unique">
81 <xsl:with-param name="linkend" select="$idref"/>
85 <xsl:when test="count($target) = 0">
87 <xsl:text>XLink to nonexistent id: </xsl:text>
88 <xsl:value-of select="$idref"/>
90 <xsl:copy-of select="$content"/>
94 <fo:basic-link internal-destination="{$idref}">
95 <xsl:apply-templates select="." mode="simple.xlink.properties"/>
96 <xsl:copy-of select="$content"/>
102 <!-- otherwise it's a URI -->
104 <fo:basic-link external-destination="url({$xhref})">
105 <xsl:apply-templates select="." mode="simple.xlink.properties"/>
106 <xsl:copy-of select="$content"/>
108 <!-- * Call the template for determining whether the URL for this -->
109 <!-- * hyperlink is displayed, and how to display it (either inline or -->
110 <!-- * as a numbered footnote). -->
111 <xsl:call-template name="hyperlink.url.display">
112 <xsl:with-param name="url" select="$xhref"/>
118 <xsl:when test="$linkend">
119 <xsl:variable name="targets" select="key('id',$linkend)"/>
120 <xsl:variable name="target" select="$targets[1]"/>
122 <xsl:call-template name="check.id.unique">
123 <xsl:with-param name="linkend" select="$linkend"/>
127 <xsl:when test="count($target) = 0">
129 <xsl:text>XLink to nonexistent id: </xsl:text>
130 <xsl:value-of select="$linkend"/>
132 <xsl:copy-of select="$content"/>
136 <fo:basic-link internal-destination="{$linkend}">
137 <xsl:apply-templates select="." mode="simple.xlink.properties"/>
138 <xsl:copy-of select="$content"/>
145 <xsl:copy-of select="$content"/>
151 <xsl:template name="inline.charseq">
152 <xsl:param name="content">
153 <xsl:call-template name="simple.xlink">
154 <xsl:with-param name="content">
155 <xsl:apply-templates/>
161 <xsl:when test="@dir">
163 <xsl:attribute name="direction">
165 <xsl:when test="@dir = 'ltr' or @dir = 'lro'">ltr</xsl:when>
166 <xsl:otherwise>rtl</xsl:otherwise>
169 <xsl:copy-of select="$content"/>
173 <xsl:copy-of select="$content"/>
178 <xsl:template name="inline.monoseq">
179 <xsl:param name="content">
180 <xsl:call-template name="simple.xlink">
181 <xsl:with-param name="content">
182 <xsl:apply-templates/>
187 <fo:inline xsl:use-attribute-sets="monospace.properties">
188 <xsl:call-template name="anchor"/>
190 <xsl:attribute name="direction">
192 <xsl:when test="@dir = 'ltr' or @dir = 'lro'">ltr</xsl:when>
193 <xsl:otherwise>rtl</xsl:otherwise>
197 <xsl:copy-of select="$content"/>
201 <xsl:template name="inline.boldseq">
202 <xsl:param name="content">
203 <xsl:call-template name="simple.xlink">
204 <xsl:with-param name="content">
205 <xsl:apply-templates/>
210 <fo:inline font-weight="bold">
212 <xsl:attribute name="direction">
214 <xsl:when test="@dir = 'ltr' or @dir = 'lro'">ltr</xsl:when>
215 <xsl:otherwise>rtl</xsl:otherwise>
219 <xsl:copy-of select="$content"/>
223 <xsl:template name="inline.italicseq">
224 <xsl:param name="content">
225 <xsl:call-template name="simple.xlink">
226 <xsl:with-param name="content">
227 <xsl:apply-templates/>
232 <fo:inline font-style="italic">
233 <xsl:call-template name="anchor"/>
235 <xsl:attribute name="direction">
237 <xsl:when test="@dir = 'ltr' or @dir = 'lro'">ltr</xsl:when>
238 <xsl:otherwise>rtl</xsl:otherwise>
242 <xsl:copy-of select="$content"/>
246 <xsl:template name="inline.boldmonoseq">
247 <xsl:param name="content">
248 <xsl:call-template name="simple.xlink">
249 <xsl:with-param name="content">
250 <xsl:apply-templates/>
255 <fo:inline font-weight="bold" xsl:use-attribute-sets="monospace.properties">
256 <xsl:call-template name="anchor"/>
258 <xsl:attribute name="direction">
260 <xsl:when test="@dir = 'ltr' or @dir = 'lro'">ltr</xsl:when>
261 <xsl:otherwise>rtl</xsl:otherwise>
265 <xsl:copy-of select="$content"/>
269 <xsl:template name="inline.italicmonoseq">
270 <xsl:param name="content">
271 <xsl:call-template name="simple.xlink">
272 <xsl:with-param name="content">
273 <xsl:apply-templates/>
278 <fo:inline font-style="italic" xsl:use-attribute-sets="monospace.properties">
279 <xsl:call-template name="anchor"/>
281 <xsl:attribute name="direction">
283 <xsl:when test="@dir = 'ltr' or @dir = 'lro'">ltr</xsl:when>
284 <xsl:otherwise>rtl</xsl:otherwise>
288 <xsl:copy-of select="$content"/>
292 <xsl:template name="inline.superscriptseq">
293 <xsl:param name="content">
294 <xsl:call-template name="simple.xlink">
295 <xsl:with-param name="content">
296 <xsl:apply-templates/>
301 <fo:inline xsl:use-attribute-sets="superscript.properties">
302 <xsl:call-template name="anchor"/>
304 <xsl:attribute name="direction">
306 <xsl:when test="@dir = 'ltr' or @dir = 'lro'">ltr</xsl:when>
307 <xsl:otherwise>rtl</xsl:otherwise>
312 <xsl:when test="$fop.extensions != 0">
313 <xsl:attribute name="vertical-align">super</xsl:attribute>
316 <xsl:attribute name="baseline-shift">super</xsl:attribute>
319 <xsl:copy-of select="$content"/>
323 <xsl:template name="inline.subscriptseq">
324 <xsl:param name="content">
325 <xsl:call-template name="simple.xlink">
326 <xsl:with-param name="content">
327 <xsl:apply-templates/>
332 <fo:inline xsl:use-attribute-sets="subscript.properties">
333 <xsl:call-template name="anchor"/>
335 <xsl:attribute name="direction">
337 <xsl:when test="@dir = 'ltr' or @dir = 'lro'">ltr</xsl:when>
338 <xsl:otherwise>rtl</xsl:otherwise>
343 <xsl:when test="$fop.extensions != 0">
344 <xsl:attribute name="vertical-align">sub</xsl:attribute>
347 <xsl:attribute name="baseline-shift">sub</xsl:attribute>
350 <xsl:copy-of select="$content"/>
354 <!-- ==================================================================== -->
355 <!-- some special cases -->
357 <xsl:template match="author">
358 <xsl:call-template name="simple.xlink">
359 <xsl:with-param name="content">
360 <xsl:call-template name="person.name"/>
365 <xsl:template match="editor">
366 <xsl:call-template name="simple.xlink">
367 <xsl:with-param name="content">
368 <xsl:call-template name="person.name"/>
373 <xsl:template match="othercredit">
374 <xsl:call-template name="simple.xlink">
375 <xsl:with-param name="content">
376 <xsl:call-template name="person.name"/>
381 <xsl:template match="authorinitials">
382 <xsl:call-template name="inline.charseq"/>
385 <!-- ==================================================================== -->
387 <xsl:template match="accel">
388 <xsl:call-template name="inline.charseq"/>
391 <xsl:template match="action">
392 <xsl:call-template name="inline.charseq"/>
395 <xsl:template match="application">
396 <xsl:call-template name="inline.charseq"/>
399 <xsl:template match="classname">
400 <xsl:call-template name="inline.monoseq"/>
403 <xsl:template match="exceptionname">
404 <xsl:call-template name="inline.monoseq"/>
407 <xsl:template match="interfacename">
408 <xsl:call-template name="inline.monoseq"/>
411 <xsl:template match="methodname">
412 <xsl:call-template name="inline.monoseq"/>
415 <xsl:template match="command">
416 <xsl:call-template name="inline.boldseq"/>
419 <xsl:template match="computeroutput">
420 <xsl:call-template name="inline.monoseq"/>
423 <xsl:template match="constant">
424 <xsl:call-template name="inline.monoseq"/>
427 <xsl:template match="database">
428 <xsl:call-template name="inline.charseq"/>
431 <xsl:template match="date">
432 <!-- should this support locale-specific formatting? how? -->
433 <xsl:call-template name="inline.charseq"/>
436 <xsl:template match="errorcode">
437 <xsl:call-template name="inline.charseq"/>
440 <xsl:template match="errorname">
441 <xsl:call-template name="inline.charseq"/>
444 <xsl:template match="errortype">
445 <xsl:call-template name="inline.charseq"/>
448 <xsl:template match="errortext">
449 <xsl:call-template name="inline.charseq"/>
452 <xsl:template match="envar">
453 <xsl:call-template name="inline.monoseq"/>
456 <xsl:template match="filename">
457 <xsl:call-template name="inline.monoseq"/>
460 <xsl:template match="function">
462 <xsl:when test="$function.parens != '0'
463 and (parameter or function or replaceable)">
464 <xsl:variable name="nodes" select="text()|*"/>
465 <xsl:call-template name="inline.monoseq">
466 <xsl:with-param name="content">
467 <xsl:call-template name="simple.xlink">
468 <xsl:with-param name="content">
469 <xsl:apply-templates select="$nodes[1]"/>
474 <xsl:text>(</xsl:text>
475 <xsl:apply-templates select="$nodes[position()>1]"/>
476 <xsl:text>)</xsl:text>
479 <xsl:call-template name="inline.monoseq"/>
484 <xsl:template match="function/parameter" priority="2">
485 <xsl:call-template name="inline.italicmonoseq"/>
486 <xsl:if test="following-sibling::*">
487 <xsl:text>, </xsl:text>
491 <xsl:template match="function/replaceable" priority="2">
492 <xsl:call-template name="inline.italicmonoseq"/>
493 <xsl:if test="following-sibling::*">
494 <xsl:text>, </xsl:text>
498 <xsl:template match="guibutton">
499 <xsl:call-template name="inline.charseq"/>
502 <xsl:template match="guiicon">
503 <xsl:call-template name="inline.charseq"/>
506 <xsl:template match="guilabel">
507 <xsl:call-template name="inline.charseq"/>
510 <xsl:template match="guimenu">
511 <xsl:call-template name="inline.charseq"/>
514 <xsl:template match="guimenuitem">
515 <xsl:call-template name="inline.charseq"/>
518 <xsl:template match="guisubmenu">
519 <xsl:call-template name="inline.charseq"/>
522 <xsl:template match="hardware">
523 <xsl:call-template name="inline.charseq"/>
526 <xsl:template match="interface">
527 <xsl:call-template name="inline.charseq"/>
530 <xsl:template match="interfacedefinition">
531 <xsl:call-template name="inline.charseq"/>
534 <xsl:template match="keycap">
535 <xsl:call-template name="inline.boldseq"/>
538 <xsl:template match="keycode">
539 <xsl:call-template name="inline.charseq"/>
542 <xsl:template match="keysym">
543 <xsl:call-template name="inline.charseq"/>
546 <xsl:template match="literal">
547 <xsl:call-template name="inline.monoseq"/>
550 <xsl:template match="code">
551 <xsl:call-template name="inline.monoseq"/>
554 <xsl:template match="medialabel">
555 <xsl:call-template name="inline.italicseq"/>
558 <xsl:template match="shortcut">
559 <xsl:call-template name="inline.boldseq"/>
562 <xsl:template match="mousebutton">
563 <xsl:call-template name="inline.charseq"/>
566 <xsl:template match="option">
567 <xsl:call-template name="inline.monoseq"/>
570 <xsl:template match="package">
571 <xsl:call-template name="inline.charseq"/>
574 <xsl:template match="parameter">
575 <xsl:call-template name="inline.italicmonoseq"/>
578 <xsl:template match="property">
579 <xsl:call-template name="inline.charseq"/>
582 <xsl:template match="prompt">
583 <xsl:call-template name="inline.monoseq"/>
586 <xsl:template match="replaceable">
587 <xsl:call-template name="inline.italicmonoseq"/>
590 <xsl:template match="returnvalue">
591 <xsl:call-template name="inline.charseq"/>
594 <xsl:template match="structfield">
595 <xsl:call-template name="inline.italicmonoseq"/>
598 <xsl:template match="structname">
599 <xsl:call-template name="inline.charseq"/>
602 <xsl:template match="symbol">
603 <xsl:call-template name="inline.charseq"/>
606 <xsl:template match="systemitem">
607 <xsl:call-template name="inline.monoseq"/>
610 <xsl:template match="token">
611 <xsl:call-template name="inline.charseq"/>
614 <xsl:template match="type">
615 <xsl:call-template name="inline.charseq"/>
618 <xsl:template match="userinput">
619 <xsl:call-template name="inline.boldmonoseq"/>
622 <xsl:template match="abbrev">
623 <xsl:call-template name="inline.charseq"/>
626 <xsl:template match="acronym">
627 <xsl:call-template name="inline.charseq"/>
630 <xsl:template match="citerefentry">
631 <xsl:call-template name="inline.charseq"/>
634 <xsl:template match="citetitle">
636 <xsl:when test="@pubwork = 'article'">
637 <xsl:call-template name="gentext.startquote"/>
638 <xsl:call-template name="inline.charseq"/>
639 <xsl:call-template name="gentext.endquote"/>
642 <xsl:call-template name="inline.italicseq"/>
647 <xsl:template match="emphasis">
648 <xsl:variable name="depth">
649 <xsl:call-template name="dot.count">
650 <xsl:with-param name="string">
651 <xsl:number level="multiple"/>
657 <xsl:when test="@role='bold' or @role='strong'">
658 <xsl:call-template name="inline.boldseq"/>
660 <xsl:when test="@role='underline'">
661 <fo:inline text-decoration="underline">
662 <xsl:call-template name="inline.charseq"/>
665 <xsl:when test="@role='strikethrough'">
666 <fo:inline text-decoration="line-through">
667 <xsl:call-template name="inline.charseq"/>
672 <xsl:when test="$depth mod 2 = 1">
673 <fo:inline font-style="normal">
674 <xsl:apply-templates/>
678 <xsl:call-template name="inline.italicseq"/>
685 <xsl:template match="foreignphrase">
686 <xsl:call-template name="inline.italicseq"/>
689 <xsl:template match="markup">
690 <xsl:call-template name="inline.charseq"/>
693 <xsl:template match="phrase">
695 <xsl:call-template name="anchor"/>
696 <xsl:call-template name="inline.charseq"/>
700 <xsl:template match="quote">
701 <xsl:variable name="depth">
702 <xsl:call-template name="dot.count">
703 <xsl:with-param name="string"><xsl:number level="multiple"/></xsl:with-param>
706 <xsl:variable name="content">
708 <xsl:when test="$depth mod 2 = 0">
709 <xsl:call-template name="gentext.startquote"/>
710 <xsl:call-template name="inline.charseq"/>
711 <xsl:call-template name="gentext.endquote"/>
714 <xsl:call-template name="gentext.nestedstartquote"/>
715 <xsl:call-template name="inline.charseq"/>
716 <xsl:call-template name="gentext.nestedendquote"/>
722 <xsl:call-template name="anchor"/>
723 <xsl:copy-of select="$content"/>
728 <xsl:template match="varname">
729 <xsl:call-template name="inline.monoseq"/>
732 <xsl:template match="wordasword">
733 <xsl:call-template name="inline.italicseq"/>
736 <xsl:template match="lineannotation">
737 <fo:inline font-style="italic">
738 <xsl:call-template name="inline.charseq"/>
742 <xsl:template match="superscript">
743 <xsl:call-template name="inline.superscriptseq"/>
746 <xsl:template match="subscript">
747 <xsl:call-template name="inline.subscriptseq"/>
750 <xsl:template match="trademark">
751 <xsl:call-template name="inline.charseq"/>
753 <xsl:when test="@class = 'copyright'
754 or @class = 'registered'">
755 <xsl:call-template name="dingbat">
756 <xsl:with-param name="dingbat" select="@class"/>
759 <xsl:when test="@class = 'service'">
760 <xsl:call-template name="inline.superscriptseq">
761 <xsl:with-param name="content" select="'SM'"/>
765 <xsl:call-template name="dingbat">
766 <xsl:with-param name="dingbat" select="'trademark'"/>
772 <xsl:template match="firstterm">
773 <xsl:call-template name="glossterm">
774 <xsl:with-param name="firstterm" select="1"/>
778 <xsl:template match="glossterm" name="glossterm">
779 <xsl:param name="firstterm" select="0"/>
782 <xsl:when test="($firstterm.only.link = 0 or $firstterm = 1) and @linkend">
783 <xsl:variable name="targets" select="key('id',@linkend)"/>
784 <xsl:variable name="target" select="$targets[1]"/>
787 <xsl:when test="$target">
788 <fo:basic-link internal-destination="{@linkend}"
789 xsl:use-attribute-sets="xref.properties">
790 <xsl:call-template name="inline.italicseq"/>
794 <xsl:call-template name="inline.italicseq"/>
799 <xsl:when test="not(@linkend)
800 and ($firstterm.only.link = 0 or $firstterm = 1)
801 and ($glossterm.auto.link != 0)
802 and $glossary.collection != ''">
803 <xsl:variable name="term">
805 <xsl:when test="@baseform"><xsl:value-of select="@baseform"/></xsl:when>
806 <xsl:otherwise><xsl:value-of select="."/></xsl:otherwise>
809 <xsl:variable name="cterm"
810 select="(document($glossary.collection,.)//glossentry[glossterm=$term])[1]"/>
813 <xsl:when test="not($cterm)">
815 <xsl:text>There's no entry for </xsl:text>
816 <xsl:value-of select="$term"/>
817 <xsl:text> in </xsl:text>
818 <xsl:value-of select="$glossary.collection"/>
820 <xsl:call-template name="inline.italicseq"/>
823 <xsl:variable name="id">
824 <xsl:call-template name="object.id">
825 <xsl:with-param name="object" select="$cterm"/>
828 <fo:basic-link internal-destination="{$id}"
829 xsl:use-attribute-sets="xref.properties">
830 <xsl:call-template name="inline.italicseq"/>
836 <xsl:when test="not(@linkend)
837 and ($firstterm.only.link = 0 or $firstterm = 1)
838 and $glossterm.auto.link != 0">
839 <xsl:variable name="term">
841 <xsl:when test="@baseform">
842 <xsl:value-of select="normalize-space(@baseform)"/>
845 <xsl:value-of select="normalize-space(.)"/>
850 <xsl:variable name="targets"
851 select="key('glossentries', $term)"/>
852 <xsl:variable name="target" select="$targets[1]"/>
855 <xsl:when test="count($targets)=0">
857 <xsl:text>Error: no glossentry for glossterm: </xsl:text>
858 <xsl:value-of select="."/>
859 <xsl:text>.</xsl:text>
861 <xsl:call-template name="inline.italicseq"/>
864 <xsl:variable name="termid">
865 <xsl:call-template name="object.id">
866 <xsl:with-param name="object" select="$target"/>
870 <fo:basic-link internal-destination="{$termid}"
871 xsl:use-attribute-sets="xref.properties">
872 <xsl:call-template name="inline.charseq"/>
878 <xsl:call-template name="inline.italicseq"/>
883 <xsl:template match="termdef">
885 <xsl:call-template name="gentext.template">
886 <xsl:with-param name="context" select="'termdef'"/>
887 <xsl:with-param name="name" select="'prefix'"/>
889 <xsl:apply-templates/>
890 <xsl:call-template name="gentext.template">
891 <xsl:with-param name="context" select="'termdef'"/>
892 <xsl:with-param name="name" select="'suffix'"/>
897 <xsl:template match="sgmltag|tag">
898 <xsl:variable name="class">
900 <xsl:when test="@class">
901 <xsl:value-of select="@class"/>
903 <xsl:otherwise>element</xsl:otherwise>
908 <xsl:when test="$class='attribute'">
909 <xsl:call-template name="inline.monoseq"/>
911 <xsl:when test="$class='attvalue'">
912 <xsl:call-template name="inline.monoseq"/>
914 <xsl:when test="$class='element'">
915 <xsl:call-template name="inline.monoseq"/>
917 <xsl:when test="$class='endtag'">
918 <xsl:call-template name="inline.monoseq">
919 <xsl:with-param name="content">
920 <xsl:text></</xsl:text>
921 <xsl:apply-templates/>
922 <xsl:text>></xsl:text>
926 <xsl:when test="$class='genentity'">
927 <xsl:call-template name="inline.monoseq">
928 <xsl:with-param name="content">
929 <xsl:text>&</xsl:text>
930 <xsl:apply-templates/>
931 <xsl:text>;</xsl:text>
935 <xsl:when test="$class='numcharref'">
936 <xsl:call-template name="inline.monoseq">
937 <xsl:with-param name="content">
938 <xsl:text>&#</xsl:text>
939 <xsl:apply-templates/>
940 <xsl:text>;</xsl:text>
944 <xsl:when test="$class='paramentity'">
945 <xsl:call-template name="inline.monoseq">
946 <xsl:with-param name="content">
947 <xsl:text>%</xsl:text>
948 <xsl:apply-templates/>
949 <xsl:text>;</xsl:text>
953 <xsl:when test="$class='pi'">
954 <xsl:call-template name="inline.monoseq">
955 <xsl:with-param name="content">
956 <xsl:text><?</xsl:text>
957 <xsl:apply-templates/>
958 <xsl:text>></xsl:text>
962 <xsl:when test="$class='xmlpi'">
963 <xsl:call-template name="inline.monoseq">
964 <xsl:with-param name="content">
965 <xsl:text><?</xsl:text>
966 <xsl:apply-templates/>
967 <xsl:text>?></xsl:text>
971 <xsl:when test="$class='starttag'">
972 <xsl:call-template name="inline.monoseq">
973 <xsl:with-param name="content">
974 <xsl:text><</xsl:text>
975 <xsl:apply-templates/>
976 <xsl:text>></xsl:text>
980 <xsl:when test="$class='emptytag'">
981 <xsl:call-template name="inline.monoseq">
982 <xsl:with-param name="content">
983 <xsl:text><</xsl:text>
984 <xsl:apply-templates/>
985 <xsl:text>/></xsl:text>
989 <xsl:when test="$class='sgmlcomment' or $class='comment'">
990 <xsl:call-template name="inline.monoseq">
991 <xsl:with-param name="content">
992 <xsl:text><!--</xsl:text>
993 <xsl:apply-templates/>
994 <xsl:text>--></xsl:text>
999 <xsl:call-template name="inline.charseq"/>
1004 <xsl:template match="email">
1005 <xsl:call-template name="inline.monoseq">
1006 <xsl:with-param name="content">
1007 <fo:inline keep-together.within-line="always" hyphenate="false">
1008 <xsl:if test="not($email.delimiters.enabled = 0)">
1009 <xsl:text><</xsl:text>
1012 <xsl:when test="not($email.mailto.enabled = 0)">
1013 <fo:basic-link xsl:use-attribute-sets="xref.properties"
1014 keep-together.within-line="always" hyphenate="false">
1015 <xsl:attribute name="external-destination">
1016 mailto:<xsl:value-of select="string(.)" />
1018 <xsl:apply-templates/>
1022 <xsl:apply-templates/>
1025 <xsl:if test="not($email.delimiters.enabled = 0)">
1026 <xsl:text>></xsl:text>
1030 </xsl:call-template>
1033 <xsl:template match="keycombo">
1034 <xsl:variable name="action" select="@action"/>
1035 <xsl:variable name="joinchar">
1037 <xsl:when test="$action='seq'"><xsl:text> </xsl:text></xsl:when>
1038 <xsl:when test="$action='simul'">+</xsl:when>
1039 <xsl:when test="$action='press'">-</xsl:when>
1040 <xsl:when test="$action='click'">-</xsl:when>
1041 <xsl:when test="$action='double-click'">-</xsl:when>
1042 <xsl:when test="$action='other'"></xsl:when>
1043 <xsl:otherwise>+</xsl:otherwise>
1046 <xsl:for-each select="*">
1047 <xsl:if test="position()>1"><xsl:value-of select="$joinchar"/></xsl:if>
1048 <xsl:apply-templates select="."/>
1052 <xsl:template match="uri">
1053 <xsl:call-template name="inline.monoseq"/>
1056 <!-- ==================================================================== -->
1058 <xsl:template match="menuchoice">
1059 <xsl:variable name="shortcut" select="./shortcut"/>
1060 <xsl:call-template name="process.menuchoice"/>
1061 <xsl:if test="$shortcut">
1062 <xsl:text> (</xsl:text>
1063 <xsl:apply-templates select="$shortcut"/>
1064 <xsl:text>)</xsl:text>
1068 <xsl:template name="process.menuchoice">
1069 <xsl:param name="nodelist" select="guibutton|guiicon|guilabel|guimenu|guimenuitem|guisubmenu|interface"/><!-- not(shortcut) -->
1070 <xsl:param name="count" select="1"/>
1072 <xsl:variable name="mm.separator">
1074 <xsl:when test="($fop.extensions != 0 or $fop1.extensions != 0 ) and
1075 contains($menuchoice.menu.separator, '→')">
1076 <fo:inline font-family="Symbol">
1077 <xsl:copy-of select="$menuchoice.menu.separator"/>
1081 <xsl:copy-of select="$menuchoice.menu.separator"/>
1087 <xsl:when test="$count>count($nodelist)"></xsl:when>
1088 <xsl:when test="$count=1">
1089 <xsl:apply-templates select="$nodelist[$count=position()]"/>
1090 <xsl:call-template name="process.menuchoice">
1091 <xsl:with-param name="nodelist" select="$nodelist"/>
1092 <xsl:with-param name="count" select="$count+1"/>
1093 </xsl:call-template>
1096 <xsl:variable name="node" select="$nodelist[$count=position()]"/>
1098 <xsl:when test="local-name($node)='guimenuitem'
1099 or local-name($node)='guisubmenu'">
1100 <xsl:copy-of select="$mm.separator"/>
1103 <xsl:copy-of select="$menuchoice.separator"/>
1106 <xsl:apply-templates select="$node"/>
1107 <xsl:call-template name="process.menuchoice">
1108 <xsl:with-param name="nodelist" select="$nodelist"/>
1109 <xsl:with-param name="count" select="$count+1"/>
1110 </xsl:call-template>
1115 <!-- ==================================================================== -->
1117 <xsl:template match="optional">
1118 <xsl:value-of select="$arg.choice.opt.open.str"/>
1119 <xsl:call-template name="inline.charseq"/>
1120 <xsl:value-of select="$arg.choice.opt.close.str"/>
1123 <xsl:template match="citation">
1124 <!-- todo: integrate with bibliography collection -->
1125 <xsl:variable name="targets" select="(//biblioentry | //bibliomixed)[abbrev = string(current())]"/>
1126 <xsl:variable name="target" select="$targets[1]"/>
1129 <!-- try automatic linking based on match to abbrev -->
1130 <xsl:when test="$target and not(xref) and not(link)">
1132 <xsl:text>[</xsl:text>
1134 <xsl:attribute name="internal-destination">
1135 <xsl:call-template name="object.id">
1136 <xsl:with-param name="object" select="$target"/>
1137 </xsl:call-template>
1141 <xsl:when test="$bibliography.numbered != 0">
1142 <xsl:apply-templates select="$target" mode="citation"/>
1145 <xsl:call-template name="inline.charseq"/>
1150 <xsl:text>]</xsl:text>
1154 <xsl:text>[</xsl:text>
1155 <xsl:call-template name="inline.charseq"/>
1156 <xsl:text>]</xsl:text>
1161 <xsl:template match="citebiblioid">
1162 <xsl:variable name="targets" select="//*[biblioid = string(current())]"/>
1163 <xsl:variable name="target" select="$targets[1]"/>
1166 <!-- try automatic linking based on match to parent of biblioid -->
1167 <xsl:when test="$target and not(xref) and not(link)">
1169 <xsl:text>[</xsl:text>
1171 <xsl:attribute name="internal-destination">
1172 <xsl:call-template name="object.id">
1173 <xsl:with-param name="object" select="$target"/>
1174 </xsl:call-template>
1177 <xsl:call-template name="inline.charseq"/>
1180 <xsl:text>]</xsl:text>
1184 <xsl:text>[</xsl:text>
1185 <xsl:call-template name="inline.charseq"/>
1186 <xsl:text>]</xsl:text>
1191 <xsl:template match="biblioentry|bibliomixed" mode="citation">
1192 <xsl:number from="bibliography" count="biblioentry|bibliomixed"
1193 level="any" format="1"/>
1196 <!-- ==================================================================== -->
1198 <xsl:template match="comment[&comment.block.parents;]|remark[&comment.block.parents;]">
1199 <xsl:if test="$show.comments != 0">
1200 <fo:block font-style="italic">
1201 <xsl:call-template name="inline.charseq"/>
1206 <xsl:template match="comment|remark">
1207 <xsl:if test="$show.comments != 0">
1208 <fo:inline font-style="italic">
1209 <xsl:call-template name="inline.charseq"/>
1214 <!-- ==================================================================== -->
1216 <xsl:template match="productname">
1217 <xsl:call-template name="inline.charseq"/>
1218 <xsl:if test="@class">
1219 <xsl:call-template name="dingbat">
1220 <xsl:with-param name="dingbat" select="@class"/>
1221 </xsl:call-template>
1225 <xsl:template match="productnumber">
1226 <xsl:call-template name="inline.charseq"/>
1229 <!-- ==================================================================== -->
1231 <xsl:template match="pob|street|city|state|postcode|country|otheraddr">
1232 <xsl:call-template name="inline.charseq"/>
1235 <xsl:template match="phone|fax">
1236 <xsl:call-template name="inline.charseq"/>
1239 <!-- in Addresses, for example -->
1240 <xsl:template match="honorific|firstname|surname|lineage|othername">
1241 <xsl:call-template name="inline.charseq"/>
1244 <!-- ==================================================================== -->
1246 <xsl:template match="person">
1247 <xsl:apply-templates select="personname"/>
1250 <xsl:template match="personname">
1251 <xsl:call-template name="simple.xlink">
1252 <xsl:with-param name="content">
1253 <xsl:call-template name="person.name"/>
1255 </xsl:call-template>
1258 <xsl:template match="jobtitle">
1259 <xsl:call-template name="simple.xlink">
1260 <xsl:with-param name="content">
1261 <xsl:apply-templates/>
1263 </xsl:call-template>
1266 <!-- ==================================================================== -->
1268 <xsl:template match="org">
1269 <xsl:call-template name="inline.charseq"/>
1272 <xsl:template match="orgname">
1273 <xsl:call-template name="inline.charseq"/>
1276 <xsl:template match="orgdiv">
1277 <xsl:call-template name="inline.charseq"/>
1280 <xsl:template match="affiliation">
1281 <xsl:call-template name="inline.charseq"/>
1284 <!-- ==================================================================== -->
1286 <xsl:template match="beginpage">
1287 <!-- does nothing; this *is not* markup to force a page break. -->
1290 <xsl:template match="*" mode="simple.xlink.properties">
1291 <!-- Placeholder template to apply properties to links made from
1292 elements other than xref, link, and olink.
1293 This template should generate attributes only, as it is
1294 applied right after the opening <fo:basic-link> tag.
1297 <xsl:attribute name="color">blue</xsl:attribute>
1299 <!-- Since this is a mode, you can create different
1300 templates with different properties for different linking elements -->