1 <?xml version="1.0" encoding="ASCII"?>
2 <!--This file was created automatically by html2xhtml-->
3 <!--from the HTML stylesheets.-->
4 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:suwl="http://nwalsh.com/xslt/ext/com.nwalsh.saxon.UnwrapLinks" xmlns="http://www.w3.org/1999/xhtml" exclude-result-prefixes="xlink suwl" version="1.0">
6 <!-- ********************************************************************
7 $Id: inline.xsl 9963 2015-05-20 18:37:42Z bobstayton $
8 ********************************************************************
10 This file is part of the XSL DocBook Stylesheet distribution.
11 See ../README or http://docbook.sf.net/release/xsl/current/ for
12 copyright and other information.
14 ******************************************************************** -->
16 <xsl:key name="glossentries" match="glossentry" use="normalize-space(glossterm)"/>
17 <xsl:key name="glossentries" match="glossentry" use="normalize-space(glossterm/@baseform)"/>
19 <xsl:template name="simple.xlink">
20 <xsl:param name="node" select="."/>
21 <xsl:param name="content">
22 <xsl:apply-templates/>
24 <xsl:param name="linkend" select="$node/@linkend"/>
25 <xsl:param name="xhref" select="$node/@xlink:href"/>
27 <!-- check for nested links, which are undefined in the output -->
28 <xsl:if test="($linkend or $xhref) and $node/ancestor::*[@xlink:href or @linkend]">
30 <xsl:text>WARNING: nested link may be undefined in output: </xsl:text>
31 <xsl:text><</xsl:text>
32 <xsl:value-of select="name($node)"/>
33 <xsl:text> </xsl:text>
35 <xsl:when test="$linkend">
36 <xsl:text>@linkend = '</xsl:text>
37 <xsl:value-of select="$linkend"/>
38 <xsl:text>'></xsl:text>
40 <xsl:when test="$xhref">
41 <xsl:text>@xlink:href = '</xsl:text>
42 <xsl:value-of select="$xhref"/>
43 <xsl:text>'></xsl:text>
46 <xsl:text> nested inside parent element </xsl:text>
47 <xsl:value-of select="name($node/parent::*)"/>
51 <!-- Support for @xlink:show -->
52 <xsl:variable name="target.show">
54 <xsl:when test="$node/@xlink:show = 'new'">_blank</xsl:when>
55 <xsl:when test="$node/@xlink:show = 'replace'">_top</xsl:when>
60 <xsl:variable name="link">
62 <xsl:when test="$xhref and (not($node/@xlink:type) or $node/@xlink:type='simple')">
64 <!-- Is it a local idref or a uri? -->
65 <xsl:variable name="is.idref">
67 <!-- if the href starts with # and does not contain an "(" -->
68 <!-- or if the href starts with #xpointer(id(, it's just an ID -->
69 <xsl:when test="starts-with($xhref,'#') and (not(contains($xhref,'(')) or starts-with($xhref, '#xpointer(id('))">1</xsl:when>
70 <xsl:otherwise>0</xsl:otherwise>
74 <!-- Is it an olink ? -->
75 <xsl:variable name="is.olink">
77 <!-- If xlink:role="http://docbook.org/xlink/role/olink" -->
78 <!-- and if the href contains # -->
79 <xsl:when test="contains($xhref,'#') and @xlink:role = $xolink.role">1</xsl:when>
80 <xsl:otherwise>0</xsl:otherwise>
85 <xsl:when test="$is.olink = 1">
86 <xsl:call-template name="olink">
87 <xsl:with-param name="content" select="$content"/>
91 <xsl:when test="$is.idref = 1">
93 <xsl:variable name="idref">
94 <xsl:call-template name="xpointer.idref">
95 <xsl:with-param name="xpointer" select="$xhref"/>
99 <xsl:variable name="targets" select="key('id',$idref)"/>
100 <xsl:variable name="target" select="$targets[1]"/>
102 <xsl:call-template name="check.id.unique">
103 <xsl:with-param name="linkend" select="$idref"/>
107 <xsl:when test="count($target) = 0">
109 <xsl:text>XLink to nonexistent id: </xsl:text>
110 <xsl:value-of select="$idref"/>
112 <xsl:copy-of select="$content"/>
117 <xsl:apply-templates select="." mode="common.html.attributes"/>
118 <!-- id attribute goes on the element calling
119 simple.xlink, not on the anchor element, so
120 this is commented out:
121 <xsl:call-template name="id.attribute"/>
124 <xsl:attribute name="href">
125 <xsl:call-template name="href.target">
126 <xsl:with-param name="object" select="$target"/>
131 <xsl:when test="$node/@xlink:title">
132 <xsl:attribute name="title">
133 <xsl:value-of select="$node/@xlink:title"/>
137 <xsl:apply-templates select="$target" mode="html.title.attribute"/>
141 <xsl:if test="$target.show !=''">
142 <xsl:attribute name="target">
143 <xsl:value-of select="$target.show"/>
147 <xsl:copy-of select="$content"/>
154 <!-- otherwise it's a URI -->
157 <xsl:apply-templates select="." mode="common.html.attributes"/>
158 <xsl:call-template name="id.attribute"/>
159 <xsl:attribute name="href">
160 <xsl:value-of select="$xhref"/>
162 <xsl:if test="$node/@xlink:title">
163 <xsl:attribute name="title">
164 <xsl:value-of select="$node/@xlink:title"/>
168 <!-- For URIs, use @xlink:show if defined, otherwise use ulink.target -->
170 <xsl:when test="$target.show !=''">
171 <xsl:attribute name="target">
172 <xsl:value-of select="$target.show"/>
175 <xsl:when test="$ulink.target !=''">
176 <xsl:attribute name="target">
177 <xsl:value-of select="$ulink.target"/>
182 <xsl:copy-of select="$content"/>
188 <xsl:when test="$linkend">
189 <xsl:variable name="targets" select="key('id',$linkend)"/>
190 <xsl:variable name="target" select="$targets[1]"/>
192 <xsl:call-template name="check.id.unique">
193 <xsl:with-param name="linkend" select="$linkend"/>
197 <xsl:apply-templates select="." mode="common.html.attributes"/>
198 <xsl:call-template name="id.attribute"/>
199 <xsl:attribute name="href">
200 <xsl:call-template name="href.target">
201 <xsl:with-param name="object" select="$target"/>
205 <xsl:apply-templates select="$target" mode="html.title.attribute"/>
207 <xsl:copy-of select="$content"/>
212 <xsl:copy-of select="$content"/>
218 <xsl:when test="function-available('suwl:unwrapLinks')">
219 <xsl:copy-of select="suwl:unwrapLinks($link)"/>
222 <xsl:copy-of select="$link"/>
227 <xsl:template name="inline.charseq">
228 <xsl:param name="content">
229 <xsl:apply-templates/>
232 <xsl:param name="contentwithlink">
233 <xsl:call-template name="anchor"/>
234 <xsl:call-template name="simple.xlink">
235 <xsl:with-param name="content" select="$content"/>
239 <!-- * if you want output from the inline.charseq template wrapped in -->
240 <!-- * something other than a Span, call the template with some value -->
241 <!-- * for the 'wrapper-name' param -->
242 <xsl:param name="wrapper-name">span</xsl:param>
243 <xsl:element name="{$wrapper-name}" namespace="http://www.w3.org/1999/xhtml">
244 <xsl:call-template name="common.html.attributes"/>
245 <xsl:call-template name="id.attribute"/>
246 <xsl:call-template name="generate.html.title"/>
247 <xsl:copy-of select="$contentwithlink"/>
248 <xsl:call-template name="apply-annotations"/>
252 <xsl:template name="inline.monoseq">
253 <xsl:param name="content">
254 <xsl:apply-templates/>
257 <xsl:param name="contentwithlink">
258 <xsl:call-template name="anchor"/>
259 <xsl:call-template name="simple.xlink">
260 <xsl:with-param name="content" select="$content"/>
265 <xsl:apply-templates select="." mode="common.html.attributes"/>
266 <xsl:call-template name="id.attribute"/>
267 <xsl:copy-of select="$contentwithlink"/>
268 <xsl:call-template name="apply-annotations"/>
272 <xsl:template name="inline.boldseq">
273 <xsl:param name="content">
274 <xsl:apply-templates/>
277 <xsl:param name="contentwithlink">
278 <xsl:call-template name="anchor"/>
279 <xsl:call-template name="simple.xlink">
280 <xsl:with-param name="content" select="$content"/>
285 <xsl:apply-templates select="." mode="common.html.attributes"/>
286 <xsl:call-template name="id.attribute"/>
288 <!-- don't put <strong> inside figure, example, or table titles -->
290 <xsl:when test="local-name(..) = 'title' and (local-name(../..) = 'figure' or local-name(../..) = 'example' or local-name(../..) = 'table')">
291 <xsl:copy-of select="$contentwithlink"/>
295 <xsl:copy-of select="$contentwithlink"/>
299 <xsl:call-template name="apply-annotations"/>
303 <xsl:template name="inline.italicseq">
304 <xsl:param name="content">
305 <xsl:apply-templates/>
308 <xsl:param name="contentwithlink">
309 <xsl:call-template name="anchor"/>
310 <xsl:call-template name="simple.xlink">
311 <xsl:with-param name="content" select="$content"/>
316 <xsl:call-template name="common.html.attributes"/>
317 <xsl:call-template name="id.attribute"/>
318 <xsl:copy-of select="$contentwithlink"/>
319 <xsl:call-template name="apply-annotations"/>
323 <xsl:template name="inline.boldmonoseq">
324 <xsl:param name="content">
325 <xsl:apply-templates/>
328 <xsl:param name="contentwithlink">
329 <xsl:call-template name="anchor"/>
330 <xsl:call-template name="simple.xlink">
331 <xsl:with-param name="content" select="$content"/>
335 <!-- don't put <strong> inside figure, example, or table titles -->
336 <!-- or other titles that may already be represented with <strong>'s. -->
338 <xsl:when test="local-name(..) = 'title' and (local-name(../..) = 'figure' or local-name(../..) = 'example' or local-name(../..) = 'table' or local-name(../..) = 'formalpara')">
340 <xsl:call-template name="common.html.attributes"/>
341 <xsl:call-template name="id.attribute"/>
342 <xsl:copy-of select="$contentwithlink"/>
343 <xsl:call-template name="apply-annotations"/>
348 <xsl:call-template name="common.html.attributes"/>
349 <xsl:call-template name="id.attribute"/>
351 <xsl:call-template name="generate.html.title"/>
352 <xsl:call-template name="dir"/>
353 <xsl:copy-of select="$contentwithlink"/>
355 <xsl:call-template name="apply-annotations"/>
361 <xsl:template name="inline.italicmonoseq">
362 <xsl:param name="content">
363 <xsl:apply-templates/>
366 <xsl:param name="contentwithlink">
367 <xsl:call-template name="anchor"/>
368 <xsl:call-template name="simple.xlink">
369 <xsl:with-param name="content" select="$content"/>
374 <xsl:call-template name="common.html.attributes"/>
375 <xsl:call-template name="id.attribute"/>
377 <xsl:call-template name="generate.html.title"/>
378 <xsl:call-template name="dir"/>
379 <xsl:copy-of select="$contentwithlink"/>
380 <xsl:call-template name="apply-annotations"/>
385 <xsl:template name="inline.superscriptseq">
386 <xsl:param name="content">
387 <xsl:apply-templates/>
390 <xsl:param name="contentwithlink">
391 <xsl:call-template name="anchor"/>
392 <xsl:call-template name="simple.xlink">
393 <xsl:with-param name="content" select="$content"/>
398 <xsl:call-template name="generate.html.title"/>
399 <xsl:call-template name="id.attribute"/>
400 <xsl:call-template name="dir"/>
401 <xsl:copy-of select="$contentwithlink"/>
402 <xsl:call-template name="apply-annotations"/>
406 <xsl:template name="inline.subscriptseq">
407 <xsl:param name="content">
408 <xsl:apply-templates/>
411 <xsl:param name="contentwithlink">
412 <xsl:call-template name="anchor"/>
413 <xsl:call-template name="simple.xlink">
414 <xsl:with-param name="content" select="$content"/>
419 <xsl:call-template name="generate.html.title"/>
420 <xsl:call-template name="id.attribute"/>
421 <xsl:call-template name="dir"/>
422 <xsl:copy-of select="$contentwithlink"/>
423 <xsl:call-template name="apply-annotations"/>
427 <!-- ==================================================================== -->
428 <!-- some special cases -->
430 <xsl:template match="author">
431 <xsl:param name="content">
432 <xsl:call-template name="person.name"/>
435 <xsl:param name="contentwithlink">
436 <xsl:call-template name="anchor"/>
437 <xsl:call-template name="simple.xlink">
438 <xsl:with-param name="content" select="$content"/>
440 <xsl:call-template name="apply-annotations"/>
444 <xsl:call-template name="common.html.attributes"/>
445 <xsl:call-template name="id.attribute"/>
446 <xsl:copy-of select="$contentwithlink"/>
450 <xsl:template match="editor">
451 <xsl:param name="content">
452 <xsl:call-template name="person.name"/>
455 <xsl:param name="contentwithlink">
456 <xsl:call-template name="anchor"/>
457 <xsl:call-template name="simple.xlink">
458 <xsl:with-param name="content" select="$content"/>
460 <xsl:call-template name="apply-annotations"/>
464 <xsl:call-template name="common.html.attributes"/>
465 <xsl:call-template name="id.attribute"/>
466 <xsl:copy-of select="$contentwithlink"/>
470 <xsl:template match="othercredit">
471 <xsl:param name="content">
472 <xsl:call-template name="person.name"/>
475 <xsl:param name="contentwithlink">
476 <xsl:call-template name="anchor"/>
477 <xsl:call-template name="simple.xlink">
478 <xsl:with-param name="content" select="$content"/>
480 <xsl:call-template name="apply-annotations"/>
484 <xsl:call-template name="common.html.attributes"/>
485 <xsl:call-template name="id.attribute"/>
486 <xsl:copy-of select="$contentwithlink"/>
490 <xsl:template match="authorinitials">
491 <xsl:call-template name="inline.charseq"/>
494 <!-- ==================================================================== -->
496 <xsl:template match="accel">
497 <xsl:call-template name="inline.charseq"/>
500 <xsl:template match="action">
501 <xsl:call-template name="inline.charseq"/>
504 <xsl:template match="application">
505 <xsl:call-template name="inline.charseq"/>
508 <xsl:template match="classname">
509 <xsl:call-template name="inline.monoseq"/>
512 <xsl:template match="exceptionname">
513 <xsl:call-template name="inline.monoseq"/>
516 <xsl:template match="interfacename">
517 <xsl:call-template name="inline.monoseq"/>
520 <xsl:template match="methodname">
521 <xsl:call-template name="inline.monoseq"/>
524 <xsl:template match="command">
525 <xsl:call-template name="inline.boldseq"/>
528 <xsl:template match="computeroutput">
529 <xsl:call-template name="inline.monoseq"/>
532 <xsl:template match="constant">
533 <xsl:call-template name="inline.monoseq"/>
536 <xsl:template match="database">
537 <xsl:call-template name="inline.charseq"/>
540 <xsl:template match="date">
541 <!-- should this support locale-specific formatting? how? -->
542 <xsl:call-template name="inline.charseq"/>
545 <xsl:template match="errorcode">
546 <xsl:call-template name="inline.charseq"/>
549 <xsl:template match="errorname">
550 <xsl:call-template name="inline.charseq"/>
553 <xsl:template match="errortype">
554 <xsl:call-template name="inline.charseq"/>
557 <xsl:template match="errortext">
558 <xsl:call-template name="inline.charseq"/>
561 <xsl:template match="envar">
562 <xsl:call-template name="inline.monoseq"/>
565 <xsl:template match="filename">
566 <xsl:call-template name="inline.monoseq"/>
569 <xsl:template match="function">
571 <xsl:when test="$function.parens != '0' and (parameter or function or replaceable)">
572 <xsl:variable name="nodes" select="text()|*"/>
573 <xsl:call-template name="inline.monoseq">
574 <xsl:with-param name="content">
575 <xsl:call-template name="simple.xlink">
576 <xsl:with-param name="content">
577 <xsl:apply-templates select="$nodes[1]"/>
582 <xsl:text>(</xsl:text>
583 <xsl:apply-templates select="$nodes[position()>1]"/>
584 <xsl:text>)</xsl:text>
587 <xsl:call-template name="inline.monoseq"/>
592 <xsl:template match="function/parameter" priority="2">
593 <xsl:call-template name="inline.italicmonoseq"/>
594 <xsl:if test="$function.parens != 0 and following-sibling::*">
595 <xsl:text>, </xsl:text>
599 <xsl:template match="function/replaceable" priority="2">
600 <xsl:call-template name="inline.italicmonoseq"/>
601 <xsl:if test="$function.parens != 0 and following-sibling::*">
602 <xsl:text>, </xsl:text>
606 <xsl:template match="guibutton">
607 <xsl:call-template name="inline.charseq"/>
610 <xsl:template match="guiicon">
611 <xsl:call-template name="inline.charseq"/>
614 <xsl:template match="guilabel">
615 <xsl:call-template name="inline.charseq"/>
618 <xsl:template match="guimenu">
619 <xsl:call-template name="inline.charseq"/>
622 <xsl:template match="guimenuitem">
623 <xsl:call-template name="inline.charseq"/>
626 <xsl:template match="guisubmenu">
627 <xsl:call-template name="inline.charseq"/>
630 <xsl:template match="hardware">
631 <xsl:call-template name="inline.charseq"/>
634 <xsl:template match="interface">
635 <xsl:call-template name="inline.charseq"/>
638 <xsl:template match="interfacedefinition">
639 <xsl:call-template name="inline.charseq"/>
642 <xsl:template match="keycap">
644 <xsl:when test="@function and normalize-space(.) = ''">
645 <xsl:call-template name="inline.boldseq">
646 <xsl:with-param name="content">
647 <xsl:call-template name="gentext.template">
648 <xsl:with-param name="context" select="'keycap'"/>
649 <xsl:with-param name="name" select="@function"/>
655 <xsl:call-template name="inline.boldseq"/>
660 <xsl:template match="keycode">
661 <xsl:call-template name="inline.charseq"/>
664 <xsl:template match="keysym">
665 <xsl:call-template name="inline.charseq"/>
668 <xsl:template match="literal">
669 <xsl:call-template name="inline.monoseq"/>
672 <xsl:template match="code">
673 <xsl:call-template name="inline.monoseq"/>
676 <xsl:template match="medialabel">
677 <xsl:call-template name="inline.italicseq"/>
680 <xsl:template match="shortcut">
681 <xsl:call-template name="inline.boldseq"/>
684 <xsl:template match="mousebutton">
685 <xsl:call-template name="inline.charseq"/>
688 <xsl:template match="option">
689 <xsl:call-template name="inline.monoseq"/>
692 <xsl:template match="package">
693 <xsl:call-template name="inline.charseq"/>
696 <xsl:template match="parameter">
697 <xsl:call-template name="inline.italicmonoseq"/>
700 <xsl:template match="property">
701 <xsl:call-template name="inline.charseq"/>
704 <xsl:template match="prompt">
705 <xsl:call-template name="inline.monoseq"/>
708 <xsl:template match="replaceable" priority="1">
709 <xsl:call-template name="inline.italicmonoseq"/>
712 <xsl:template match="returnvalue">
713 <xsl:call-template name="inline.charseq"/>
716 <xsl:template match="structfield">
717 <xsl:call-template name="inline.italicmonoseq"/>
720 <xsl:template match="structname">
721 <xsl:call-template name="inline.charseq"/>
724 <xsl:template match="symbol">
725 <xsl:call-template name="inline.charseq"/>
728 <xsl:template match="systemitem">
729 <xsl:call-template name="inline.monoseq"/>
732 <xsl:template match="token">
733 <xsl:call-template name="inline.charseq"/>
736 <xsl:template match="type">
737 <xsl:call-template name="inline.charseq"/>
740 <xsl:template match="userinput">
741 <xsl:call-template name="inline.boldmonoseq"/>
744 <xsl:template match="abbrev">
745 <xsl:call-template name="inline.charseq">
746 <xsl:with-param name="wrapper-name">abbr</xsl:with-param>
750 <xsl:template match="acronym">
751 <xsl:call-template name="inline.charseq">
752 <xsl:with-param name="wrapper-name">acronym</xsl:with-param>
756 <xsl:template match="citerefentry">
758 <xsl:when test="$citerefentry.link != '0'">
760 <xsl:apply-templates select="." mode="common.html.attributes"/>
761 <xsl:attribute name="href">
762 <xsl:call-template name="generate.citerefentry.link"/>
764 <xsl:call-template name="inline.charseq"/>
768 <xsl:call-template name="inline.charseq"/>
773 <xsl:template name="generate.citerefentry.link">
777 <xsl:template name="x.generate.citerefentry.link">
778 <xsl:text>http://example.com/cgi-bin/man.cgi?</xsl:text>
779 <xsl:value-of select="refentrytitle"/>
780 <xsl:text>(</xsl:text>
781 <xsl:value-of select="manvolnum"/>
782 <xsl:text>)</xsl:text>
785 <xsl:template match="citetitle">
787 <xsl:when test="@pubwork = 'article'">
788 <xsl:call-template name="gentext.startquote"/>
789 <xsl:call-template name="inline.charseq"/>
790 <xsl:call-template name="gentext.endquote"/>
793 <xsl:call-template name="inline.italicseq"/>
798 <xsl:template match="emphasis">
800 <xsl:call-template name="id.attribute"/>
802 <!-- We don't want empty @class values, so do not propagate empty @roles -->
803 <xsl:when test="@role and normalize-space(@role) != '' and $emphasis.propagates.style != 0">
804 <xsl:apply-templates select="." mode="common.html.attributes">
805 <xsl:with-param name="class" select="@role"/>
806 </xsl:apply-templates>
809 <xsl:apply-templates select="." mode="common.html.attributes"/>
812 <xsl:call-template name="anchor"/>
814 <xsl:call-template name="simple.xlink">
815 <xsl:with-param name="content">
817 <xsl:when test="@role = 'bold' or @role='strong'">
818 <!-- backwards compatibility: make bold into b elements, but -->
819 <!-- don't put bold inside figure, example, or table titles -->
821 <xsl:when test="local-name(..) = 'title' and (local-name(../..) = 'figure' or local-name(../..) = 'example' or local-name(../..) = 'table')">
822 <xsl:apply-templates/>
825 <strong><xsl:apply-templates/></strong>
829 <xsl:when test="@role and $emphasis.propagates.style != 0">
830 <xsl:apply-templates/>
833 <em><xsl:apply-templates/></em>
841 <xsl:template match="foreignphrase">
843 <xsl:apply-templates select="." mode="common.html.attributes"/>
844 <xsl:call-template name="inline.italicseq"/>
848 <xsl:template match="markup">
849 <xsl:call-template name="inline.charseq"/>
852 <xsl:template match="phrase">
854 <xsl:call-template name="id.attribute"/>
855 <xsl:call-template name="locale.html.attributes"/>
856 <!-- We don't want empty @class values, so do not propagate empty @roles -->
858 <xsl:when test="@role and normalize-space(@role) != '' and $phrase.propagates.style != 0">
859 <xsl:apply-templates select="." mode="class.attribute">
860 <xsl:with-param name="class" select="@role"/>
861 </xsl:apply-templates>
864 <xsl:apply-templates select="." mode="class.attribute"/>
867 <xsl:call-template name="dir"/>
868 <xsl:call-template name="anchor"/>
869 <xsl:call-template name="simple.xlink">
870 <xsl:with-param name="content">
871 <xsl:apply-templates/>
874 <xsl:call-template name="apply-annotations"/>
878 <xsl:template match="quote">
879 <xsl:variable name="depth">
880 <xsl:call-template name="dot.count">
881 <xsl:with-param name="string">
882 <xsl:number level="multiple"/>
887 <xsl:apply-templates select="." mode="common.html.attributes"/>
889 <xsl:when test="$depth mod 2 = 0">
890 <xsl:call-template name="gentext.startquote"/>
891 <xsl:call-template name="inline.charseq"/>
892 <xsl:call-template name="gentext.endquote"/>
895 <xsl:call-template name="gentext.nestedstartquote"/>
896 <xsl:call-template name="inline.charseq"/>
897 <xsl:call-template name="gentext.nestedendquote"/>
903 <xsl:template match="varname">
904 <xsl:call-template name="inline.monoseq"/>
907 <xsl:template match="wordasword">
908 <xsl:call-template name="inline.italicseq"/>
911 <xsl:template match="lineannotation">
913 <xsl:apply-templates select="." mode="common.html.attributes"/>
914 <xsl:call-template name="inline.charseq"/>
918 <xsl:template match="superscript">
919 <xsl:call-template name="inline.superscriptseq"/>
922 <xsl:template match="subscript">
923 <xsl:call-template name="inline.subscriptseq"/>
926 <xsl:template match="trademark">
927 <xsl:call-template name="inline.charseq"/>
929 <xsl:when test="@class = 'copyright' or @class = 'registered'">
930 <xsl:call-template name="dingbat">
931 <xsl:with-param name="dingbat" select="@class"/>
934 <xsl:when test="@class = 'service'">
938 <xsl:call-template name="dingbat">
939 <xsl:with-param name="dingbat" select="'trademark'"/>
945 <xsl:template match="firstterm">
946 <xsl:call-template name="glossterm">
947 <xsl:with-param name="firstterm" select="1"/>
951 <xsl:template match="glossterm" name="glossterm">
952 <xsl:param name="firstterm" select="0"/>
954 <!-- To avoid extra <a name=""> anchor from inline.italicseq -->
955 <xsl:variable name="content">
956 <xsl:apply-templates/>
960 <xsl:when test="($firstterm.only.link = 0 or $firstterm = 1) and @linkend">
961 <xsl:variable name="targets" select="key('id',@linkend)"/>
962 <xsl:variable name="target" select="$targets[1]"/>
964 <xsl:call-template name="check.id.unique">
965 <xsl:with-param name="linkend" select="@linkend"/>
969 <xsl:when test="$target">
971 <xsl:apply-templates select="." mode="common.html.attributes"/>
973 <xsl:attribute name="href">
974 <xsl:call-template name="href.target">
975 <xsl:with-param name="object" select="$target"/>
979 <xsl:call-template name="inline.italicseq">
980 <xsl:with-param name="content" select="$content"/>
985 <xsl:call-template name="inline.italicseq">
986 <xsl:with-param name="content" select="$content"/>
992 <xsl:when test="not(@linkend) and ($firstterm.only.link = 0 or $firstterm = 1) and ($glossterm.auto.link != 0) and $glossary.collection != ''">
993 <xsl:variable name="term">
995 <xsl:when test="@baseform"><xsl:value-of select="@baseform"/></xsl:when>
996 <xsl:otherwise><xsl:value-of select="."/></xsl:otherwise>
1000 <xsl:variable name="cterm" select="(document($glossary.collection,.)//glossentry[glossterm=$term])[1]"/>
1002 <!-- HACK HACK HACK! But it works... -->
1003 <!-- You'd need to do more work if you wanted to chunk on glossdiv, though -->
1005 <xsl:variable name="glossary" select="//glossary[@role='auto']"/>
1007 <xsl:if test="count($glossary) != 1">
1009 <xsl:text>Warning: glossary.collection specified, but there are </xsl:text>
1010 <xsl:value-of select="count($glossary)"/>
1011 <xsl:text> automatic glossaries</xsl:text>
1015 <xsl:variable name="glosschunk">
1016 <xsl:call-template name="href.target">
1017 <xsl:with-param name="object" select="$glossary"/>
1018 </xsl:call-template>
1021 <xsl:variable name="chunkbase">
1023 <xsl:when test="contains($glosschunk, '#')">
1024 <xsl:value-of select="substring-before($glosschunk, '#')"/>
1027 <xsl:value-of select="$glosschunk"/>
1033 <xsl:when test="not($cterm)">
1035 <xsl:text>There's no entry for </xsl:text>
1036 <xsl:value-of select="$term"/>
1037 <xsl:text> in </xsl:text>
1038 <xsl:value-of select="$glossary.collection"/>
1040 <xsl:call-template name="inline.italicseq"/>
1043 <xsl:variable name="id">
1044 <xsl:call-template name="object.id">
1045 <xsl:with-param name="object" select="$cterm"/>
1046 </xsl:call-template>
1048 <a href="{$chunkbase}#{$id}">
1049 <xsl:apply-templates select="." mode="common.html.attributes"/>
1050 <xsl:call-template name="inline.italicseq">
1051 <xsl:with-param name="content" select="$content"/>
1052 </xsl:call-template>
1058 <xsl:when test="not(@linkend) and ($firstterm.only.link = 0 or $firstterm = 1) and $glossterm.auto.link != 0">
1059 <xsl:variable name="term">
1061 <xsl:when test="@baseform">
1062 <xsl:value-of select="normalize-space(@baseform)"/>
1065 <xsl:value-of select="normalize-space(.)"/>
1069 <xsl:variable name="targets" select="key('glossentries', $term)"/>
1070 <xsl:variable name="target" select="$targets[1]"/>
1073 <xsl:when test="count($targets)=0">
1075 <xsl:text>Error: no glossentry for glossterm: </xsl:text>
1076 <xsl:value-of select="."/>
1077 <xsl:text>.</xsl:text>
1079 <xsl:call-template name="inline.italicseq"/>
1083 <xsl:apply-templates select="." mode="common.html.attributes"/>
1084 <xsl:if test="@id or @xml:id">
1085 <xsl:attribute name="id">
1086 <xsl:value-of select="(@id|@xml:id)[1]"/>
1090 <xsl:attribute name="href">
1091 <xsl:call-template name="href.target">
1092 <xsl:with-param name="object" select="$target"/>
1093 </xsl:call-template>
1096 <xsl:call-template name="inline.italicseq">
1097 <xsl:with-param name="content" select="$content"/>
1098 </xsl:call-template>
1105 <xsl:call-template name="inline.italicseq"/>
1110 <xsl:template match="termdef">
1112 <xsl:apply-templates select="." mode="common.html.attributes"/>
1113 <xsl:call-template name="gentext.template">
1114 <xsl:with-param name="context" select="'termdef'"/>
1115 <xsl:with-param name="name" select="'prefix'"/>
1116 </xsl:call-template>
1117 <xsl:apply-templates/>
1118 <xsl:call-template name="gentext.template">
1119 <xsl:with-param name="context" select="'termdef'"/>
1120 <xsl:with-param name="name" select="'suffix'"/>
1121 </xsl:call-template>
1125 <xsl:template match="sgmltag|tag">
1126 <xsl:call-template name="format.sgmltag"/>
1129 <xsl:template name="format.sgmltag">
1130 <xsl:param name="class">
1132 <xsl:when test="@class">
1133 <xsl:value-of select="@class"/>
1135 <xsl:otherwise>element</xsl:otherwise>
1139 <xsl:variable name="content">
1141 <xsl:when test="$class='attribute'">
1142 <xsl:apply-templates/>
1144 <xsl:when test="$class='attvalue'">
1145 <xsl:apply-templates/>
1147 <xsl:when test="$class='element'">
1148 <xsl:apply-templates/>
1150 <xsl:when test="$class='endtag'">
1151 <xsl:text></</xsl:text>
1152 <xsl:apply-templates/>
1153 <xsl:text>></xsl:text>
1155 <xsl:when test="$class='genentity'">
1156 <xsl:text>&</xsl:text>
1157 <xsl:apply-templates/>
1158 <xsl:text>;</xsl:text>
1160 <xsl:when test="$class='numcharref'">
1161 <xsl:text>&#</xsl:text>
1162 <xsl:apply-templates/>
1163 <xsl:text>;</xsl:text>
1165 <xsl:when test="$class='paramentity'">
1166 <xsl:text>%</xsl:text>
1167 <xsl:apply-templates/>
1168 <xsl:text>;</xsl:text>
1170 <xsl:when test="$class='pi'">
1171 <xsl:text><?</xsl:text>
1172 <xsl:apply-templates/>
1173 <xsl:text>></xsl:text>
1175 <xsl:when test="$class='xmlpi'">
1176 <xsl:text><?</xsl:text>
1177 <xsl:apply-templates/>
1178 <xsl:text>?></xsl:text>
1180 <xsl:when test="$class='starttag'">
1181 <xsl:text><</xsl:text>
1182 <xsl:apply-templates/>
1183 <xsl:text>></xsl:text>
1185 <xsl:when test="$class='emptytag'">
1186 <xsl:text><</xsl:text>
1187 <xsl:apply-templates/>
1188 <xsl:text>/></xsl:text>
1190 <xsl:when test="$class='sgmlcomment' or $class='comment'">
1191 <xsl:text><!--</xsl:text>
1192 <xsl:apply-templates/>
1193 <xsl:text>--></xsl:text>
1196 <xsl:apply-templates/>
1202 <xsl:apply-templates select="." mode="common.html.attributes">
1203 <xsl:with-param name="class" select="concat('sgmltag-', $class)"/>
1204 </xsl:apply-templates>
1205 <xsl:call-template name="simple.xlink">
1206 <xsl:with-param name="content" select="$content"/>
1207 </xsl:call-template>
1211 <xsl:template match="email">
1212 <xsl:call-template name="inline.monoseq">
1213 <xsl:with-param name="content">
1214 <xsl:if test="not($email.delimiters.enabled = 0)">
1215 <xsl:text><</xsl:text>
1218 <xsl:apply-templates select="." mode="common.html.attributes"/>
1219 <xsl:call-template name="id.attribute"/>
1220 <xsl:attribute name="href">
1221 <xsl:text>mailto:</xsl:text>
1222 <xsl:value-of select="."/>
1224 <xsl:apply-templates/>
1226 <xsl:if test="not($email.delimiters.enabled = 0)">
1227 <xsl:text>></xsl:text>
1230 </xsl:call-template>
1233 <xsl:template match="keycombo">
1234 <xsl:variable name="action" select="@action"/>
1235 <xsl:variable name="joinchar">
1237 <xsl:when test="$action='seq'"><xsl:text> </xsl:text></xsl:when>
1238 <xsl:when test="$action='simul'">+</xsl:when>
1239 <xsl:when test="$action='press'">-</xsl:when>
1240 <xsl:when test="$action='click'">-</xsl:when>
1241 <xsl:when test="$action='double-click'">-</xsl:when>
1242 <xsl:when test="$action='other'"/>
1243 <xsl:otherwise>+</xsl:otherwise>
1246 <xsl:for-each select="*">
1247 <xsl:if test="position()>1"><xsl:value-of select="$joinchar"/></xsl:if>
1248 <xsl:apply-templates select="."/>
1252 <xsl:template match="uri">
1253 <xsl:call-template name="inline.monoseq"/>
1256 <!-- ==================================================================== -->
1258 <xsl:template match="menuchoice">
1259 <xsl:variable name="shortcut" select="./shortcut"/>
1260 <xsl:call-template name="process.menuchoice"/>
1261 <xsl:if test="$shortcut">
1262 <xsl:text> (</xsl:text>
1263 <xsl:apply-templates select="$shortcut"/>
1264 <xsl:text>)</xsl:text>
1268 <xsl:template name="process.menuchoice">
1269 <xsl:param name="nodelist" select="guibutton|guiicon|guilabel|guimenu|guimenuitem|guisubmenu|interface"/><!-- not(shortcut) -->
1270 <xsl:param name="count" select="1"/>
1273 <xsl:when test="$count>count($nodelist)"/>
1274 <xsl:when test="$count=1">
1275 <xsl:apply-templates select="$nodelist[$count=position()]"/>
1276 <xsl:call-template name="process.menuchoice">
1277 <xsl:with-param name="nodelist" select="$nodelist"/>
1278 <xsl:with-param name="count" select="$count+1"/>
1279 </xsl:call-template>
1282 <xsl:variable name="node" select="$nodelist[$count=position()]"/>
1284 <xsl:when test="local-name($node)='guimenuitem' or local-name($node)='guisubmenu'">
1285 <xsl:value-of select="$menuchoice.menu.separator"/>
1288 <xsl:value-of select="$menuchoice.separator"/>
1291 <xsl:apply-templates select="$node"/>
1292 <xsl:call-template name="process.menuchoice">
1293 <xsl:with-param name="nodelist" select="$nodelist"/>
1294 <xsl:with-param name="count" select="$count+1"/>
1295 </xsl:call-template>
1300 <!-- ==================================================================== -->
1302 <xsl:template match="optional">
1303 <xsl:value-of select="$arg.choice.opt.open.str"/>
1304 <xsl:call-template name="inline.charseq"/>
1305 <xsl:value-of select="$arg.choice.opt.close.str"/>
1308 <xsl:template match="citation">
1309 <!-- todo: integrate with bibliography collection -->
1310 <xsl:variable name="targets" select="(//biblioentry | //bibliomixed)[abbrev = string(current())]"/>
1311 <xsl:variable name="target" select="$targets[1]"/>
1314 <!-- try automatic linking based on match to abbrev -->
1315 <xsl:when test="$target and not(xref) and not(link)">
1317 <xsl:text>[</xsl:text>
1319 <xsl:apply-templates select="." mode="common.html.attributes"/>
1320 <xsl:attribute name="href">
1321 <xsl:call-template name="href.target">
1322 <xsl:with-param name="object" select="$target"/>
1323 </xsl:call-template>
1327 <xsl:when test="$bibliography.numbered != 0">
1328 <xsl:call-template name="id.attribute"/>
1329 <xsl:apply-templates select="$target" mode="citation"/>
1332 <xsl:call-template name="inline.charseq"/>
1337 <xsl:text>]</xsl:text>
1340 <xsl:text>[</xsl:text>
1341 <xsl:call-template name="inline.charseq"/>
1342 <xsl:text>]</xsl:text>
1347 <xsl:template match="citebiblioid">
1348 <xsl:variable name="targets" select="//*[biblioid = string(current())]"/>
1349 <xsl:variable name="target" select="$targets[1]"/>
1352 <!-- try automatic linking based on match to parent of biblioid -->
1353 <xsl:when test="$target and not(xref) and not(link)">
1355 <xsl:text>[</xsl:text>
1357 <xsl:apply-templates select="." mode="common.html.attributes"/>
1358 <xsl:attribute name="href">
1359 <xsl:call-template name="href.target">
1360 <xsl:with-param name="object" select="$target"/>
1361 </xsl:call-template>
1364 <xsl:call-template name="inline.charseq"/>
1367 <xsl:text>]</xsl:text>
1370 <xsl:text>[</xsl:text>
1371 <xsl:call-template name="inline.charseq"/>
1372 <xsl:text>]</xsl:text>
1377 <xsl:template match="biblioentry|bibliomixed" mode="citation">
1378 <xsl:number from="bibliography" count="biblioentry|bibliomixed" level="any" format="1"/>
1381 <!-- ==================================================================== -->
1383 <xsl:template match="comment[parent::answer|parent::appendix|parent::article|parent::bibliodiv| parent::bibliography|parent::blockquote|parent::caution|parent::chapter| parent::glossary|parent::glossdiv|parent::important|parent::index| parent::indexdiv|parent::listitem|parent::note|parent::orderedlist| parent::partintro|parent::preface|parent::procedure|parent::qandadiv| parent::qandaset|parent::question|parent::refentry|parent::refnamediv| parent::refsect1|parent::refsect2|parent::refsect3|parent::refsection| parent::refsynopsisdiv|parent::sect1|parent::sect2|parent::sect3|parent::sect4| parent::sect5|parent::section|parent::setindex|parent::sidebar| parent::simplesect|parent::taskprerequisites|parent::taskrelated| parent::tasksummary|parent::warning|parent::topic]|remark[parent::answer|parent::appendix|parent::article|parent::bibliodiv| parent::bibliography|parent::blockquote|parent::caution|parent::chapter| parent::glossary|parent::glossdiv|parent::important|parent::index| parent::indexdiv|parent::listitem|parent::note|parent::orderedlist| parent::partintro|parent::preface|parent::procedure|parent::qandadiv| parent::qandaset|parent::question|parent::refentry|parent::refnamediv| parent::refsect1|parent::refsect2|parent::refsect3|parent::refsection| parent::refsynopsisdiv|parent::sect1|parent::sect2|parent::sect3|parent::sect4| parent::sect5|parent::section|parent::setindex|parent::sidebar| parent::simplesect|parent::taskprerequisites|parent::taskrelated| parent::tasksummary|parent::warning|parent::topic]">
1384 <xsl:if test="$show.comments != 0">
1385 <p class="remark"><em><xsl:call-template name="inline.charseq"/></em></p>
1389 <xsl:template match="comment|remark">
1390 <xsl:if test="$show.comments != 0">
1391 <em><xsl:call-template name="inline.charseq"/></em>
1395 <!-- ==================================================================== -->
1397 <xsl:template match="productname">
1398 <xsl:call-template name="inline.charseq"/>
1399 <xsl:if test="@class">
1400 <xsl:call-template name="dingbat">
1401 <xsl:with-param name="dingbat" select="@class"/>
1402 </xsl:call-template>
1406 <xsl:template match="productnumber">
1407 <xsl:call-template name="inline.charseq"/>
1410 <!-- ==================================================================== -->
1412 <xsl:template match="pob|street|city|state|postcode|country|otheraddr">
1413 <xsl:call-template name="inline.charseq"/>
1416 <xsl:template match="phone|fax">
1417 <xsl:call-template name="inline.charseq"/>
1420 <!-- in Addresses, for example -->
1421 <xsl:template match="honorific|firstname|surname|lineage|othername">
1422 <xsl:call-template name="inline.charseq"/>
1425 <!-- ==================================================================== -->
1427 <xsl:template match="person">
1428 <xsl:param name="content">
1429 <xsl:apply-templates select="personname"/>
1432 <xsl:param name="contentwithlink">
1433 <xsl:call-template name="anchor"/>
1434 <xsl:call-template name="simple.xlink">
1435 <xsl:with-param name="content" select="$content"/>
1436 </xsl:call-template>
1437 <xsl:call-template name="apply-annotations"/>
1441 <xsl:apply-templates select="." mode="common.html.attributes"/>
1442 <xsl:call-template name="id.attribute"/>
1443 <xsl:copy-of select="$contentwithlink"/>
1447 <xsl:template match="personname">
1448 <xsl:param name="content">
1449 <xsl:call-template name="person.name"/>
1452 <xsl:param name="contentwithlink">
1453 <xsl:call-template name="anchor"/>
1454 <xsl:call-template name="simple.xlink">
1455 <xsl:with-param name="content" select="$content"/>
1456 </xsl:call-template>
1457 <xsl:call-template name="apply-annotations"/>
1461 <xsl:apply-templates select="." mode="common.html.attributes"/>
1462 <xsl:call-template name="id.attribute"/>
1463 <xsl:copy-of select="$contentwithlink"/>
1467 <!-- ==================================================================== -->
1469 <xsl:template match="org">
1470 <xsl:param name="content">
1471 <xsl:apply-templates/>
1474 <xsl:param name="contentwithlink">
1475 <xsl:call-template name="anchor"/>
1476 <xsl:call-template name="simple.xlink">
1477 <xsl:with-param name="content" select="$content"/>
1478 </xsl:call-template>
1479 <xsl:call-template name="apply-annotations"/>
1483 <xsl:apply-templates select="." mode="common.html.attributes"/>
1484 <xsl:call-template name="id.attribute"/>
1485 <xsl:copy-of select="$contentwithlink"/>
1489 <xsl:template match="orgname">
1490 <xsl:param name="content">
1491 <xsl:apply-templates/>
1494 <xsl:param name="contentwithlink">
1495 <xsl:call-template name="anchor"/>
1496 <xsl:call-template name="simple.xlink">
1497 <xsl:with-param name="content" select="$content"/>
1498 </xsl:call-template>
1499 <xsl:call-template name="apply-annotations"/>
1503 <xsl:apply-templates select="." mode="common.html.attributes"/>
1504 <xsl:call-template name="id.attribute"/>
1505 <xsl:copy-of select="$contentwithlink"/>
1509 <xsl:template match="orgdiv">
1510 <xsl:param name="content">
1511 <xsl:apply-templates/>
1514 <xsl:param name="contentwithlink">
1515 <xsl:call-template name="anchor"/>
1516 <xsl:call-template name="simple.xlink">
1517 <xsl:with-param name="content" select="$content"/>
1518 </xsl:call-template>
1519 <xsl:call-template name="apply-annotations"/>
1523 <xsl:apply-templates select="." mode="common.html.attributes"/>
1524 <xsl:call-template name="id.attribute"/>
1525 <xsl:copy-of select="$contentwithlink"/>
1529 <xsl:template match="affiliation">
1530 <xsl:param name="content">
1531 <xsl:call-template name="person.name"/>
1534 <xsl:param name="contentwithlink">
1535 <xsl:call-template name="anchor"/>
1536 <xsl:call-template name="simple.xlink">
1537 <xsl:with-param name="content" select="$content"/>
1538 </xsl:call-template>
1539 <xsl:call-template name="apply-annotations"/>
1543 <xsl:apply-templates select="." mode="common.html.attributes"/>
1544 <xsl:call-template name="id.attribute"/>
1545 <xsl:copy-of select="$contentwithlink"/>
1549 <!-- ==================================================================== -->
1551 <xsl:template match="beginpage">
1552 <!-- does nothing; this *is not* markup to force a page break. -->