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 8421 2009-05-04 07:49:49Z 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 ******************************************************************** -->
15 <xsl:template name="simple.xlink">
16 <xsl:param name="node" select="."/>
17 <xsl:param name="content">
18 <xsl:apply-templates/>
20 <xsl:param name="linkend" select="$node/@linkend"/>
21 <xsl:param name="xhref" select="$node/@xlink:href"/>
23 <!-- Support for @xlink:show -->
24 <xsl:variable name="target.show">
26 <xsl:when test="$node/@xlink:show = 'new'">_blank</xsl:when>
27 <xsl:when test="$node/@xlink:show = 'replace'">_top</xsl:when>
32 <xsl:variable name="link">
34 <xsl:when test="$xhref and (not($node/@xlink:type) or $node/@xlink:type='simple')">
36 <!-- Is it a local idref or a uri? -->
37 <xsl:variable name="is.idref">
39 <!-- if the href starts with # and does not contain an "(" -->
40 <!-- or if the href starts with #xpointer(id(, it's just an ID -->
41 <xsl:when test="starts-with($xhref,'#') and (not(contains($xhref,'(')) or starts-with($xhref, '#xpointer(id('))">1</xsl:when>
42 <xsl:otherwise>0</xsl:otherwise>
46 <!-- Is it an olink ? -->
47 <xsl:variable name="is.olink">
49 <!-- If xlink:role="http://docbook.org/xlink/role/olink" -->
50 <!-- and if the href contains # -->
51 <xsl:when test="contains($xhref,'#') and @xlink:role = $xolink.role">1</xsl:when>
52 <xsl:otherwise>0</xsl:otherwise>
57 <xsl:when test="$is.olink = 1">
58 <xsl:call-template name="olink">
59 <xsl:with-param name="content" select="$content"/>
63 <xsl:when test="$is.idref = 1">
65 <xsl:variable name="idref">
66 <xsl:call-template name="xpointer.idref">
67 <xsl:with-param name="xpointer" select="$xhref"/>
71 <xsl:variable name="targets" select="key('id',$idref)"/>
72 <xsl:variable name="target" select="$targets[1]"/>
74 <xsl:call-template name="check.id.unique">
75 <xsl:with-param name="linkend" select="$idref"/>
79 <xsl:when test="count($target) = 0">
81 <xsl:text>XLink to nonexistent id: </xsl:text>
82 <xsl:value-of select="$idref"/>
84 <xsl:copy-of select="$content"/>
89 <xsl:apply-templates select="." mode="common.html.attributes"/>
91 <xsl:attribute name="href">
92 <xsl:call-template name="href.target">
93 <xsl:with-param name="object" select="$target"/>
98 <xsl:when test="$node/@xlink:title">
99 <xsl:attribute name="title">
100 <xsl:value-of select="$node/@xlink:title"/>
104 <xsl:apply-templates select="$target" mode="html.title.attribute"/>
108 <xsl:if test="$target.show !=''">
109 <xsl:attribute name="target">
110 <xsl:value-of select="$target.show"/>
114 <xsl:copy-of select="$content"/>
121 <!-- otherwise it's a URI -->
124 <xsl:apply-templates select="." mode="common.html.attributes"/>
125 <xsl:attribute name="href">
126 <xsl:value-of select="$xhref"/>
128 <xsl:if test="$node/@xlink:title">
129 <xsl:attribute name="title">
130 <xsl:value-of select="$node/@xlink:title"/>
134 <!-- For URIs, use @xlink:show if defined, otherwise use ulink.target -->
135 <xsl:attribute name="target">
137 <xsl:when test="$target.show !=''">
138 <xsl:value-of select="$target.show"/>
141 <xsl:value-of select="$ulink.target"/>
146 <xsl:copy-of select="$content"/>
152 <xsl:when test="$linkend">
153 <xsl:variable name="targets" select="key('id',$linkend)"/>
154 <xsl:variable name="target" select="$targets[1]"/>
156 <xsl:call-template name="check.id.unique">
157 <xsl:with-param name="linkend" select="$linkend"/>
161 <xsl:apply-templates select="." mode="common.html.attributes"/>
162 <xsl:attribute name="href">
163 <xsl:call-template name="href.target">
164 <xsl:with-param name="object" select="$target"/>
168 <xsl:apply-templates select="$target" mode="html.title.attribute"/>
170 <xsl:copy-of select="$content"/>
175 <xsl:copy-of select="$content"/>
181 <xsl:when test="function-available('suwl:unwrapLinks')">
182 <xsl:copy-of select="suwl:unwrapLinks($link)"/>
185 <xsl:copy-of select="$link"/>
190 <xsl:template name="inline.charseq">
191 <xsl:param name="content">
192 <xsl:call-template name="anchor"/>
193 <xsl:call-template name="simple.xlink">
194 <xsl:with-param name="content">
195 <xsl:apply-templates/>
199 <!-- * if you want output from the inline.charseq template wrapped in -->
200 <!-- * something other than a Span, call the template with some value -->
201 <!-- * for the 'wrapper-name' param -->
202 <xsl:param name="wrapper-name">span</xsl:param>
203 <xsl:element name="{$wrapper-name}" namespace="http://www.w3.org/1999/xhtml">
204 <xsl:attribute name="class">
205 <xsl:value-of select="local-name(.)"/>
207 <xsl:call-template name="dir"/>
208 <xsl:call-template name="generate.html.title"/>
209 <xsl:copy-of select="$content"/>
210 <xsl:call-template name="apply-annotations"/>
214 <xsl:template name="inline.monoseq">
215 <xsl:param name="content">
216 <xsl:call-template name="anchor"/>
217 <xsl:call-template name="simple.xlink">
218 <xsl:with-param name="content">
219 <xsl:apply-templates/>
224 <xsl:apply-templates select="." mode="common.html.attributes"/>
225 <xsl:copy-of select="$content"/>
226 <xsl:call-template name="apply-annotations"/>
230 <xsl:template name="inline.boldseq">
231 <xsl:param name="content">
232 <xsl:call-template name="anchor"/>
233 <xsl:call-template name="simple.xlink">
234 <xsl:with-param name="content">
235 <xsl:apply-templates/>
241 <xsl:apply-templates select="." mode="common.html.attributes"/>
243 <!-- don't put <strong> inside figure, example, or table titles -->
245 <xsl:when test="local-name(..) = 'title' and (local-name(../..) = 'figure' or local-name(../..) = 'example' or local-name(../..) = 'table')">
246 <xsl:copy-of select="$content"/>
250 <xsl:copy-of select="$content"/>
254 <xsl:call-template name="apply-annotations"/>
258 <xsl:template name="inline.italicseq">
259 <xsl:param name="content">
260 <xsl:call-template name="anchor"/>
261 <xsl:call-template name="simple.xlink">
262 <xsl:with-param name="content">
263 <xsl:apply-templates/>
268 <xsl:call-template name="common.html.attributes"/>
269 <xsl:copy-of select="$content"/>
270 <xsl:call-template name="apply-annotations"/>
274 <xsl:template name="inline.boldmonoseq">
275 <xsl:param name="content">
276 <xsl:call-template name="anchor"/>
277 <xsl:call-template name="simple.xlink">
278 <xsl:with-param name="content">
279 <xsl:apply-templates/>
283 <!-- don't put <strong> inside figure, example, or table titles -->
284 <!-- or other titles that may already be represented with <strong>'s. -->
286 <xsl:when test="local-name(..) = 'title' and (local-name(../..) = 'figure' or local-name(../..) = 'example' or local-name(../..) = 'table' or local-name(../..) = 'formalpara')">
288 <xsl:call-template name="common.html.attributes"/>
289 <xsl:copy-of select="$content"/>
290 <xsl:call-template name="apply-annotations"/>
295 <xsl:call-template name="common.html.attributes"/>
297 <xsl:call-template name="generate.html.title"/>
298 <xsl:call-template name="dir"/>
299 <xsl:copy-of select="$content"/>
301 <xsl:call-template name="apply-annotations"/>
307 <xsl:template name="inline.italicmonoseq">
308 <xsl:param name="content">
309 <xsl:call-template name="anchor"/>
310 <xsl:call-template name="simple.xlink">
311 <xsl:with-param name="content">
312 <xsl:apply-templates/>
317 <xsl:call-template name="common.html.attributes"/>
319 <xsl:call-template name="generate.html.title"/>
320 <xsl:call-template name="dir"/>
321 <xsl:copy-of select="$content"/>
322 <xsl:call-template name="apply-annotations"/>
327 <xsl:template name="inline.superscriptseq">
328 <xsl:param name="content">
329 <xsl:call-template name="anchor"/>
330 <xsl:call-template name="simple.xlink">
331 <xsl:with-param name="content">
332 <xsl:apply-templates/>
337 <xsl:call-template name="generate.html.title"/>
338 <xsl:call-template name="dir"/>
339 <xsl:copy-of select="$content"/>
340 <xsl:call-template name="apply-annotations"/>
344 <xsl:template name="inline.subscriptseq">
345 <xsl:param name="content">
346 <xsl:call-template name="anchor"/>
347 <xsl:call-template name="simple.xlink">
348 <xsl:with-param name="content">
349 <xsl:apply-templates/>
354 <xsl:call-template name="generate.html.title"/>
355 <xsl:call-template name="dir"/>
356 <xsl:copy-of select="$content"/>
357 <xsl:call-template name="apply-annotations"/>
361 <!-- ==================================================================== -->
362 <!-- some special cases -->
364 <xsl:template match="author">
365 <xsl:param name="content">
366 <xsl:call-template name="anchor"/>
367 <xsl:call-template name="simple.xlink">
368 <xsl:with-param name="content">
369 <xsl:call-template name="person.name"/>
372 <xsl:call-template name="apply-annotations"/>
376 <xsl:call-template name="common.html.attributes"/>
377 <xsl:copy-of select="$content"/>
381 <xsl:template match="editor">
382 <xsl:param name="content">
383 <xsl:call-template name="anchor"/>
384 <xsl:call-template name="simple.xlink">
385 <xsl:with-param name="content">
386 <xsl:call-template name="person.name"/>
389 <xsl:call-template name="apply-annotations"/>
393 <xsl:call-template name="common.html.attributes"/>
394 <xsl:copy-of select="$content"/>
398 <xsl:template match="othercredit">
399 <xsl:param name="content">
400 <xsl:call-template name="anchor"/>
401 <xsl:call-template name="simple.xlink">
402 <xsl:with-param name="content">
403 <xsl:call-template name="person.name"/>
406 <xsl:call-template name="apply-annotations"/>
410 <xsl:call-template name="common.html.attributes"/>
411 <xsl:copy-of select="$content"/>
415 <xsl:template match="authorinitials">
416 <xsl:call-template name="inline.charseq"/>
419 <!-- ==================================================================== -->
421 <xsl:template match="accel">
422 <xsl:call-template name="inline.charseq"/>
425 <xsl:template match="action">
426 <xsl:call-template name="inline.charseq"/>
429 <xsl:template match="application">
430 <xsl:call-template name="inline.charseq"/>
433 <xsl:template match="classname">
434 <xsl:call-template name="inline.monoseq"/>
437 <xsl:template match="exceptionname">
438 <xsl:call-template name="inline.monoseq"/>
441 <xsl:template match="interfacename">
442 <xsl:call-template name="inline.monoseq"/>
445 <xsl:template match="methodname">
446 <xsl:call-template name="inline.monoseq"/>
449 <xsl:template match="command">
450 <xsl:call-template name="inline.boldseq"/>
453 <xsl:template match="computeroutput">
454 <xsl:call-template name="inline.monoseq"/>
457 <xsl:template match="constant">
458 <xsl:call-template name="inline.monoseq"/>
461 <xsl:template match="database">
462 <xsl:call-template name="inline.charseq"/>
465 <xsl:template match="date">
466 <!-- should this support locale-specific formatting? how? -->
467 <xsl:call-template name="inline.charseq"/>
470 <xsl:template match="errorcode">
471 <xsl:call-template name="inline.charseq"/>
474 <xsl:template match="errorname">
475 <xsl:call-template name="inline.charseq"/>
478 <xsl:template match="errortype">
479 <xsl:call-template name="inline.charseq"/>
482 <xsl:template match="errortext">
483 <xsl:call-template name="inline.charseq"/>
486 <xsl:template match="envar">
487 <xsl:call-template name="inline.monoseq"/>
490 <xsl:template match="filename">
491 <xsl:call-template name="inline.monoseq"/>
494 <xsl:template match="function">
496 <xsl:when test="$function.parens != '0' and (parameter or function or replaceable)">
497 <xsl:variable name="nodes" select="text()|*"/>
498 <xsl:call-template name="inline.monoseq">
499 <xsl:with-param name="content">
500 <xsl:call-template name="simple.xlink">
501 <xsl:with-param name="content">
502 <xsl:apply-templates select="$nodes[1]"/>
507 <xsl:text>(</xsl:text>
508 <xsl:apply-templates select="$nodes[position()>1]"/>
509 <xsl:text>)</xsl:text>
512 <xsl:call-template name="inline.monoseq"/>
517 <xsl:template match="function/parameter" priority="2">
518 <xsl:call-template name="inline.italicmonoseq"/>
519 <xsl:if test="following-sibling::*">
520 <xsl:text>, </xsl:text>
524 <xsl:template match="function/replaceable" priority="2">
525 <xsl:call-template name="inline.italicmonoseq"/>
526 <xsl:if test="following-sibling::*">
527 <xsl:text>, </xsl:text>
531 <xsl:template match="guibutton">
532 <xsl:call-template name="inline.charseq"/>
535 <xsl:template match="guiicon">
536 <xsl:call-template name="inline.charseq"/>
539 <xsl:template match="guilabel">
540 <xsl:call-template name="inline.charseq"/>
543 <xsl:template match="guimenu">
544 <xsl:call-template name="inline.charseq"/>
547 <xsl:template match="guimenuitem">
548 <xsl:call-template name="inline.charseq"/>
551 <xsl:template match="guisubmenu">
552 <xsl:call-template name="inline.charseq"/>
555 <xsl:template match="hardware">
556 <xsl:call-template name="inline.charseq"/>
559 <xsl:template match="interface">
560 <xsl:call-template name="inline.charseq"/>
563 <xsl:template match="interfacedefinition">
564 <xsl:call-template name="inline.charseq"/>
567 <xsl:template match="keycap">
568 <xsl:call-template name="inline.boldseq"/>
571 <xsl:template match="keycode">
572 <xsl:call-template name="inline.charseq"/>
575 <xsl:template match="keysym">
576 <xsl:call-template name="inline.charseq"/>
579 <xsl:template match="literal">
580 <xsl:call-template name="inline.monoseq"/>
583 <xsl:template match="code">
584 <xsl:call-template name="inline.monoseq"/>
587 <xsl:template match="medialabel">
588 <xsl:call-template name="inline.italicseq"/>
591 <xsl:template match="shortcut">
592 <xsl:call-template name="inline.boldseq"/>
595 <xsl:template match="mousebutton">
596 <xsl:call-template name="inline.charseq"/>
599 <xsl:template match="option">
600 <xsl:call-template name="inline.monoseq"/>
603 <xsl:template match="package">
604 <xsl:call-template name="inline.charseq"/>
607 <xsl:template match="parameter">
608 <xsl:call-template name="inline.italicmonoseq"/>
611 <xsl:template match="property">
612 <xsl:call-template name="inline.charseq"/>
615 <xsl:template match="prompt">
616 <xsl:call-template name="inline.monoseq"/>
619 <xsl:template match="replaceable" priority="1">
620 <xsl:call-template name="inline.italicmonoseq"/>
623 <xsl:template match="returnvalue">
624 <xsl:call-template name="inline.charseq"/>
627 <xsl:template match="structfield">
628 <xsl:call-template name="inline.italicmonoseq"/>
631 <xsl:template match="structname">
632 <xsl:call-template name="inline.charseq"/>
635 <xsl:template match="symbol">
636 <xsl:call-template name="inline.charseq"/>
639 <xsl:template match="systemitem">
640 <xsl:call-template name="inline.monoseq"/>
643 <xsl:template match="token">
644 <xsl:call-template name="inline.charseq"/>
647 <xsl:template match="type">
648 <xsl:call-template name="inline.charseq"/>
651 <xsl:template match="userinput">
652 <xsl:call-template name="inline.boldmonoseq"/>
655 <xsl:template match="abbrev">
656 <xsl:call-template name="inline.charseq">
657 <xsl:with-param name="wrapper-name">abbr</xsl:with-param>
661 <xsl:template match="acronym">
662 <xsl:call-template name="inline.charseq">
663 <xsl:with-param name="wrapper-name">acronym</xsl:with-param>
667 <xsl:template match="citerefentry">
669 <xsl:when test="$citerefentry.link != '0'">
671 <xsl:apply-templates select="." mode="common.html.attributes"/>
672 <xsl:attribute name="href">
673 <xsl:call-template name="generate.citerefentry.link"/>
675 <xsl:call-template name="inline.charseq"/>
679 <xsl:call-template name="inline.charseq"/>
684 <xsl:template name="generate.citerefentry.link">
688 <xsl:template name="x.generate.citerefentry.link">
689 <xsl:text>http://example.com/cgi-bin/man.cgi?</xsl:text>
690 <xsl:value-of select="refentrytitle"/>
691 <xsl:text>(</xsl:text>
692 <xsl:value-of select="manvolnum"/>
693 <xsl:text>)</xsl:text>
696 <xsl:template match="citetitle">
698 <xsl:when test="@pubwork = 'article'">
699 <xsl:call-template name="gentext.startquote"/>
700 <xsl:call-template name="inline.charseq"/>
701 <xsl:call-template name="gentext.endquote"/>
704 <xsl:call-template name="inline.italicseq"/>
709 <xsl:template match="emphasis">
712 <!-- We don't want empty @class values, so do not propagate empty @roles -->
713 <xsl:when test="@role and normalize-space(@role) != '' and $emphasis.propagates.style != 0">
714 <xsl:apply-templates select="." mode="common.html.attributes">
715 <xsl:with-param name="class" select="@role"/>
716 </xsl:apply-templates>
719 <xsl:apply-templates select="." mode="common.html.attributes"/>
722 <xsl:call-template name="anchor"/>
724 <xsl:call-template name="simple.xlink">
725 <xsl:with-param name="content">
727 <xsl:when test="@role = 'bold' or @role='strong'">
728 <!-- backwards compatibility: make bold into b elements, but -->
729 <!-- don't put bold inside figure, example, or table titles -->
731 <xsl:when test="local-name(..) = 'title' and (local-name(../..) = 'figure' or local-name(../..) = 'example' or local-name(../..) = 'table')">
732 <xsl:apply-templates/>
735 <strong><xsl:apply-templates/></strong>
739 <xsl:when test="@role and $emphasis.propagates.style != 0">
740 <xsl:apply-templates/>
743 <em><xsl:apply-templates/></em>
751 <xsl:template match="foreignphrase">
753 <xsl:apply-templates select="." mode="common.html.attributes"/>
754 <xsl:call-template name="inline.italicseq"/>
758 <xsl:template match="markup">
759 <xsl:call-template name="inline.charseq"/>
762 <xsl:template match="phrase">
764 <xsl:call-template name="locale.html.attributes"/>
765 <!-- We don't want empty @class values, so do not propagate empty @roles -->
766 <xsl:if test="@role and normalize-space(@role) != '' and $phrase.propagates.style != 0">
767 <xsl:apply-templates select="." mode="class.attribute">
768 <xsl:with-param name="class" select="@role"/>
769 </xsl:apply-templates>
771 <xsl:call-template name="dir"/>
772 <xsl:call-template name="anchor"/>
773 <xsl:call-template name="simple.xlink">
774 <xsl:with-param name="content">
775 <xsl:apply-templates/>
778 <xsl:call-template name="apply-annotations"/>
782 <xsl:template match="quote">
783 <xsl:variable name="depth">
784 <xsl:call-template name="dot.count">
785 <xsl:with-param name="string">
786 <xsl:number level="multiple"/>
791 <xsl:apply-templates select="." mode="common.html.attributes"/>
792 <xsl:call-template name="anchor"/>
794 <xsl:when test="$depth mod 2 = 0">
795 <xsl:call-template name="gentext.startquote"/>
796 <xsl:call-template name="inline.charseq"/>
797 <xsl:call-template name="gentext.endquote"/>
800 <xsl:call-template name="gentext.nestedstartquote"/>
801 <xsl:call-template name="inline.charseq"/>
802 <xsl:call-template name="gentext.nestedendquote"/>
808 <xsl:template match="varname">
809 <xsl:call-template name="inline.monoseq"/>
812 <xsl:template match="wordasword">
813 <xsl:call-template name="inline.italicseq"/>
816 <xsl:template match="lineannotation">
818 <xsl:apply-templates select="." mode="common.html.attributes"/>
819 <xsl:call-template name="inline.charseq"/>
823 <xsl:template match="superscript">
824 <xsl:call-template name="inline.superscriptseq"/>
827 <xsl:template match="subscript">
828 <xsl:call-template name="inline.subscriptseq"/>
831 <xsl:template match="trademark">
832 <xsl:call-template name="inline.charseq"/>
834 <xsl:when test="@class = 'copyright' or @class = 'registered'">
835 <xsl:call-template name="dingbat">
836 <xsl:with-param name="dingbat" select="@class"/>
839 <xsl:when test="@class = 'service'">
843 <xsl:call-template name="dingbat">
844 <xsl:with-param name="dingbat" select="'trademark'"/>
850 <xsl:template match="firstterm">
851 <xsl:call-template name="glossterm">
852 <xsl:with-param name="firstterm" select="1"/>
856 <xsl:template match="glossterm" name="glossterm">
857 <xsl:param name="firstterm" select="0"/>
859 <!-- To avoid extra <a name=""> anchor from inline.italicseq -->
860 <xsl:variable name="content">
861 <xsl:apply-templates/>
865 <xsl:when test="($firstterm.only.link = 0 or $firstterm = 1) and @linkend">
866 <xsl:variable name="targets" select="key('id',@linkend)"/>
867 <xsl:variable name="target" select="$targets[1]"/>
869 <xsl:call-template name="check.id.unique">
870 <xsl:with-param name="linkend" select="@linkend"/>
874 <xsl:when test="$target">
876 <xsl:apply-templates select="." mode="common.html.attributes"/>
877 <xsl:if test="@id or @xml:id">
878 <xsl:attribute name="id">
879 <xsl:value-of select="(@id|@xml:id)[1]"/>
883 <xsl:attribute name="href">
884 <xsl:call-template name="href.target">
885 <xsl:with-param name="object" select="$target"/>
889 <xsl:call-template name="inline.italicseq">
890 <xsl:with-param name="content" select="$content"/>
895 <xsl:call-template name="inline.italicseq">
896 <xsl:with-param name="content" select="$content"/>
902 <xsl:when test="not(@linkend) and ($firstterm.only.link = 0 or $firstterm = 1) and ($glossterm.auto.link != 0) and $glossary.collection != ''">
903 <xsl:variable name="term">
905 <xsl:when test="@baseform"><xsl:value-of select="@baseform"/></xsl:when>
906 <xsl:otherwise><xsl:value-of select="."/></xsl:otherwise>
910 <xsl:variable name="cterm" select="(document($glossary.collection,.)//glossentry[glossterm=$term])[1]"/>
912 <!-- HACK HACK HACK! But it works... -->
913 <!-- You'd need to do more work if you wanted to chunk on glossdiv, though -->
915 <xsl:variable name="glossary" select="//glossary[@role='auto']"/>
917 <xsl:if test="count($glossary) != 1">
919 <xsl:text>Warning: glossary.collection specified, but there are </xsl:text>
920 <xsl:value-of select="count($glossary)"/>
921 <xsl:text> automatic glossaries</xsl:text>
925 <xsl:variable name="glosschunk">
926 <xsl:call-template name="href.target">
927 <xsl:with-param name="object" select="$glossary"/>
931 <xsl:variable name="chunkbase">
933 <xsl:when test="contains($glosschunk, '#')">
934 <xsl:value-of select="substring-before($glosschunk, '#')"/>
937 <xsl:value-of select="$glosschunk"/>
943 <xsl:when test="not($cterm)">
945 <xsl:text>There's no entry for </xsl:text>
946 <xsl:value-of select="$term"/>
947 <xsl:text> in </xsl:text>
948 <xsl:value-of select="$glossary.collection"/>
950 <xsl:call-template name="inline.italicseq"/>
953 <xsl:variable name="id">
954 <xsl:call-template name="object.id">
955 <xsl:with-param name="object" select="$cterm"/>
958 <a href="{$chunkbase}#{$id}">
959 <xsl:apply-templates select="." mode="common.html.attributes"/>
960 <xsl:call-template name="inline.italicseq">
961 <xsl:with-param name="content" select="$content"/>
968 <xsl:when test="not(@linkend) and ($firstterm.only.link = 0 or $firstterm = 1) and $glossterm.auto.link != 0">
969 <xsl:variable name="term">
971 <xsl:when test="@baseform">
972 <xsl:value-of select="normalize-space(@baseform)"/>
975 <xsl:value-of select="normalize-space(.)"/>
979 <xsl:variable name="targets" select="//glossentry[normalize-space(glossterm)=$term or normalize-space(glossterm/@baseform)=$term]"/>
980 <xsl:variable name="target" select="$targets[1]"/>
983 <xsl:when test="count($targets)=0">
985 <xsl:text>Error: no glossentry for glossterm: </xsl:text>
986 <xsl:value-of select="."/>
987 <xsl:text>.</xsl:text>
989 <xsl:call-template name="inline.italicseq"/>
993 <xsl:apply-templates select="." mode="common.html.attributes"/>
994 <xsl:if test="@id or @xml:id">
995 <xsl:attribute name="id">
996 <xsl:value-of select="(@id|@xml:id)[1]"/>
1000 <xsl:attribute name="href">
1001 <xsl:call-template name="href.target">
1002 <xsl:with-param name="object" select="$target"/>
1003 </xsl:call-template>
1006 <xsl:call-template name="inline.italicseq">
1007 <xsl:with-param name="content" select="$content"/>
1008 </xsl:call-template>
1015 <xsl:call-template name="inline.italicseq"/>
1020 <xsl:template match="termdef">
1022 <xsl:apply-templates select="." mode="common.html.attributes"/>
1023 <xsl:call-template name="gentext.template">
1024 <xsl:with-param name="context" select="'termdef'"/>
1025 <xsl:with-param name="name" select="'prefix'"/>
1026 </xsl:call-template>
1027 <xsl:apply-templates/>
1028 <xsl:call-template name="gentext.template">
1029 <xsl:with-param name="context" select="'termdef'"/>
1030 <xsl:with-param name="name" select="'suffix'"/>
1031 </xsl:call-template>
1035 <xsl:template match="sgmltag|tag">
1036 <xsl:call-template name="format.sgmltag"/>
1039 <xsl:template name="format.sgmltag">
1040 <xsl:param name="class">
1042 <xsl:when test="@class">
1043 <xsl:value-of select="@class"/>
1045 <xsl:otherwise>element</xsl:otherwise>
1049 <xsl:variable name="content">
1051 <xsl:when test="$class='attribute'">
1052 <xsl:apply-templates/>
1054 <xsl:when test="$class='attvalue'">
1055 <xsl:apply-templates/>
1057 <xsl:when test="$class='element'">
1058 <xsl:apply-templates/>
1060 <xsl:when test="$class='endtag'">
1061 <xsl:text></</xsl:text>
1062 <xsl:apply-templates/>
1063 <xsl:text>></xsl:text>
1065 <xsl:when test="$class='genentity'">
1066 <xsl:text>&</xsl:text>
1067 <xsl:apply-templates/>
1068 <xsl:text>;</xsl:text>
1070 <xsl:when test="$class='numcharref'">
1071 <xsl:text>&#</xsl:text>
1072 <xsl:apply-templates/>
1073 <xsl:text>;</xsl:text>
1075 <xsl:when test="$class='paramentity'">
1076 <xsl:text>%</xsl:text>
1077 <xsl:apply-templates/>
1078 <xsl:text>;</xsl:text>
1080 <xsl:when test="$class='pi'">
1081 <xsl:text><?</xsl:text>
1082 <xsl:apply-templates/>
1083 <xsl:text>></xsl:text>
1085 <xsl:when test="$class='xmlpi'">
1086 <xsl:text><?</xsl:text>
1087 <xsl:apply-templates/>
1088 <xsl:text>?></xsl:text>
1090 <xsl:when test="$class='starttag'">
1091 <xsl:text><</xsl:text>
1092 <xsl:apply-templates/>
1093 <xsl:text>></xsl:text>
1095 <xsl:when test="$class='emptytag'">
1096 <xsl:text><</xsl:text>
1097 <xsl:apply-templates/>
1098 <xsl:text>/></xsl:text>
1100 <xsl:when test="$class='sgmlcomment' or $class='comment'">
1101 <xsl:text><!--</xsl:text>
1102 <xsl:apply-templates/>
1103 <xsl:text>--></xsl:text>
1106 <xsl:apply-templates/>
1112 <xsl:apply-templates select="." mode="common.html.attributes">
1113 <xsl:with-param name="class" select="concat('sgmltag-', $class)"/>
1114 </xsl:apply-templates>
1115 <xsl:call-template name="simple.xlink">
1116 <xsl:with-param name="content" select="$content"/>
1117 </xsl:call-template>
1121 <xsl:template match="email">
1122 <xsl:call-template name="inline.monoseq">
1123 <xsl:with-param name="content">
1124 <xsl:if test="not($email.delimiters.enabled = 0)">
1125 <xsl:text><</xsl:text>
1128 <xsl:apply-templates select="." mode="common.html.attributes"/>
1129 <xsl:attribute name="href">
1130 <xsl:text>mailto:</xsl:text>
1131 <xsl:value-of select="."/>
1133 <xsl:apply-templates/>
1135 <xsl:if test="not($email.delimiters.enabled = 0)">
1136 <xsl:text>></xsl:text>
1139 </xsl:call-template>
1142 <xsl:template match="keycombo">
1143 <xsl:variable name="action" select="@action"/>
1144 <xsl:variable name="joinchar">
1146 <xsl:when test="$action='seq'"><xsl:text> </xsl:text></xsl:when>
1147 <xsl:when test="$action='simul'">+</xsl:when>
1148 <xsl:when test="$action='press'">-</xsl:when>
1149 <xsl:when test="$action='click'">-</xsl:when>
1150 <xsl:when test="$action='double-click'">-</xsl:when>
1151 <xsl:when test="$action='other'"/>
1152 <xsl:otherwise>+</xsl:otherwise>
1155 <xsl:for-each select="*">
1156 <xsl:if test="position()>1"><xsl:value-of select="$joinchar"/></xsl:if>
1157 <xsl:apply-templates select="."/>
1161 <xsl:template match="uri">
1162 <xsl:call-template name="inline.monoseq"/>
1165 <!-- ==================================================================== -->
1167 <xsl:template match="menuchoice">
1168 <xsl:variable name="shortcut" select="./shortcut"/>
1169 <xsl:call-template name="process.menuchoice"/>
1170 <xsl:if test="$shortcut">
1171 <xsl:text> (</xsl:text>
1172 <xsl:apply-templates select="$shortcut"/>
1173 <xsl:text>)</xsl:text>
1177 <xsl:template name="process.menuchoice">
1178 <xsl:param name="nodelist" select="guibutton|guiicon|guilabel|guimenu|guimenuitem|guisubmenu|interface"/><!-- not(shortcut) -->
1179 <xsl:param name="count" select="1"/>
1182 <xsl:when test="$count>count($nodelist)"/>
1183 <xsl:when test="$count=1">
1184 <xsl:apply-templates select="$nodelist[$count=position()]"/>
1185 <xsl:call-template name="process.menuchoice">
1186 <xsl:with-param name="nodelist" select="$nodelist"/>
1187 <xsl:with-param name="count" select="$count+1"/>
1188 </xsl:call-template>
1191 <xsl:variable name="node" select="$nodelist[$count=position()]"/>
1193 <xsl:when test="local-name($node)='guimenuitem' or local-name($node)='guisubmenu'">
1194 <xsl:value-of select="$menuchoice.menu.separator"/>
1197 <xsl:value-of select="$menuchoice.separator"/>
1200 <xsl:apply-templates select="$node"/>
1201 <xsl:call-template name="process.menuchoice">
1202 <xsl:with-param name="nodelist" select="$nodelist"/>
1203 <xsl:with-param name="count" select="$count+1"/>
1204 </xsl:call-template>
1209 <!-- ==================================================================== -->
1211 <xsl:template match="optional">
1212 <xsl:value-of select="$arg.choice.opt.open.str"/>
1213 <xsl:call-template name="inline.charseq"/>
1214 <xsl:value-of select="$arg.choice.opt.close.str"/>
1217 <xsl:template match="citation">
1218 <!-- todo: integrate with bibliography collection -->
1219 <xsl:variable name="targets" select="(//biblioentry | //bibliomixed)[abbrev = string(current())]"/>
1220 <xsl:variable name="target" select="$targets[1]"/>
1223 <!-- try automatic linking based on match to abbrev -->
1224 <xsl:when test="$target and not(xref) and not(link)">
1226 <xsl:text>[</xsl:text>
1228 <xsl:apply-templates select="." mode="common.html.attributes"/>
1229 <xsl:attribute name="href">
1230 <xsl:call-template name="href.target">
1231 <xsl:with-param name="object" select="$target"/>
1232 </xsl:call-template>
1236 <xsl:when test="$bibliography.numbered != 0">
1237 <xsl:apply-templates select="$target" mode="citation"/>
1240 <xsl:call-template name="inline.charseq"/>
1245 <xsl:text>]</xsl:text>
1248 <xsl:text>[</xsl:text>
1249 <xsl:call-template name="inline.charseq"/>
1250 <xsl:text>]</xsl:text>
1255 <xsl:template match="citebiblioid">
1256 <xsl:variable name="targets" select="//*[biblioid = string(current())]"/>
1257 <xsl:variable name="target" select="$targets[1]"/>
1260 <!-- try automatic linking based on match to parent of biblioid -->
1261 <xsl:when test="$target and not(xref) and not(link)">
1263 <xsl:text>[</xsl:text>
1265 <xsl:apply-templates select="." mode="common.html.attributes"/>
1266 <xsl:attribute name="href">
1267 <xsl:call-template name="href.target">
1268 <xsl:with-param name="object" select="$target"/>
1269 </xsl:call-template>
1272 <xsl:call-template name="inline.charseq"/>
1275 <xsl:text>]</xsl:text>
1278 <xsl:text>[</xsl:text>
1279 <xsl:call-template name="inline.charseq"/>
1280 <xsl:text>]</xsl:text>
1285 <xsl:template match="biblioentry|bibliomixed" mode="citation">
1286 <xsl:number from="bibliography" count="biblioentry|bibliomixed" level="any" format="1"/>
1289 <!-- ==================================================================== -->
1291 <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]|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]">
1292 <xsl:if test="$show.comments != 0">
1293 <p class="remark"><i><xsl:call-template name="inline.charseq"/></i></p>
1297 <xsl:template match="comment|remark">
1298 <xsl:if test="$show.comments != 0">
1299 <em><xsl:call-template name="inline.charseq"/></em>
1303 <!-- ==================================================================== -->
1305 <xsl:template match="productname">
1306 <xsl:call-template name="inline.charseq"/>
1307 <xsl:if test="@class">
1308 <xsl:call-template name="dingbat">
1309 <xsl:with-param name="dingbat" select="@class"/>
1310 </xsl:call-template>
1314 <xsl:template match="productnumber">
1315 <xsl:call-template name="inline.charseq"/>
1318 <!-- ==================================================================== -->
1320 <xsl:template match="pob|street|city|state|postcode|country|otheraddr">
1321 <xsl:call-template name="inline.charseq"/>
1324 <xsl:template match="phone|fax">
1325 <xsl:call-template name="inline.charseq"/>
1328 <!-- in Addresses, for example -->
1329 <xsl:template match="honorific|firstname|surname|lineage|othername">
1330 <xsl:call-template name="inline.charseq"/>
1333 <!-- ==================================================================== -->
1335 <xsl:template match="person">
1336 <xsl:param name="content">
1337 <xsl:call-template name="anchor"/>
1338 <xsl:call-template name="simple.xlink">
1339 <xsl:with-param name="content">
1340 <xsl:apply-templates select="personname"/>
1342 </xsl:call-template>
1343 <xsl:call-template name="apply-annotations"/>
1347 <xsl:apply-templates select="." mode="common.html.attributes"/>
1348 <xsl:copy-of select="$content"/>
1352 <xsl:template match="personname">
1353 <xsl:param name="content">
1354 <xsl:call-template name="anchor"/>
1355 <xsl:call-template name="simple.xlink">
1356 <xsl:with-param name="content">
1357 <xsl:call-template name="person.name"/>
1359 </xsl:call-template>
1360 <xsl:call-template name="apply-annotations"/>
1364 <xsl:apply-templates select="." mode="common.html.attributes"/>
1365 <xsl:copy-of select="$content"/>
1369 <!-- ==================================================================== -->
1371 <xsl:template match="org">
1372 <xsl:param name="content">
1373 <xsl:call-template name="anchor"/>
1374 <xsl:call-template name="simple.xlink">
1375 <xsl:with-param name="content">
1376 <xsl:apply-templates/>
1378 </xsl:call-template>
1379 <xsl:call-template name="apply-annotations"/>
1383 <xsl:apply-templates select="." mode="common.html.attributes"/>
1384 <xsl:copy-of select="$content"/>
1388 <xsl:template match="orgname">
1389 <xsl:param name="content">
1390 <xsl:call-template name="anchor"/>
1391 <xsl:call-template name="simple.xlink">
1392 <xsl:with-param name="content">
1393 <xsl:apply-templates/>
1395 </xsl:call-template>
1396 <xsl:call-template name="apply-annotations"/>
1400 <xsl:apply-templates select="." mode="common.html.attributes"/>
1401 <xsl:copy-of select="$content"/>
1405 <xsl:template match="orgdiv">
1406 <xsl:param name="content">
1407 <xsl:call-template name="anchor"/>
1408 <xsl:call-template name="simple.xlink">
1409 <xsl:with-param name="content">
1410 <xsl:apply-templates/>
1412 </xsl:call-template>
1413 <xsl:call-template name="apply-annotations"/>
1417 <xsl:apply-templates select="." mode="common.html.attributes"/>
1418 <xsl:copy-of select="$content"/>
1422 <xsl:template match="affiliation">
1423 <xsl:param name="content">
1424 <xsl:call-template name="anchor"/>
1425 <xsl:call-template name="simple.xlink">
1426 <xsl:with-param name="content">
1427 <xsl:call-template name="person.name"/>
1429 </xsl:call-template>
1430 <xsl:call-template name="apply-annotations"/>
1434 <xsl:apply-templates select="." mode="common.html.attributes"/>
1435 <xsl:copy-of select="$content"/>
1439 <!-- ==================================================================== -->
1441 <xsl:template match="beginpage">
1442 <!-- does nothing; this *is not* markup to force a page break. -->