1 <?xml version="1.0" encoding="ASCII"?><!--This file was created automatically by html2xhtml--><!--from the HTML stylesheets.--><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:d="http://docbook.org/ns/docbook" 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 d" version="1.0">
3 <!-- ********************************************************************
5 This file is part of the XSL DocBook Stylesheet distribution.
6 See ../README or http://cdn.docbook.org/release/xsl/current/ for
7 copyright and other information.
9 ******************************************************************** -->
11 <xsl:key name="glossentries" match="d:glossentry" use="normalize-space(d:glossterm)"/>
12 <xsl:key name="glossentries" match="d:glossentry" use="normalize-space(d:glossterm/@baseform)"/>
14 <xsl:template name="simple.xlink">
15 <xsl:param name="node" select="."/>
16 <xsl:param name="content">
17 <xsl:apply-templates/>
19 <xsl:param name="linkend" select="$node/@linkend"/>
20 <xsl:param name="xhref" select="$node/@xlink:href"/>
22 <!-- check for nested links, which are undefined in the output -->
23 <xsl:if test="($linkend or $xhref) and $node/ancestor::*[@xlink:href or @linkend]">
25 <xsl:text>WARNING: nested link may be undefined in output: </xsl:text>
26 <xsl:text><</xsl:text>
27 <xsl:value-of select="name($node)"/>
28 <xsl:text> </xsl:text>
30 <xsl:when test="$linkend">
31 <xsl:text>@linkend = '</xsl:text>
32 <xsl:value-of select="$linkend"/>
33 <xsl:text>'></xsl:text>
35 <xsl:when test="$xhref">
36 <xsl:text>@xlink:href = '</xsl:text>
37 <xsl:value-of select="$xhref"/>
38 <xsl:text>'></xsl:text>
41 <xsl:text> nested inside parent element </xsl:text>
42 <xsl:value-of select="name($node/parent::*)"/>
46 <!-- Support for @xlink:show -->
47 <xsl:variable name="target.show">
49 <xsl:when test="$node/@xlink:show = 'new'">_blank</xsl:when>
50 <xsl:when test="$node/@xlink:show = 'replace'">_top</xsl:when>
55 <xsl:variable name="link">
57 <xsl:when test="$xhref and (not($node/@xlink:type) or $node/@xlink:type='simple')">
59 <!-- Is it a local idref or a uri? -->
60 <xsl:variable name="is.idref">
62 <!-- if the href starts with # and does not contain an "(" -->
63 <!-- or if the href starts with #xpointer(id(, it's just an ID -->
64 <xsl:when test="starts-with($xhref,'#') and (not(contains($xhref,'(')) or starts-with($xhref, '#xpointer(id('))">1</xsl:when>
65 <xsl:otherwise>0</xsl:otherwise>
69 <!-- Is it an olink ? -->
70 <xsl:variable name="is.olink">
72 <!-- If xlink:role="http://docbook.org/xlink/role/olink" -->
73 <!-- and if the href contains # -->
74 <xsl:when test="contains($xhref,'#') and @xlink:role = $xolink.role">1</xsl:when>
75 <xsl:otherwise>0</xsl:otherwise>
80 <xsl:when test="$is.olink = 1">
81 <xsl:call-template name="olink">
82 <xsl:with-param name="content" select="$content"/>
86 <xsl:when test="$is.idref = 1">
88 <xsl:variable name="idref">
89 <xsl:call-template name="xpointer.idref">
90 <xsl:with-param name="xpointer" select="$xhref"/>
94 <xsl:variable name="targets" select="key('id',$idref)"/>
95 <xsl:variable name="target" select="$targets[1]"/>
97 <xsl:call-template name="check.id.unique">
98 <xsl:with-param name="linkend" select="$idref"/>
102 <xsl:when test="count($target) = 0">
104 <xsl:text>XLink to nonexistent id: </xsl:text>
105 <xsl:value-of select="$idref"/>
107 <xsl:copy-of select="$content"/>
112 <xsl:apply-templates select="." mode="common.html.attributes"/>
113 <!-- id attribute goes on the element calling
114 simple.xlink, not on the anchor element, so
115 this is commented out:
116 <xsl:call-template name="id.attribute"/>
119 <xsl:attribute name="href">
120 <xsl:call-template name="href.target">
121 <xsl:with-param name="object" select="$target"/>
126 <xsl:when test="$node/@xlink:title">
127 <xsl:attribute name="title">
128 <xsl:value-of select="$node/@xlink:title"/>
132 <xsl:apply-templates select="$target" mode="html.title.attribute"/>
136 <xsl:if test="$target.show !=''">
137 <xsl:attribute name="target">
138 <xsl:value-of select="$target.show"/>
142 <xsl:copy-of select="$content"/>
149 <!-- otherwise it's a URI -->
152 <xsl:apply-templates select="." mode="common.html.attributes"/>
153 <xsl:call-template name="id.attribute"/>
154 <xsl:attribute name="href">
155 <xsl:value-of select="$xhref"/>
157 <xsl:if test="$node/@xlink:title">
158 <xsl:attribute name="title">
159 <xsl:value-of select="$node/@xlink:title"/>
163 <!-- For URIs, use @xlink:show if defined, otherwise use ulink.target -->
165 <xsl:when test="$target.show !=''">
166 <xsl:attribute name="target">
167 <xsl:value-of select="$target.show"/>
170 <xsl:when test="$ulink.target !=''">
171 <xsl:attribute name="target">
172 <xsl:value-of select="$ulink.target"/>
177 <xsl:copy-of select="$content"/>
183 <xsl:when test="$linkend">
184 <xsl:variable name="targets" select="key('id',$linkend)"/>
185 <xsl:variable name="target" select="$targets[1]"/>
187 <xsl:call-template name="check.id.unique">
188 <xsl:with-param name="linkend" select="$linkend"/>
192 <xsl:apply-templates select="." mode="common.html.attributes"/>
193 <xsl:call-template name="id.attribute"/>
194 <xsl:attribute name="href">
195 <xsl:call-template name="href.target">
196 <xsl:with-param name="object" select="$target"/>
200 <xsl:apply-templates select="$target" mode="html.title.attribute"/>
202 <xsl:copy-of select="$content"/>
207 <xsl:copy-of select="$content"/>
213 <xsl:when test="function-available('suwl:unwrapLinks')">
214 <xsl:copy-of select="suwl:unwrapLinks($link)"/>
217 <xsl:copy-of select="$link"/>
222 <xsl:template name="inline.charseq">
223 <xsl:param name="content">
224 <xsl:apply-templates/>
227 <xsl:param name="contentwithlink">
228 <xsl:call-template name="anchor"/>
229 <xsl:call-template name="simple.xlink">
230 <xsl:with-param name="content" select="$content"/>
234 <!-- * if you want output from the inline.charseq template wrapped in -->
235 <!-- * something other than a Span, call the template with some value -->
236 <!-- * for the 'wrapper-name' param -->
237 <xsl:param name="wrapper-name">span</xsl:param>
238 <xsl:element name="{$wrapper-name}" namespace="http://www.w3.org/1999/xhtml">
239 <xsl:call-template name="common.html.attributes"/>
240 <xsl:call-template name="id.attribute"/>
241 <xsl:call-template name="generate.html.title"/>
242 <xsl:copy-of select="$contentwithlink"/>
243 <xsl:call-template name="apply-annotations"/>
247 <xsl:template name="inline.monoseq">
248 <xsl:param name="content">
249 <xsl:apply-templates/>
252 <xsl:param name="contentwithlink">
253 <xsl:call-template name="anchor"/>
254 <xsl:call-template name="simple.xlink">
255 <xsl:with-param name="content" select="$content"/>
260 <xsl:apply-templates select="." mode="common.html.attributes"/>
261 <xsl:call-template name="id.attribute"/>
262 <xsl:copy-of select="$contentwithlink"/>
263 <xsl:call-template name="apply-annotations"/>
267 <xsl:template name="inline.boldseq">
268 <xsl:param name="content">
269 <xsl:apply-templates/>
272 <xsl:param name="contentwithlink">
273 <xsl:call-template name="anchor"/>
274 <xsl:call-template name="simple.xlink">
275 <xsl:with-param name="content" select="$content"/>
280 <xsl:apply-templates select="." mode="common.html.attributes"/>
281 <xsl:call-template name="id.attribute"/>
283 <!-- don't put <strong> inside figure, example, or table titles -->
285 <xsl:when test="local-name(..) = 'title' and (local-name(../..) = 'figure' or local-name(../..) = 'example' or local-name(../..) = 'table')">
286 <xsl:copy-of select="$contentwithlink"/>
290 <xsl:copy-of select="$contentwithlink"/>
294 <xsl:call-template name="apply-annotations"/>
298 <xsl:template name="inline.italicseq">
299 <xsl:param name="content">
300 <xsl:apply-templates/>
303 <xsl:param name="contentwithlink">
304 <xsl:call-template name="anchor"/>
305 <xsl:call-template name="simple.xlink">
306 <xsl:with-param name="content" select="$content"/>
311 <xsl:call-template name="common.html.attributes"/>
312 <xsl:call-template name="id.attribute"/>
313 <xsl:copy-of select="$contentwithlink"/>
314 <xsl:call-template name="apply-annotations"/>
318 <xsl:template name="inline.boldmonoseq">
319 <xsl:param name="content">
320 <xsl:apply-templates/>
323 <xsl:param name="contentwithlink">
324 <xsl:call-template name="anchor"/>
325 <xsl:call-template name="simple.xlink">
326 <xsl:with-param name="content" select="$content"/>
330 <!-- don't put <strong> inside figure, example, or table titles -->
331 <!-- or other titles that may already be represented with <strong>'s. -->
333 <xsl:when test="local-name(..) = 'title' and (local-name(../..) = 'figure' or local-name(../..) = 'example' or local-name(../..) = 'table' or local-name(../..) = 'formalpara')">
335 <xsl:call-template name="common.html.attributes"/>
336 <xsl:call-template name="id.attribute"/>
337 <xsl:copy-of select="$contentwithlink"/>
338 <xsl:call-template name="apply-annotations"/>
343 <xsl:call-template name="common.html.attributes"/>
344 <xsl:call-template name="id.attribute"/>
346 <xsl:call-template name="generate.html.title"/>
347 <xsl:call-template name="dir"/>
348 <xsl:copy-of select="$contentwithlink"/>
350 <xsl:call-template name="apply-annotations"/>
356 <xsl:template name="inline.italicmonoseq">
357 <xsl:param name="content">
358 <xsl:apply-templates/>
361 <xsl:param name="contentwithlink">
362 <xsl:call-template name="anchor"/>
363 <xsl:call-template name="simple.xlink">
364 <xsl:with-param name="content" select="$content"/>
369 <xsl:call-template name="common.html.attributes"/>
370 <xsl:call-template name="id.attribute"/>
372 <xsl:call-template name="generate.html.title"/>
373 <xsl:call-template name="dir"/>
374 <xsl:copy-of select="$contentwithlink"/>
375 <xsl:call-template name="apply-annotations"/>
380 <xsl:template name="inline.superscriptseq">
381 <xsl:param name="content">
382 <xsl:apply-templates/>
385 <xsl:param name="contentwithlink">
386 <xsl:call-template name="anchor"/>
387 <xsl:call-template name="simple.xlink">
388 <xsl:with-param name="content" select="$content"/>
393 <xsl:call-template name="generate.html.title"/>
394 <xsl:call-template name="id.attribute"/>
395 <xsl:call-template name="dir"/>
396 <xsl:copy-of select="$contentwithlink"/>
397 <xsl:call-template name="apply-annotations"/>
401 <xsl:template name="inline.subscriptseq">
402 <xsl:param name="content">
403 <xsl:apply-templates/>
406 <xsl:param name="contentwithlink">
407 <xsl:call-template name="anchor"/>
408 <xsl:call-template name="simple.xlink">
409 <xsl:with-param name="content" select="$content"/>
414 <xsl:call-template name="generate.html.title"/>
415 <xsl:call-template name="id.attribute"/>
416 <xsl:call-template name="dir"/>
417 <xsl:copy-of select="$contentwithlink"/>
418 <xsl:call-template name="apply-annotations"/>
422 <!-- ==================================================================== -->
423 <!-- some special cases -->
425 <xsl:template match="d:author">
426 <xsl:param name="content">
427 <xsl:call-template name="person.name"/>
430 <xsl:param name="contentwithlink">
431 <xsl:call-template name="anchor"/>
432 <xsl:call-template name="simple.xlink">
433 <xsl:with-param name="content" select="$content"/>
435 <xsl:call-template name="apply-annotations"/>
439 <xsl:call-template name="common.html.attributes"/>
440 <xsl:call-template name="id.attribute"/>
441 <xsl:copy-of select="$contentwithlink"/>
445 <xsl:template match="d:editor">
446 <xsl:param name="content">
447 <xsl:call-template name="person.name"/>
450 <xsl:param name="contentwithlink">
451 <xsl:call-template name="anchor"/>
452 <xsl:call-template name="simple.xlink">
453 <xsl:with-param name="content" select="$content"/>
455 <xsl:call-template name="apply-annotations"/>
459 <xsl:call-template name="common.html.attributes"/>
460 <xsl:call-template name="id.attribute"/>
461 <xsl:copy-of select="$contentwithlink"/>
465 <xsl:template match="d:othercredit">
466 <xsl:param name="content">
467 <xsl:call-template name="person.name"/>
470 <xsl:param name="contentwithlink">
471 <xsl:call-template name="anchor"/>
472 <xsl:call-template name="simple.xlink">
473 <xsl:with-param name="content" select="$content"/>
475 <xsl:call-template name="apply-annotations"/>
479 <xsl:call-template name="common.html.attributes"/>
480 <xsl:call-template name="id.attribute"/>
481 <xsl:copy-of select="$contentwithlink"/>
485 <xsl:template match="d:authorinitials">
486 <xsl:call-template name="inline.charseq"/>
489 <!-- ==================================================================== -->
491 <xsl:template match="d:accel">
492 <xsl:call-template name="inline.charseq"/>
495 <xsl:template match="d:action">
496 <xsl:call-template name="inline.charseq"/>
499 <xsl:template match="d:application">
500 <xsl:call-template name="inline.charseq"/>
503 <xsl:template match="d:classname">
504 <xsl:call-template name="inline.monoseq"/>
507 <xsl:template match="d:exceptionname">
508 <xsl:call-template name="inline.monoseq"/>
511 <xsl:template match="d:interfacename">
512 <xsl:call-template name="inline.monoseq"/>
515 <xsl:template match="d:methodname">
516 <xsl:call-template name="inline.monoseq"/>
519 <xsl:template match="d:command">
520 <xsl:call-template name="inline.boldseq"/>
523 <xsl:template match="d:computeroutput">
524 <xsl:call-template name="inline.monoseq"/>
527 <xsl:template match="d:constant">
528 <xsl:call-template name="inline.monoseq"/>
531 <xsl:template match="d:database">
532 <xsl:call-template name="inline.charseq"/>
535 <xsl:template match="d:date">
536 <!-- should this support locale-specific formatting? how? -->
537 <xsl:call-template name="inline.charseq"/>
540 <xsl:template match="d:errorcode">
541 <xsl:call-template name="inline.charseq"/>
544 <xsl:template match="d:errorname">
545 <xsl:call-template name="inline.charseq"/>
548 <xsl:template match="d:errortype">
549 <xsl:call-template name="inline.charseq"/>
552 <xsl:template match="d:errortext">
553 <xsl:call-template name="inline.charseq"/>
556 <xsl:template match="d:envar">
557 <xsl:call-template name="inline.monoseq"/>
560 <xsl:template match="d:filename">
561 <xsl:call-template name="inline.monoseq"/>
564 <xsl:template match="d:function">
566 <xsl:when test="$function.parens != '0' and (d:parameter or d:function or d:replaceable)">
567 <xsl:variable name="nodes" select="text()|*"/>
568 <xsl:call-template name="inline.monoseq">
569 <xsl:with-param name="content">
570 <xsl:call-template name="simple.xlink">
571 <xsl:with-param name="content">
572 <xsl:apply-templates select="$nodes[1]"/>
577 <xsl:text>(</xsl:text>
578 <xsl:apply-templates select="$nodes[position()>1]"/>
579 <xsl:text>)</xsl:text>
582 <xsl:call-template name="inline.monoseq"/>
587 <xsl:template match="d:function/d:parameter" priority="2">
588 <xsl:call-template name="inline.italicmonoseq"/>
589 <xsl:if test="$function.parens != 0 and following-sibling::*">
590 <xsl:text>, </xsl:text>
594 <xsl:template match="d:function/d:replaceable" priority="2">
595 <xsl:call-template name="inline.italicmonoseq"/>
596 <xsl:if test="$function.parens != 0 and following-sibling::*">
597 <xsl:text>, </xsl:text>
601 <xsl:template match="d:guibutton">
602 <xsl:call-template name="inline.charseq"/>
605 <xsl:template match="d:guiicon">
606 <xsl:call-template name="inline.charseq"/>
609 <xsl:template match="d:guilabel">
610 <xsl:call-template name="inline.charseq"/>
613 <xsl:template match="d:guimenu">
614 <xsl:call-template name="inline.charseq"/>
617 <xsl:template match="d:guimenuitem">
618 <xsl:call-template name="inline.charseq"/>
621 <xsl:template match="d:guisubmenu">
622 <xsl:call-template name="inline.charseq"/>
625 <xsl:template match="d:hardware">
626 <xsl:call-template name="inline.charseq"/>
629 <xsl:template match="d:interface">
630 <xsl:call-template name="inline.charseq"/>
633 <xsl:template match="d:interfacedefinition">
634 <xsl:call-template name="inline.charseq"/>
637 <xsl:template match="d:keycap">
639 <xsl:when test="@function and normalize-space(.) = ''">
640 <xsl:call-template name="inline.boldseq">
641 <xsl:with-param name="content">
642 <xsl:call-template name="gentext.template">
643 <xsl:with-param name="context" select="'keycap'"/>
644 <xsl:with-param name="name" select="@function"/>
650 <xsl:call-template name="inline.boldseq"/>
655 <xsl:template match="d:keycode">
656 <xsl:call-template name="inline.charseq"/>
659 <xsl:template match="d:keysym">
660 <xsl:call-template name="inline.charseq"/>
663 <xsl:template match="d:literal">
664 <xsl:call-template name="inline.monoseq"/>
667 <xsl:template match="d:code">
668 <xsl:call-template name="inline.monoseq"/>
671 <xsl:template match="d:medialabel">
672 <xsl:call-template name="inline.italicseq"/>
675 <xsl:template match="d:shortcut">
676 <xsl:call-template name="inline.boldseq"/>
679 <xsl:template match="d:mousebutton">
680 <xsl:call-template name="inline.charseq"/>
683 <xsl:template match="d:option">
684 <xsl:call-template name="inline.monoseq"/>
687 <xsl:template match="d:package">
688 <xsl:call-template name="inline.charseq"/>
691 <xsl:template match="d:parameter">
692 <xsl:call-template name="inline.italicmonoseq"/>
695 <xsl:template match="d:property">
696 <xsl:call-template name="inline.charseq"/>
699 <xsl:template match="d:prompt">
700 <xsl:call-template name="inline.monoseq"/>
703 <xsl:template match="d:replaceable" priority="1">
704 <xsl:call-template name="inline.italicmonoseq"/>
707 <xsl:template match="d:returnvalue">
708 <xsl:call-template name="inline.charseq"/>
711 <xsl:template match="d:structfield">
712 <xsl:call-template name="inline.italicmonoseq"/>
715 <xsl:template match="d:structname">
716 <xsl:call-template name="inline.charseq"/>
719 <xsl:template match="d:symbol">
720 <xsl:call-template name="inline.charseq"/>
723 <xsl:template match="d:systemitem">
724 <xsl:call-template name="inline.monoseq"/>
727 <xsl:template match="d:token">
728 <xsl:call-template name="inline.charseq"/>
731 <xsl:template match="d:type">
732 <xsl:call-template name="inline.charseq"/>
735 <xsl:template match="d:userinput">
736 <xsl:call-template name="inline.boldmonoseq"/>
739 <xsl:template match="d:abbrev">
740 <xsl:call-template name="inline.charseq">
741 <xsl:with-param name="wrapper-name">abbr</xsl:with-param>
745 <xsl:template match="d:acronym">
746 <xsl:call-template name="inline.charseq">
747 <xsl:with-param name="wrapper-name">acronym</xsl:with-param>
751 <xsl:template match="d:citerefentry">
753 <xsl:when test="$citerefentry.link != '0'">
755 <xsl:apply-templates select="." mode="common.html.attributes"/>
756 <xsl:attribute name="href">
757 <xsl:call-template name="generate.citerefentry.link"/>
759 <xsl:call-template name="inline.charseq"/>
763 <xsl:call-template name="inline.charseq"/>
768 <xsl:template name="generate.citerefentry.link">
772 <xsl:template name="x.generate.citerefentry.link">
773 <xsl:text>http://example.com/cgi-bin/man.cgi?</xsl:text>
774 <xsl:value-of select="d:refentrytitle"/>
775 <xsl:text>(</xsl:text>
776 <xsl:value-of select="d:manvolnum"/>
777 <xsl:text>)</xsl:text>
780 <xsl:template match="d:citetitle">
782 <xsl:when test="@pubwork = 'article'">
783 <xsl:call-template name="gentext.startquote"/>
784 <xsl:call-template name="inline.charseq"/>
785 <xsl:call-template name="gentext.endquote"/>
788 <xsl:call-template name="inline.italicseq"/>
793 <xsl:template match="d:emphasis">
795 <xsl:call-template name="id.attribute"/>
797 <!-- We don't want empty @class values, so do not propagate empty @roles -->
798 <xsl:when test="@role and normalize-space(@role) != '' and $emphasis.propagates.style != 0">
799 <xsl:apply-templates select="." mode="common.html.attributes">
800 <xsl:with-param name="class" select="@role"/>
801 </xsl:apply-templates>
804 <xsl:apply-templates select="." mode="common.html.attributes"/>
807 <xsl:call-template name="anchor"/>
809 <xsl:call-template name="simple.xlink">
810 <xsl:with-param name="content">
812 <xsl:when test="@role = 'bold' or @role='strong'">
813 <!-- backwards compatibility: make bold into b elements, but -->
814 <!-- don't put bold inside figure, example, or table titles -->
816 <xsl:when test="local-name(..) = 'title' and (local-name(../..) = 'figure' or local-name(../..) = 'example' or local-name(../..) = 'table')">
817 <xsl:apply-templates/>
820 <strong><xsl:apply-templates/></strong>
824 <xsl:when test="@role and $emphasis.propagates.style != 0">
825 <xsl:apply-templates/>
828 <em><xsl:apply-templates/></em>
836 <xsl:template match="d:foreignphrase">
838 <xsl:apply-templates select="." mode="common.html.attributes"/>
839 <xsl:call-template name="inline.italicseq"/>
843 <xsl:template match="d:markup">
844 <xsl:call-template name="inline.charseq"/>
847 <xsl:template match="d:phrase">
849 <xsl:call-template name="id.attribute"/>
850 <xsl:call-template name="locale.html.attributes"/>
851 <!-- We don't want empty @class values, so do not propagate empty @roles -->
853 <xsl:when test="@role and normalize-space(@role) != '' and $phrase.propagates.style != 0">
854 <xsl:apply-templates select="." mode="class.attribute">
855 <xsl:with-param name="class" select="@role"/>
856 </xsl:apply-templates>
859 <xsl:apply-templates select="." mode="class.attribute"/>
862 <xsl:call-template name="dir"/>
863 <xsl:call-template name="anchor"/>
864 <xsl:call-template name="simple.xlink">
865 <xsl:with-param name="content">
866 <xsl:apply-templates/>
869 <xsl:call-template name="apply-annotations"/>
873 <xsl:template match="d:quote">
874 <xsl:variable name="depth">
875 <xsl:call-template name="dot.count">
876 <xsl:with-param name="string">
877 <xsl:number level="multiple"/>
882 <xsl:apply-templates select="." mode="common.html.attributes"/>
884 <xsl:when test="$depth mod 2 = 0">
885 <xsl:call-template name="gentext.startquote"/>
886 <xsl:call-template name="inline.charseq"/>
887 <xsl:call-template name="gentext.endquote"/>
890 <xsl:call-template name="gentext.nestedstartquote"/>
891 <xsl:call-template name="inline.charseq"/>
892 <xsl:call-template name="gentext.nestedendquote"/>
898 <xsl:template match="d:varname">
899 <xsl:call-template name="inline.monoseq"/>
902 <xsl:template match="d:wordasword">
903 <xsl:call-template name="inline.italicseq"/>
906 <xsl:template match="d:lineannotation">
908 <xsl:apply-templates select="." mode="common.html.attributes"/>
909 <xsl:call-template name="inline.charseq"/>
913 <xsl:template match="d:superscript">
914 <xsl:call-template name="inline.superscriptseq"/>
917 <xsl:template match="d:subscript">
918 <xsl:call-template name="inline.subscriptseq"/>
921 <xsl:template match="d:trademark">
922 <xsl:call-template name="inline.charseq"/>
924 <xsl:when test="@class = 'copyright' or @class = 'registered'">
925 <xsl:call-template name="dingbat">
926 <xsl:with-param name="dingbat" select="@class"/>
929 <xsl:when test="@class = 'service'">
933 <xsl:call-template name="dingbat">
934 <xsl:with-param name="dingbat" select="'trademark'"/>
940 <xsl:template match="d:firstterm">
941 <xsl:call-template name="glossterm">
942 <xsl:with-param name="firstterm" select="1"/>
946 <xsl:template match="d:glossterm" name="glossterm">
947 <xsl:param name="firstterm" select="0"/>
949 <!-- To avoid extra <a name=""> anchor from inline.italicseq -->
950 <xsl:variable name="content">
951 <xsl:apply-templates/>
955 <xsl:when test="($firstterm.only.link = 0 or $firstterm = 1) and @linkend">
956 <xsl:variable name="targets" select="key('id',@linkend)"/>
957 <xsl:variable name="target" select="$targets[1]"/>
959 <xsl:call-template name="check.id.unique">
960 <xsl:with-param name="linkend" select="@linkend"/>
964 <xsl:when test="$target">
966 <xsl:apply-templates select="." mode="common.html.attributes"/>
968 <xsl:attribute name="href">
969 <xsl:call-template name="href.target">
970 <xsl:with-param name="object" select="$target"/>
974 <xsl:call-template name="inline.italicseq">
975 <xsl:with-param name="content" select="$content"/>
980 <xsl:call-template name="inline.italicseq">
981 <xsl:with-param name="content" select="$content"/>
987 <xsl:when test="not(@linkend) and ($firstterm.only.link = 0 or $firstterm = 1) and ($glossterm.auto.link != 0) and $glossary.collection != ''">
988 <xsl:variable name="term">
990 <xsl:when test="@baseform"><xsl:value-of select="@baseform"/></xsl:when>
991 <xsl:otherwise><xsl:value-of select="."/></xsl:otherwise>
995 <xsl:variable name="cterm" select="(document($glossary.collection,.)//d:glossentry[d:glossterm=$term])[1]"/>
997 <!-- HACK HACK HACK! But it works... -->
998 <!-- You'd need to do more work if you wanted to chunk on glossdiv, though -->
1000 <xsl:variable name="glossary" select="//d:glossary[@role='auto']"/>
1002 <xsl:if test="count($glossary) != 1">
1004 <xsl:text>Warning: glossary.collection specified, but there are </xsl:text>
1005 <xsl:value-of select="count($glossary)"/>
1006 <xsl:text> automatic glossaries</xsl:text>
1010 <xsl:variable name="glosschunk">
1011 <xsl:call-template name="href.target">
1012 <xsl:with-param name="object" select="$glossary"/>
1013 </xsl:call-template>
1016 <xsl:variable name="chunkbase">
1018 <xsl:when test="contains($glosschunk, '#')">
1019 <xsl:value-of select="substring-before($glosschunk, '#')"/>
1022 <xsl:value-of select="$glosschunk"/>
1028 <xsl:when test="not($cterm)">
1030 <xsl:text>There's no entry for </xsl:text>
1031 <xsl:value-of select="$term"/>
1032 <xsl:text> in </xsl:text>
1033 <xsl:value-of select="$glossary.collection"/>
1035 <xsl:call-template name="inline.italicseq"/>
1038 <xsl:variable name="id">
1039 <xsl:call-template name="object.id">
1040 <xsl:with-param name="object" select="$cterm"/>
1041 </xsl:call-template>
1043 <a href="{$chunkbase}#{$id}">
1044 <xsl:apply-templates select="." mode="common.html.attributes"/>
1045 <xsl:call-template name="inline.italicseq">
1046 <xsl:with-param name="content" select="$content"/>
1047 </xsl:call-template>
1053 <xsl:when test="not(@linkend) and ($firstterm.only.link = 0 or $firstterm = 1) and $glossterm.auto.link != 0">
1054 <xsl:variable name="term">
1056 <xsl:when test="@baseform">
1057 <xsl:value-of select="normalize-space(@baseform)"/>
1060 <xsl:value-of select="normalize-space(.)"/>
1064 <xsl:variable name="targets" select="key('glossentries', $term)"/>
1065 <xsl:variable name="target" select="$targets[1]"/>
1068 <xsl:when test="count($targets)=0">
1070 <xsl:text>Error: no glossentry for glossterm: </xsl:text>
1071 <xsl:value-of select="."/>
1072 <xsl:text>.</xsl:text>
1074 <xsl:call-template name="inline.italicseq"/>
1078 <xsl:apply-templates select="." mode="common.html.attributes"/>
1079 <xsl:if test="@id or @xml:id">
1080 <xsl:attribute name="id">
1081 <xsl:value-of select="(@id|@xml:id)[1]"/>
1085 <xsl:attribute name="href">
1086 <xsl:call-template name="href.target">
1087 <xsl:with-param name="object" select="$target"/>
1088 </xsl:call-template>
1091 <xsl:call-template name="inline.italicseq">
1092 <xsl:with-param name="content" select="$content"/>
1093 </xsl:call-template>
1100 <xsl:call-template name="inline.italicseq"/>
1105 <xsl:template match="d:termdef">
1107 <xsl:apply-templates select="." mode="common.html.attributes"/>
1108 <xsl:call-template name="gentext.template">
1109 <xsl:with-param name="context" select="'termdef'"/>
1110 <xsl:with-param name="name" select="'prefix'"/>
1111 </xsl:call-template>
1112 <xsl:apply-templates/>
1113 <xsl:call-template name="gentext.template">
1114 <xsl:with-param name="context" select="'termdef'"/>
1115 <xsl:with-param name="name" select="'suffix'"/>
1116 </xsl:call-template>
1120 <xsl:template match="d:sgmltag|d:tag">
1121 <xsl:call-template name="format.sgmltag"/>
1124 <xsl:template name="format.sgmltag">
1125 <xsl:param name="class">
1127 <xsl:when test="@class">
1128 <xsl:value-of select="@class"/>
1130 <xsl:otherwise>element</xsl:otherwise>
1134 <xsl:variable name="content">
1136 <xsl:when test="$class='attribute'">
1137 <xsl:apply-templates/>
1139 <xsl:when test="$class='attvalue'">
1140 <xsl:apply-templates/>
1142 <xsl:when test="$class='element'">
1143 <xsl:apply-templates/>
1145 <xsl:when test="$class='endtag'">
1146 <xsl:text></</xsl:text>
1147 <xsl:apply-templates/>
1148 <xsl:text>></xsl:text>
1150 <xsl:when test="$class='genentity'">
1151 <xsl:text>&</xsl:text>
1152 <xsl:apply-templates/>
1153 <xsl:text>;</xsl:text>
1155 <xsl:when test="$class='numcharref'">
1156 <xsl:text>&#</xsl:text>
1157 <xsl:apply-templates/>
1158 <xsl:text>;</xsl:text>
1160 <xsl:when test="$class='paramentity'">
1161 <xsl:text>%</xsl:text>
1162 <xsl:apply-templates/>
1163 <xsl:text>;</xsl:text>
1165 <xsl:when test="$class='pi'">
1166 <xsl:text><?</xsl:text>
1167 <xsl:apply-templates/>
1168 <xsl:text>></xsl:text>
1170 <xsl:when test="$class='xmlpi'">
1171 <xsl:text><?</xsl:text>
1172 <xsl:apply-templates/>
1173 <xsl:text>?></xsl:text>
1175 <xsl:when test="$class='starttag'">
1176 <xsl:text><</xsl:text>
1177 <xsl:apply-templates/>
1178 <xsl:text>></xsl:text>
1180 <xsl:when test="$class='emptytag'">
1181 <xsl:text><</xsl:text>
1182 <xsl:apply-templates/>
1183 <xsl:text>/></xsl:text>
1185 <xsl:when test="$class='sgmlcomment' or $class='comment'">
1186 <xsl:text><!--</xsl:text>
1187 <xsl:apply-templates/>
1188 <xsl:text>--></xsl:text>
1191 <xsl:apply-templates/>
1197 <xsl:apply-templates select="." mode="common.html.attributes">
1198 <xsl:with-param name="class" select="concat('sgmltag-', $class)"/>
1199 </xsl:apply-templates>
1200 <xsl:call-template name="simple.xlink">
1201 <xsl:with-param name="content" select="$content"/>
1202 </xsl:call-template>
1206 <xsl:template match="d:email">
1207 <xsl:call-template name="inline.monoseq">
1208 <xsl:with-param name="content">
1209 <xsl:if test="not($email.delimiters.enabled = 0)">
1210 <xsl:text><</xsl:text>
1213 <xsl:apply-templates select="." mode="common.html.attributes"/>
1214 <xsl:call-template name="id.attribute"/>
1215 <xsl:attribute name="href">
1216 <xsl:text>mailto:</xsl:text>
1217 <xsl:value-of select="."/>
1219 <xsl:apply-templates/>
1221 <xsl:if test="not($email.delimiters.enabled = 0)">
1222 <xsl:text>></xsl:text>
1225 </xsl:call-template>
1228 <xsl:template match="d:keycombo">
1229 <xsl:variable name="action" select="@action"/>
1230 <xsl:variable name="joinchar">
1232 <xsl:when test="$action='seq'"><xsl:text> </xsl:text></xsl:when>
1233 <xsl:when test="$action='simul'">+</xsl:when>
1234 <xsl:when test="$action='press'">-</xsl:when>
1235 <xsl:when test="$action='click'">-</xsl:when>
1236 <xsl:when test="$action='double-click'">-</xsl:when>
1237 <xsl:when test="$action='other'"/>
1238 <xsl:otherwise>+</xsl:otherwise>
1241 <xsl:for-each select="*">
1242 <xsl:if test="position()>1"><xsl:value-of select="$joinchar"/></xsl:if>
1243 <xsl:apply-templates select="."/>
1247 <xsl:template match="d:uri">
1248 <xsl:call-template name="inline.monoseq"/>
1251 <!-- ==================================================================== -->
1253 <xsl:template match="d:menuchoice">
1254 <xsl:variable name="shortcut" select="./d:shortcut"/>
1255 <xsl:call-template name="process.menuchoice"/>
1256 <xsl:if test="$shortcut">
1257 <xsl:text> (</xsl:text>
1258 <xsl:apply-templates select="$shortcut"/>
1259 <xsl:text>)</xsl:text>
1263 <xsl:template name="process.menuchoice">
1264 <xsl:param name="nodelist" select="d:guibutton|d:guiicon|d:guilabel|d:guimenu|d:guimenuitem|d:guisubmenu|d:interface"/><!-- not(shortcut) -->
1265 <xsl:param name="count" select="1"/>
1268 <xsl:when test="$count>count($nodelist)"/>
1269 <xsl:when test="$count=1">
1270 <xsl:apply-templates select="$nodelist[$count=position()]"/>
1271 <xsl:call-template name="process.menuchoice">
1272 <xsl:with-param name="nodelist" select="$nodelist"/>
1273 <xsl:with-param name="count" select="$count+1"/>
1274 </xsl:call-template>
1277 <xsl:variable name="node" select="$nodelist[$count=position()]"/>
1279 <xsl:when test="local-name($node)='guimenuitem' or local-name($node)='guisubmenu'">
1280 <xsl:value-of select="$menuchoice.menu.separator"/>
1283 <xsl:value-of select="$menuchoice.separator"/>
1286 <xsl:apply-templates select="$node"/>
1287 <xsl:call-template name="process.menuchoice">
1288 <xsl:with-param name="nodelist" select="$nodelist"/>
1289 <xsl:with-param name="count" select="$count+1"/>
1290 </xsl:call-template>
1295 <!-- ==================================================================== -->
1297 <xsl:template match="d:optional">
1298 <xsl:value-of select="$arg.choice.opt.open.str"/>
1299 <xsl:call-template name="inline.charseq"/>
1300 <xsl:value-of select="$arg.choice.opt.close.str"/>
1303 <xsl:template match="d:citation">
1304 <!-- todo: integrate with bibliography collection -->
1305 <xsl:variable name="targets" select="(//d:biblioentry | //d:bibliomixed)[d:abbrev = string(current())]"/>
1306 <xsl:variable name="target" select="$targets[1]"/>
1309 <!-- try automatic linking based on match to abbrev -->
1310 <xsl:when test="$target and not(d:xref) and not(d:link)">
1312 <xsl:text>[</xsl:text>
1314 <xsl:apply-templates select="." mode="common.html.attributes"/>
1315 <xsl:attribute name="href">
1316 <xsl:call-template name="href.target">
1317 <xsl:with-param name="object" select="$target"/>
1318 </xsl:call-template>
1322 <xsl:when test="$bibliography.numbered != 0">
1323 <xsl:call-template name="id.attribute"/>
1324 <xsl:apply-templates select="$target" mode="citation"/>
1327 <xsl:call-template name="inline.charseq"/>
1332 <xsl:text>]</xsl:text>
1335 <xsl:text>[</xsl:text>
1336 <xsl:call-template name="inline.charseq"/>
1337 <xsl:text>]</xsl:text>
1342 <xsl:template match="d:citebiblioid">
1343 <xsl:variable name="targets" select="//*[d:biblioid = string(current())]"/>
1344 <xsl:variable name="target" select="$targets[1]"/>
1347 <!-- try automatic linking based on match to parent of biblioid -->
1348 <xsl:when test="$target and not(d:xref) and not(d:link)">
1350 <xsl:text>[</xsl:text>
1352 <xsl:apply-templates select="." mode="common.html.attributes"/>
1353 <xsl:attribute name="href">
1354 <xsl:call-template name="href.target">
1355 <xsl:with-param name="object" select="$target"/>
1356 </xsl:call-template>
1359 <xsl:call-template name="inline.charseq"/>
1362 <xsl:text>]</xsl:text>
1365 <xsl:text>[</xsl:text>
1366 <xsl:call-template name="inline.charseq"/>
1367 <xsl:text>]</xsl:text>
1372 <xsl:template match="d:biblioentry|d:bibliomixed" mode="citation">
1373 <xsl:number from="d:bibliography" count="d:biblioentry|d:bibliomixed" level="any" format="1"/>
1376 <!-- ==================================================================== -->
1378 <xsl:template match="d:comment[parent::d:answer|parent::d:appendix|parent::d:article|parent::d:bibliodiv| parent::d:bibliography|parent::d:blockquote|parent::d:caution|parent::d:chapter| parent::d:glossary|parent::d:glossdiv|parent::d:important|parent::d:index| parent::d:indexdiv|parent::d:listitem|parent::d:note|parent::d:orderedlist| parent::d:partintro|parent::d:preface|parent::d:procedure|parent::d:qandadiv| parent::d:qandaset|parent::d:question|parent::d:refentry|parent::d:refnamediv| parent::d:refsect1|parent::d:refsect2|parent::d:refsect3|parent::d:refsection| parent::d:refsynopsisdiv|parent::d:sect1|parent::d:sect2|parent::d:sect3|parent::d:sect4| parent::d:sect5|parent::d:section|parent::d:setindex|parent::d:sidebar| parent::d:simplesect|parent::d:taskprerequisites|parent::d:taskrelated| parent::d:tasksummary|parent::d:warning|parent::d:topic]|d:remark[parent::d:answer|parent::d:appendix|parent::d:article|parent::d:bibliodiv| parent::d:bibliography|parent::d:blockquote|parent::d:caution|parent::d:chapter| parent::d:glossary|parent::d:glossdiv|parent::d:important|parent::d:index| parent::d:indexdiv|parent::d:listitem|parent::d:note|parent::d:orderedlist| parent::d:partintro|parent::d:preface|parent::d:procedure|parent::d:qandadiv| parent::d:qandaset|parent::d:question|parent::d:refentry|parent::d:refnamediv| parent::d:refsect1|parent::d:refsect2|parent::d:refsect3|parent::d:refsection| parent::d:refsynopsisdiv|parent::d:sect1|parent::d:sect2|parent::d:sect3|parent::d:sect4| parent::d:sect5|parent::d:section|parent::d:setindex|parent::d:sidebar| parent::d:simplesect|parent::d:taskprerequisites|parent::d:taskrelated| parent::d:tasksummary|parent::d:warning|parent::d:topic]">
1379 <xsl:if test="$show.comments != 0">
1380 <p class="remark"><em><xsl:call-template name="inline.charseq"/></em></p>
1384 <xsl:template match="d:comment|d:remark">
1385 <xsl:if test="$show.comments != 0">
1386 <em><xsl:call-template name="inline.charseq"/></em>
1390 <!-- ==================================================================== -->
1392 <xsl:template match="d:productname">
1393 <xsl:call-template name="inline.charseq"/>
1394 <xsl:if test="@class">
1395 <xsl:call-template name="dingbat">
1396 <xsl:with-param name="dingbat" select="@class"/>
1397 </xsl:call-template>
1401 <xsl:template match="d:productnumber">
1402 <xsl:call-template name="inline.charseq"/>
1405 <!-- ==================================================================== -->
1407 <xsl:template match="d:pob|d:street|d:city|d:state|d:postcode|d:country|d:otheraddr">
1408 <xsl:call-template name="inline.charseq"/>
1411 <xsl:template match="d:phone|d:fax">
1412 <xsl:call-template name="inline.charseq"/>
1415 <!-- in Addresses, for example -->
1416 <xsl:template match="d:honorific|d:firstname|d:surname|d:lineage|d:othername">
1417 <xsl:call-template name="inline.charseq"/>
1420 <!-- ==================================================================== -->
1422 <xsl:template match="d:person">
1423 <xsl:param name="content">
1424 <xsl:apply-templates select="d:personname"/>
1427 <xsl:param name="contentwithlink">
1428 <xsl:call-template name="anchor"/>
1429 <xsl:call-template name="simple.xlink">
1430 <xsl:with-param name="content" select="$content"/>
1431 </xsl:call-template>
1432 <xsl:call-template name="apply-annotations"/>
1436 <xsl:apply-templates select="." mode="common.html.attributes"/>
1437 <xsl:call-template name="id.attribute"/>
1438 <xsl:copy-of select="$contentwithlink"/>
1442 <xsl:template match="d:personname">
1443 <xsl:param name="content">
1444 <xsl:call-template name="person.name"/>
1447 <xsl:param name="contentwithlink">
1448 <xsl:call-template name="anchor"/>
1449 <xsl:call-template name="simple.xlink">
1450 <xsl:with-param name="content" select="$content"/>
1451 </xsl:call-template>
1452 <xsl:call-template name="apply-annotations"/>
1456 <xsl:apply-templates select="." mode="common.html.attributes"/>
1457 <xsl:call-template name="id.attribute"/>
1458 <xsl:copy-of select="$contentwithlink"/>
1462 <!-- ==================================================================== -->
1464 <xsl:template match="d:org">
1465 <xsl:param name="content">
1466 <xsl:apply-templates/>
1469 <xsl:param name="contentwithlink">
1470 <xsl:call-template name="anchor"/>
1471 <xsl:call-template name="simple.xlink">
1472 <xsl:with-param name="content" select="$content"/>
1473 </xsl:call-template>
1474 <xsl:call-template name="apply-annotations"/>
1478 <xsl:apply-templates select="." mode="common.html.attributes"/>
1479 <xsl:call-template name="id.attribute"/>
1480 <xsl:copy-of select="$contentwithlink"/>
1484 <xsl:template match="d:orgname">
1485 <xsl:param name="content">
1486 <xsl:apply-templates/>
1489 <xsl:param name="contentwithlink">
1490 <xsl:call-template name="anchor"/>
1491 <xsl:call-template name="simple.xlink">
1492 <xsl:with-param name="content" select="$content"/>
1493 </xsl:call-template>
1494 <xsl:call-template name="apply-annotations"/>
1498 <xsl:apply-templates select="." mode="common.html.attributes"/>
1499 <xsl:call-template name="id.attribute"/>
1500 <xsl:copy-of select="$contentwithlink"/>
1504 <xsl:template match="d:orgdiv">
1505 <xsl:param name="content">
1506 <xsl:apply-templates/>
1509 <xsl:param name="contentwithlink">
1510 <xsl:call-template name="anchor"/>
1511 <xsl:call-template name="simple.xlink">
1512 <xsl:with-param name="content" select="$content"/>
1513 </xsl:call-template>
1514 <xsl:call-template name="apply-annotations"/>
1518 <xsl:apply-templates select="." mode="common.html.attributes"/>
1519 <xsl:call-template name="id.attribute"/>
1520 <xsl:copy-of select="$contentwithlink"/>
1524 <xsl:template match="d:affiliation">
1525 <xsl:param name="content">
1526 <xsl:call-template name="person.name"/>
1529 <xsl:param name="contentwithlink">
1530 <xsl:call-template name="anchor"/>
1531 <xsl:call-template name="simple.xlink">
1532 <xsl:with-param name="content" select="$content"/>
1533 </xsl:call-template>
1534 <xsl:call-template name="apply-annotations"/>
1538 <xsl:apply-templates select="." mode="common.html.attributes"/>
1539 <xsl:call-template name="id.attribute"/>
1540 <xsl:copy-of select="$contentwithlink"/>
1544 <!-- ==================================================================== -->
1546 <xsl:template match="d:beginpage">
1547 <!-- does nothing; this *is not* markup to force a page break. -->