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 8811 2010-08-09 20:24:45Z mzjn $
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 <!-- Support for @xlink:show -->
28 <xsl:variable name="target.show">
30 <xsl:when test="$node/@xlink:show = 'new'">_blank</xsl:when>
31 <xsl:when test="$node/@xlink:show = 'replace'">_top</xsl:when>
36 <xsl:variable name="link">
38 <xsl:when test="$xhref and (not($node/@xlink:type) or $node/@xlink:type='simple')">
40 <!-- Is it a local idref or a uri? -->
41 <xsl:variable name="is.idref">
43 <!-- if the href starts with # and does not contain an "(" -->
44 <!-- or if the href starts with #xpointer(id(, it's just an ID -->
45 <xsl:when test="starts-with($xhref,'#') and (not(contains($xhref,'(')) or starts-with($xhref, '#xpointer(id('))">1</xsl:when>
46 <xsl:otherwise>0</xsl:otherwise>
50 <!-- Is it an olink ? -->
51 <xsl:variable name="is.olink">
53 <!-- If xlink:role="http://docbook.org/xlink/role/olink" -->
54 <!-- and if the href contains # -->
55 <xsl:when test="contains($xhref,'#') and @xlink:role = $xolink.role">1</xsl:when>
56 <xsl:otherwise>0</xsl:otherwise>
61 <xsl:when test="$is.olink = 1">
62 <xsl:call-template name="olink">
63 <xsl:with-param name="content" select="$content"/>
67 <xsl:when test="$is.idref = 1">
69 <xsl:variable name="idref">
70 <xsl:call-template name="xpointer.idref">
71 <xsl:with-param name="xpointer" select="$xhref"/>
75 <xsl:variable name="targets" select="key('id',$idref)"/>
76 <xsl:variable name="target" select="$targets[1]"/>
78 <xsl:call-template name="check.id.unique">
79 <xsl:with-param name="linkend" select="$idref"/>
83 <xsl:when test="count($target) = 0">
85 <xsl:text>XLink to nonexistent id: </xsl:text>
86 <xsl:value-of select="$idref"/>
88 <xsl:copy-of select="$content"/>
93 <xsl:apply-templates select="." mode="common.html.attributes"/>
95 <xsl:attribute name="href">
96 <xsl:call-template name="href.target">
97 <xsl:with-param name="object" select="$target"/>
102 <xsl:when test="$node/@xlink:title">
103 <xsl:attribute name="title">
104 <xsl:value-of select="$node/@xlink:title"/>
108 <xsl:apply-templates select="$target" mode="html.title.attribute"/>
112 <xsl:if test="$target.show !=''">
113 <xsl:attribute name="target">
114 <xsl:value-of select="$target.show"/>
118 <xsl:copy-of select="$content"/>
125 <!-- otherwise it's a URI -->
128 <xsl:apply-templates select="." mode="common.html.attributes"/>
129 <xsl:attribute name="href">
130 <xsl:value-of select="$xhref"/>
132 <xsl:if test="$node/@xlink:title">
133 <xsl:attribute name="title">
134 <xsl:value-of select="$node/@xlink:title"/>
138 <!-- For URIs, use @xlink:show if defined, otherwise use ulink.target -->
140 <xsl:when test="$target.show !=''">
141 <xsl:attribute name="target">
142 <xsl:value-of select="$target.show"/>
145 <xsl:when test="$ulink.target !=''">
146 <xsl:attribute name="target">
147 <xsl:value-of select="$ulink.target"/>
152 <xsl:copy-of select="$content"/>
158 <xsl:when test="$linkend">
159 <xsl:variable name="targets" select="key('id',$linkend)"/>
160 <xsl:variable name="target" select="$targets[1]"/>
162 <xsl:call-template name="check.id.unique">
163 <xsl:with-param name="linkend" select="$linkend"/>
167 <xsl:apply-templates select="." mode="common.html.attributes"/>
168 <xsl:attribute name="href">
169 <xsl:call-template name="href.target">
170 <xsl:with-param name="object" select="$target"/>
174 <xsl:apply-templates select="$target" mode="html.title.attribute"/>
176 <xsl:copy-of select="$content"/>
181 <xsl:copy-of select="$content"/>
187 <xsl:when test="function-available('suwl:unwrapLinks')">
188 <xsl:copy-of select="suwl:unwrapLinks($link)"/>
191 <xsl:copy-of select="$link"/>
196 <xsl:template name="inline.charseq">
197 <xsl:param name="content">
198 <xsl:call-template name="anchor"/>
199 <xsl:call-template name="simple.xlink">
200 <xsl:with-param name="content">
201 <xsl:apply-templates/>
205 <!-- * if you want output from the inline.charseq template wrapped in -->
206 <!-- * something other than a Span, call the template with some value -->
207 <!-- * for the 'wrapper-name' param -->
208 <xsl:param name="wrapper-name">span</xsl:param>
209 <xsl:element name="{$wrapper-name}" namespace="http://www.w3.org/1999/xhtml">
210 <xsl:attribute name="class">
211 <xsl:value-of select="local-name(.)"/>
213 <xsl:call-template name="dir"/>
214 <xsl:call-template name="generate.html.title"/>
215 <xsl:copy-of select="$content"/>
216 <xsl:call-template name="apply-annotations"/>
220 <xsl:template name="inline.monoseq">
221 <xsl:param name="content">
222 <xsl:call-template name="anchor"/>
223 <xsl:call-template name="simple.xlink">
224 <xsl:with-param name="content">
225 <xsl:apply-templates/>
230 <xsl:apply-templates select="." mode="common.html.attributes"/>
231 <xsl:copy-of select="$content"/>
232 <xsl:call-template name="apply-annotations"/>
236 <xsl:template name="inline.boldseq">
237 <xsl:param name="content">
238 <xsl:call-template name="anchor"/>
239 <xsl:call-template name="simple.xlink">
240 <xsl:with-param name="content">
241 <xsl:apply-templates/>
247 <xsl:apply-templates select="." mode="common.html.attributes"/>
249 <!-- don't put <strong> inside figure, example, or table titles -->
251 <xsl:when test="local-name(..) = 'title' and (local-name(../..) = 'figure' or local-name(../..) = 'example' or local-name(../..) = 'table')">
252 <xsl:copy-of select="$content"/>
256 <xsl:copy-of select="$content"/>
260 <xsl:call-template name="apply-annotations"/>
264 <xsl:template name="inline.italicseq">
265 <xsl:param name="content">
266 <xsl:call-template name="anchor"/>
267 <xsl:call-template name="simple.xlink">
268 <xsl:with-param name="content">
269 <xsl:apply-templates/>
274 <xsl:call-template name="common.html.attributes"/>
275 <xsl:copy-of select="$content"/>
276 <xsl:call-template name="apply-annotations"/>
280 <xsl:template name="inline.boldmonoseq">
281 <xsl:param name="content">
282 <xsl:call-template name="anchor"/>
283 <xsl:call-template name="simple.xlink">
284 <xsl:with-param name="content">
285 <xsl:apply-templates/>
289 <!-- don't put <strong> inside figure, example, or table titles -->
290 <!-- or other titles that may already be represented with <strong>'s. -->
292 <xsl:when test="local-name(..) = 'title' and (local-name(../..) = 'figure' or local-name(../..) = 'example' or local-name(../..) = 'table' or local-name(../..) = 'formalpara')">
294 <xsl:call-template name="common.html.attributes"/>
295 <xsl:copy-of select="$content"/>
296 <xsl:call-template name="apply-annotations"/>
301 <xsl:call-template name="common.html.attributes"/>
303 <xsl:call-template name="generate.html.title"/>
304 <xsl:call-template name="dir"/>
305 <xsl:copy-of select="$content"/>
307 <xsl:call-template name="apply-annotations"/>
313 <xsl:template name="inline.italicmonoseq">
314 <xsl:param name="content">
315 <xsl:call-template name="anchor"/>
316 <xsl:call-template name="simple.xlink">
317 <xsl:with-param name="content">
318 <xsl:apply-templates/>
323 <xsl:call-template name="common.html.attributes"/>
325 <xsl:call-template name="generate.html.title"/>
326 <xsl:call-template name="dir"/>
327 <xsl:copy-of select="$content"/>
328 <xsl:call-template name="apply-annotations"/>
333 <xsl:template name="inline.superscriptseq">
334 <xsl:param name="content">
335 <xsl:call-template name="anchor"/>
336 <xsl:call-template name="simple.xlink">
337 <xsl:with-param name="content">
338 <xsl:apply-templates/>
343 <xsl:call-template name="generate.html.title"/>
344 <xsl:call-template name="dir"/>
345 <xsl:copy-of select="$content"/>
346 <xsl:call-template name="apply-annotations"/>
350 <xsl:template name="inline.subscriptseq">
351 <xsl:param name="content">
352 <xsl:call-template name="anchor"/>
353 <xsl:call-template name="simple.xlink">
354 <xsl:with-param name="content">
355 <xsl:apply-templates/>
360 <xsl:call-template name="generate.html.title"/>
361 <xsl:call-template name="dir"/>
362 <xsl:copy-of select="$content"/>
363 <xsl:call-template name="apply-annotations"/>
367 <!-- ==================================================================== -->
368 <!-- some special cases -->
370 <xsl:template match="author">
371 <xsl:param name="content">
372 <xsl:call-template name="anchor"/>
373 <xsl:call-template name="simple.xlink">
374 <xsl:with-param name="content">
375 <xsl:call-template name="person.name"/>
378 <xsl:call-template name="apply-annotations"/>
382 <xsl:call-template name="common.html.attributes"/>
383 <xsl:copy-of select="$content"/>
387 <xsl:template match="editor">
388 <xsl:param name="content">
389 <xsl:call-template name="anchor"/>
390 <xsl:call-template name="simple.xlink">
391 <xsl:with-param name="content">
392 <xsl:call-template name="person.name"/>
395 <xsl:call-template name="apply-annotations"/>
399 <xsl:call-template name="common.html.attributes"/>
400 <xsl:copy-of select="$content"/>
404 <xsl:template match="othercredit">
405 <xsl:param name="content">
406 <xsl:call-template name="anchor"/>
407 <xsl:call-template name="simple.xlink">
408 <xsl:with-param name="content">
409 <xsl:call-template name="person.name"/>
412 <xsl:call-template name="apply-annotations"/>
416 <xsl:call-template name="common.html.attributes"/>
417 <xsl:copy-of select="$content"/>
421 <xsl:template match="authorinitials">
422 <xsl:call-template name="inline.charseq"/>
425 <!-- ==================================================================== -->
427 <xsl:template match="accel">
428 <xsl:call-template name="inline.charseq"/>
431 <xsl:template match="action">
432 <xsl:call-template name="inline.charseq"/>
435 <xsl:template match="application">
436 <xsl:call-template name="inline.charseq"/>
439 <xsl:template match="classname">
440 <xsl:call-template name="inline.monoseq"/>
443 <xsl:template match="exceptionname">
444 <xsl:call-template name="inline.monoseq"/>
447 <xsl:template match="interfacename">
448 <xsl:call-template name="inline.monoseq"/>
451 <xsl:template match="methodname">
452 <xsl:call-template name="inline.monoseq"/>
455 <xsl:template match="command">
456 <xsl:call-template name="inline.boldseq"/>
459 <xsl:template match="computeroutput">
460 <xsl:call-template name="inline.monoseq"/>
463 <xsl:template match="constant">
464 <xsl:call-template name="inline.monoseq"/>
467 <xsl:template match="database">
468 <xsl:call-template name="inline.charseq"/>
471 <xsl:template match="date">
472 <!-- should this support locale-specific formatting? how? -->
473 <xsl:call-template name="inline.charseq"/>
476 <xsl:template match="errorcode">
477 <xsl:call-template name="inline.charseq"/>
480 <xsl:template match="errorname">
481 <xsl:call-template name="inline.charseq"/>
484 <xsl:template match="errortype">
485 <xsl:call-template name="inline.charseq"/>
488 <xsl:template match="errortext">
489 <xsl:call-template name="inline.charseq"/>
492 <xsl:template match="envar">
493 <xsl:call-template name="inline.monoseq"/>
496 <xsl:template match="filename">
497 <xsl:call-template name="inline.monoseq"/>
500 <xsl:template match="function">
502 <xsl:when test="$function.parens != '0' and (parameter or function or replaceable)">
503 <xsl:variable name="nodes" select="text()|*"/>
504 <xsl:call-template name="inline.monoseq">
505 <xsl:with-param name="content">
506 <xsl:call-template name="simple.xlink">
507 <xsl:with-param name="content">
508 <xsl:apply-templates select="$nodes[1]"/>
513 <xsl:text>(</xsl:text>
514 <xsl:apply-templates select="$nodes[position()>1]"/>
515 <xsl:text>)</xsl:text>
518 <xsl:call-template name="inline.monoseq"/>
523 <xsl:template match="function/parameter" priority="2">
524 <xsl:call-template name="inline.italicmonoseq"/>
525 <xsl:if test="following-sibling::*">
526 <xsl:text>, </xsl:text>
530 <xsl:template match="function/replaceable" priority="2">
531 <xsl:call-template name="inline.italicmonoseq"/>
532 <xsl:if test="following-sibling::*">
533 <xsl:text>, </xsl:text>
537 <xsl:template match="guibutton">
538 <xsl:call-template name="inline.charseq"/>
541 <xsl:template match="guiicon">
542 <xsl:call-template name="inline.charseq"/>
545 <xsl:template match="guilabel">
546 <xsl:call-template name="inline.charseq"/>
549 <xsl:template match="guimenu">
550 <xsl:call-template name="inline.charseq"/>
553 <xsl:template match="guimenuitem">
554 <xsl:call-template name="inline.charseq"/>
557 <xsl:template match="guisubmenu">
558 <xsl:call-template name="inline.charseq"/>
561 <xsl:template match="hardware">
562 <xsl:call-template name="inline.charseq"/>
565 <xsl:template match="interface">
566 <xsl:call-template name="inline.charseq"/>
569 <xsl:template match="interfacedefinition">
570 <xsl:call-template name="inline.charseq"/>
573 <xsl:template match="keycap">
574 <xsl:call-template name="inline.boldseq"/>
577 <xsl:template match="keycode">
578 <xsl:call-template name="inline.charseq"/>
581 <xsl:template match="keysym">
582 <xsl:call-template name="inline.charseq"/>
585 <xsl:template match="literal">
586 <xsl:call-template name="inline.monoseq"/>
589 <xsl:template match="code">
590 <xsl:call-template name="inline.monoseq"/>
593 <xsl:template match="medialabel">
594 <xsl:call-template name="inline.italicseq"/>
597 <xsl:template match="shortcut">
598 <xsl:call-template name="inline.boldseq"/>
601 <xsl:template match="mousebutton">
602 <xsl:call-template name="inline.charseq"/>
605 <xsl:template match="option">
606 <xsl:call-template name="inline.monoseq"/>
609 <xsl:template match="package">
610 <xsl:call-template name="inline.charseq"/>
613 <xsl:template match="parameter">
614 <xsl:call-template name="inline.italicmonoseq"/>
617 <xsl:template match="property">
618 <xsl:call-template name="inline.charseq"/>
621 <xsl:template match="prompt">
622 <xsl:call-template name="inline.monoseq"/>
625 <xsl:template match="replaceable" priority="1">
626 <xsl:call-template name="inline.italicmonoseq"/>
629 <xsl:template match="returnvalue">
630 <xsl:call-template name="inline.charseq"/>
633 <xsl:template match="structfield">
634 <xsl:call-template name="inline.italicmonoseq"/>
637 <xsl:template match="structname">
638 <xsl:call-template name="inline.charseq"/>
641 <xsl:template match="symbol">
642 <xsl:call-template name="inline.charseq"/>
645 <xsl:template match="systemitem">
646 <xsl:call-template name="inline.monoseq"/>
649 <xsl:template match="token">
650 <xsl:call-template name="inline.charseq"/>
653 <xsl:template match="type">
654 <xsl:call-template name="inline.charseq"/>
657 <xsl:template match="userinput">
658 <xsl:call-template name="inline.boldmonoseq"/>
661 <xsl:template match="abbrev">
662 <xsl:call-template name="inline.charseq">
663 <xsl:with-param name="wrapper-name">abbr</xsl:with-param>
667 <xsl:template match="acronym">
668 <xsl:call-template name="inline.charseq">
669 <xsl:with-param name="wrapper-name">acronym</xsl:with-param>
673 <xsl:template match="citerefentry">
675 <xsl:when test="$citerefentry.link != '0'">
677 <xsl:apply-templates select="." mode="common.html.attributes"/>
678 <xsl:attribute name="href">
679 <xsl:call-template name="generate.citerefentry.link"/>
681 <xsl:call-template name="inline.charseq"/>
685 <xsl:call-template name="inline.charseq"/>
690 <xsl:template name="generate.citerefentry.link">
694 <xsl:template name="x.generate.citerefentry.link">
695 <xsl:text>http://example.com/cgi-bin/man.cgi?</xsl:text>
696 <xsl:value-of select="refentrytitle"/>
697 <xsl:text>(</xsl:text>
698 <xsl:value-of select="manvolnum"/>
699 <xsl:text>)</xsl:text>
702 <xsl:template match="citetitle">
704 <xsl:when test="@pubwork = 'article'">
705 <xsl:call-template name="gentext.startquote"/>
706 <xsl:call-template name="inline.charseq"/>
707 <xsl:call-template name="gentext.endquote"/>
710 <xsl:call-template name="inline.italicseq"/>
715 <xsl:template match="emphasis">
718 <!-- We don't want empty @class values, so do not propagate empty @roles -->
719 <xsl:when test="@role and normalize-space(@role) != '' and $emphasis.propagates.style != 0">
720 <xsl:apply-templates select="." mode="common.html.attributes">
721 <xsl:with-param name="class" select="@role"/>
722 </xsl:apply-templates>
725 <xsl:apply-templates select="." mode="common.html.attributes"/>
728 <xsl:call-template name="anchor"/>
730 <xsl:call-template name="simple.xlink">
731 <xsl:with-param name="content">
733 <xsl:when test="@role = 'bold' or @role='strong'">
734 <!-- backwards compatibility: make bold into b elements, but -->
735 <!-- don't put bold inside figure, example, or table titles -->
737 <xsl:when test="local-name(..) = 'title' and (local-name(../..) = 'figure' or local-name(../..) = 'example' or local-name(../..) = 'table')">
738 <xsl:apply-templates/>
741 <strong><xsl:apply-templates/></strong>
745 <xsl:when test="@role and $emphasis.propagates.style != 0">
746 <xsl:apply-templates/>
749 <em><xsl:apply-templates/></em>
757 <xsl:template match="foreignphrase">
759 <xsl:apply-templates select="." mode="common.html.attributes"/>
760 <xsl:call-template name="inline.italicseq"/>
764 <xsl:template match="markup">
765 <xsl:call-template name="inline.charseq"/>
768 <xsl:template match="phrase">
770 <xsl:call-template name="locale.html.attributes"/>
771 <!-- We don't want empty @class values, so do not propagate empty @roles -->
772 <xsl:if test="@role and normalize-space(@role) != '' and $phrase.propagates.style != 0">
773 <xsl:apply-templates select="." mode="class.attribute">
774 <xsl:with-param name="class" select="@role"/>
775 </xsl:apply-templates>
777 <xsl:call-template name="dir"/>
778 <xsl:call-template name="anchor"/>
779 <xsl:call-template name="simple.xlink">
780 <xsl:with-param name="content">
781 <xsl:apply-templates/>
784 <xsl:call-template name="apply-annotations"/>
788 <xsl:template match="quote">
789 <xsl:variable name="depth">
790 <xsl:call-template name="dot.count">
791 <xsl:with-param name="string">
792 <xsl:number level="multiple"/>
797 <xsl:apply-templates select="." mode="common.html.attributes"/>
798 <xsl:call-template name="anchor"/>
800 <xsl:when test="$depth mod 2 = 0">
801 <xsl:call-template name="gentext.startquote"/>
802 <xsl:call-template name="inline.charseq"/>
803 <xsl:call-template name="gentext.endquote"/>
806 <xsl:call-template name="gentext.nestedstartquote"/>
807 <xsl:call-template name="inline.charseq"/>
808 <xsl:call-template name="gentext.nestedendquote"/>
814 <xsl:template match="varname">
815 <xsl:call-template name="inline.monoseq"/>
818 <xsl:template match="wordasword">
819 <xsl:call-template name="inline.italicseq"/>
822 <xsl:template match="lineannotation">
824 <xsl:apply-templates select="." mode="common.html.attributes"/>
825 <xsl:call-template name="inline.charseq"/>
829 <xsl:template match="superscript">
830 <xsl:call-template name="inline.superscriptseq"/>
833 <xsl:template match="subscript">
834 <xsl:call-template name="inline.subscriptseq"/>
837 <xsl:template match="trademark">
838 <xsl:call-template name="inline.charseq"/>
840 <xsl:when test="@class = 'copyright' or @class = 'registered'">
841 <xsl:call-template name="dingbat">
842 <xsl:with-param name="dingbat" select="@class"/>
845 <xsl:when test="@class = 'service'">
849 <xsl:call-template name="dingbat">
850 <xsl:with-param name="dingbat" select="'trademark'"/>
856 <xsl:template match="firstterm">
857 <xsl:call-template name="glossterm">
858 <xsl:with-param name="firstterm" select="1"/>
862 <xsl:template match="glossterm" name="glossterm">
863 <xsl:param name="firstterm" select="0"/>
865 <!-- To avoid extra <a name=""> anchor from inline.italicseq -->
866 <xsl:variable name="content">
867 <xsl:apply-templates/>
871 <xsl:when test="($firstterm.only.link = 0 or $firstterm = 1) and @linkend">
872 <xsl:variable name="targets" select="key('id',@linkend)"/>
873 <xsl:variable name="target" select="$targets[1]"/>
875 <xsl:call-template name="check.id.unique">
876 <xsl:with-param name="linkend" select="@linkend"/>
880 <xsl:when test="$target">
882 <xsl:apply-templates select="." mode="common.html.attributes"/>
883 <xsl:if test="@id or @xml:id">
884 <xsl:attribute name="id">
885 <xsl:value-of select="(@id|@xml:id)[1]"/>
889 <xsl:attribute name="href">
890 <xsl:call-template name="href.target">
891 <xsl:with-param name="object" select="$target"/>
895 <xsl:call-template name="inline.italicseq">
896 <xsl:with-param name="content" select="$content"/>
901 <xsl:call-template name="inline.italicseq">
902 <xsl:with-param name="content" select="$content"/>
908 <xsl:when test="not(@linkend) and ($firstterm.only.link = 0 or $firstterm = 1) and ($glossterm.auto.link != 0) and $glossary.collection != ''">
909 <xsl:variable name="term">
911 <xsl:when test="@baseform"><xsl:value-of select="@baseform"/></xsl:when>
912 <xsl:otherwise><xsl:value-of select="."/></xsl:otherwise>
916 <xsl:variable name="cterm" select="(document($glossary.collection,.)//glossentry[glossterm=$term])[1]"/>
918 <!-- HACK HACK HACK! But it works... -->
919 <!-- You'd need to do more work if you wanted to chunk on glossdiv, though -->
921 <xsl:variable name="glossary" select="//glossary[@role='auto']"/>
923 <xsl:if test="count($glossary) != 1">
925 <xsl:text>Warning: glossary.collection specified, but there are </xsl:text>
926 <xsl:value-of select="count($glossary)"/>
927 <xsl:text> automatic glossaries</xsl:text>
931 <xsl:variable name="glosschunk">
932 <xsl:call-template name="href.target">
933 <xsl:with-param name="object" select="$glossary"/>
937 <xsl:variable name="chunkbase">
939 <xsl:when test="contains($glosschunk, '#')">
940 <xsl:value-of select="substring-before($glosschunk, '#')"/>
943 <xsl:value-of select="$glosschunk"/>
949 <xsl:when test="not($cterm)">
951 <xsl:text>There's no entry for </xsl:text>
952 <xsl:value-of select="$term"/>
953 <xsl:text> in </xsl:text>
954 <xsl:value-of select="$glossary.collection"/>
956 <xsl:call-template name="inline.italicseq"/>
959 <xsl:variable name="id">
960 <xsl:call-template name="object.id">
961 <xsl:with-param name="object" select="$cterm"/>
964 <a href="{$chunkbase}#{$id}">
965 <xsl:apply-templates select="." mode="common.html.attributes"/>
966 <xsl:call-template name="inline.italicseq">
967 <xsl:with-param name="content" select="$content"/>
974 <xsl:when test="not(@linkend) and ($firstterm.only.link = 0 or $firstterm = 1) and $glossterm.auto.link != 0">
975 <xsl:variable name="term">
977 <xsl:when test="@baseform">
978 <xsl:value-of select="normalize-space(@baseform)"/>
981 <xsl:value-of select="normalize-space(.)"/>
985 <xsl:variable name="targets" select="key('glossentries', $term)"/>
986 <xsl:variable name="target" select="$targets[1]"/>
989 <xsl:when test="count($targets)=0">
991 <xsl:text>Error: no glossentry for glossterm: </xsl:text>
992 <xsl:value-of select="."/>
993 <xsl:text>.</xsl:text>
995 <xsl:call-template name="inline.italicseq"/>
999 <xsl:apply-templates select="." mode="common.html.attributes"/>
1000 <xsl:if test="@id or @xml:id">
1001 <xsl:attribute name="id">
1002 <xsl:value-of select="(@id|@xml:id)[1]"/>
1006 <xsl:attribute name="href">
1007 <xsl:call-template name="href.target">
1008 <xsl:with-param name="object" select="$target"/>
1009 </xsl:call-template>
1012 <xsl:call-template name="inline.italicseq">
1013 <xsl:with-param name="content" select="$content"/>
1014 </xsl:call-template>
1021 <xsl:call-template name="inline.italicseq"/>
1026 <xsl:template match="termdef">
1028 <xsl:apply-templates select="." mode="common.html.attributes"/>
1029 <xsl:call-template name="gentext.template">
1030 <xsl:with-param name="context" select="'termdef'"/>
1031 <xsl:with-param name="name" select="'prefix'"/>
1032 </xsl:call-template>
1033 <xsl:apply-templates/>
1034 <xsl:call-template name="gentext.template">
1035 <xsl:with-param name="context" select="'termdef'"/>
1036 <xsl:with-param name="name" select="'suffix'"/>
1037 </xsl:call-template>
1041 <xsl:template match="sgmltag|tag">
1042 <xsl:call-template name="format.sgmltag"/>
1045 <xsl:template name="format.sgmltag">
1046 <xsl:param name="class">
1048 <xsl:when test="@class">
1049 <xsl:value-of select="@class"/>
1051 <xsl:otherwise>element</xsl:otherwise>
1055 <xsl:variable name="content">
1057 <xsl:when test="$class='attribute'">
1058 <xsl:apply-templates/>
1060 <xsl:when test="$class='attvalue'">
1061 <xsl:apply-templates/>
1063 <xsl:when test="$class='element'">
1064 <xsl:apply-templates/>
1066 <xsl:when test="$class='endtag'">
1067 <xsl:text></</xsl:text>
1068 <xsl:apply-templates/>
1069 <xsl:text>></xsl:text>
1071 <xsl:when test="$class='genentity'">
1072 <xsl:text>&</xsl:text>
1073 <xsl:apply-templates/>
1074 <xsl:text>;</xsl:text>
1076 <xsl:when test="$class='numcharref'">
1077 <xsl:text>&#</xsl:text>
1078 <xsl:apply-templates/>
1079 <xsl:text>;</xsl:text>
1081 <xsl:when test="$class='paramentity'">
1082 <xsl:text>%</xsl:text>
1083 <xsl:apply-templates/>
1084 <xsl:text>;</xsl:text>
1086 <xsl:when test="$class='pi'">
1087 <xsl:text><?</xsl:text>
1088 <xsl:apply-templates/>
1089 <xsl:text>></xsl:text>
1091 <xsl:when test="$class='xmlpi'">
1092 <xsl:text><?</xsl:text>
1093 <xsl:apply-templates/>
1094 <xsl:text>?></xsl:text>
1096 <xsl:when test="$class='starttag'">
1097 <xsl:text><</xsl:text>
1098 <xsl:apply-templates/>
1099 <xsl:text>></xsl:text>
1101 <xsl:when test="$class='emptytag'">
1102 <xsl:text><</xsl:text>
1103 <xsl:apply-templates/>
1104 <xsl:text>/></xsl:text>
1106 <xsl:when test="$class='sgmlcomment' or $class='comment'">
1107 <xsl:text><!--</xsl:text>
1108 <xsl:apply-templates/>
1109 <xsl:text>--></xsl:text>
1112 <xsl:apply-templates/>
1118 <xsl:apply-templates select="." mode="common.html.attributes">
1119 <xsl:with-param name="class" select="concat('sgmltag-', $class)"/>
1120 </xsl:apply-templates>
1121 <xsl:call-template name="simple.xlink">
1122 <xsl:with-param name="content" select="$content"/>
1123 </xsl:call-template>
1127 <xsl:template match="email">
1128 <xsl:call-template name="inline.monoseq">
1129 <xsl:with-param name="content">
1130 <xsl:if test="not($email.delimiters.enabled = 0)">
1131 <xsl:text><</xsl:text>
1134 <xsl:apply-templates select="." mode="common.html.attributes"/>
1135 <xsl:attribute name="href">
1136 <xsl:text>mailto:</xsl:text>
1137 <xsl:value-of select="."/>
1139 <xsl:apply-templates/>
1141 <xsl:if test="not($email.delimiters.enabled = 0)">
1142 <xsl:text>></xsl:text>
1145 </xsl:call-template>
1148 <xsl:template match="keycombo">
1149 <xsl:variable name="action" select="@action"/>
1150 <xsl:variable name="joinchar">
1152 <xsl:when test="$action='seq'"><xsl:text> </xsl:text></xsl:when>
1153 <xsl:when test="$action='simul'">+</xsl:when>
1154 <xsl:when test="$action='press'">-</xsl:when>
1155 <xsl:when test="$action='click'">-</xsl:when>
1156 <xsl:when test="$action='double-click'">-</xsl:when>
1157 <xsl:when test="$action='other'"/>
1158 <xsl:otherwise>+</xsl:otherwise>
1161 <xsl:for-each select="*">
1162 <xsl:if test="position()>1"><xsl:value-of select="$joinchar"/></xsl:if>
1163 <xsl:apply-templates select="."/>
1167 <xsl:template match="uri">
1168 <xsl:call-template name="inline.monoseq"/>
1171 <!-- ==================================================================== -->
1173 <xsl:template match="menuchoice">
1174 <xsl:variable name="shortcut" select="./shortcut"/>
1175 <xsl:call-template name="process.menuchoice"/>
1176 <xsl:if test="$shortcut">
1177 <xsl:text> (</xsl:text>
1178 <xsl:apply-templates select="$shortcut"/>
1179 <xsl:text>)</xsl:text>
1183 <xsl:template name="process.menuchoice">
1184 <xsl:param name="nodelist" select="guibutton|guiicon|guilabel|guimenu|guimenuitem|guisubmenu|interface"/><!-- not(shortcut) -->
1185 <xsl:param name="count" select="1"/>
1188 <xsl:when test="$count>count($nodelist)"/>
1189 <xsl:when test="$count=1">
1190 <xsl:apply-templates select="$nodelist[$count=position()]"/>
1191 <xsl:call-template name="process.menuchoice">
1192 <xsl:with-param name="nodelist" select="$nodelist"/>
1193 <xsl:with-param name="count" select="$count+1"/>
1194 </xsl:call-template>
1197 <xsl:variable name="node" select="$nodelist[$count=position()]"/>
1199 <xsl:when test="local-name($node)='guimenuitem' or local-name($node)='guisubmenu'">
1200 <xsl:value-of select="$menuchoice.menu.separator"/>
1203 <xsl:value-of select="$menuchoice.separator"/>
1206 <xsl:apply-templates select="$node"/>
1207 <xsl:call-template name="process.menuchoice">
1208 <xsl:with-param name="nodelist" select="$nodelist"/>
1209 <xsl:with-param name="count" select="$count+1"/>
1210 </xsl:call-template>
1215 <!-- ==================================================================== -->
1217 <xsl:template match="optional">
1218 <xsl:value-of select="$arg.choice.opt.open.str"/>
1219 <xsl:call-template name="inline.charseq"/>
1220 <xsl:value-of select="$arg.choice.opt.close.str"/>
1223 <xsl:template match="citation">
1224 <!-- todo: integrate with bibliography collection -->
1225 <xsl:variable name="targets" select="(//biblioentry | //bibliomixed)[abbrev = string(current())]"/>
1226 <xsl:variable name="target" select="$targets[1]"/>
1229 <!-- try automatic linking based on match to abbrev -->
1230 <xsl:when test="$target and not(xref) and not(link)">
1232 <xsl:text>[</xsl:text>
1234 <xsl:apply-templates select="." mode="common.html.attributes"/>
1235 <xsl:attribute name="href">
1236 <xsl:call-template name="href.target">
1237 <xsl:with-param name="object" select="$target"/>
1238 </xsl:call-template>
1242 <xsl:when test="$bibliography.numbered != 0">
1243 <xsl:apply-templates select="$target" mode="citation"/>
1246 <xsl:call-template name="inline.charseq"/>
1251 <xsl:text>]</xsl:text>
1254 <xsl:text>[</xsl:text>
1255 <xsl:call-template name="inline.charseq"/>
1256 <xsl:text>]</xsl:text>
1261 <xsl:template match="citebiblioid">
1262 <xsl:variable name="targets" select="//*[biblioid = string(current())]"/>
1263 <xsl:variable name="target" select="$targets[1]"/>
1266 <!-- try automatic linking based on match to parent of biblioid -->
1267 <xsl:when test="$target and not(xref) and not(link)">
1269 <xsl:text>[</xsl:text>
1271 <xsl:apply-templates select="." mode="common.html.attributes"/>
1272 <xsl:attribute name="href">
1273 <xsl:call-template name="href.target">
1274 <xsl:with-param name="object" select="$target"/>
1275 </xsl:call-template>
1278 <xsl:call-template name="inline.charseq"/>
1281 <xsl:text>]</xsl:text>
1284 <xsl:text>[</xsl:text>
1285 <xsl:call-template name="inline.charseq"/>
1286 <xsl:text>]</xsl:text>
1291 <xsl:template match="biblioentry|bibliomixed" mode="citation">
1292 <xsl:number from="bibliography" count="biblioentry|bibliomixed" level="any" format="1"/>
1295 <!-- ==================================================================== -->
1297 <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]">
1298 <xsl:if test="$show.comments != 0">
1299 <p class="remark"><em><xsl:call-template name="inline.charseq"/></em></p>
1303 <xsl:template match="comment|remark">
1304 <xsl:if test="$show.comments != 0">
1305 <em><xsl:call-template name="inline.charseq"/></em>
1309 <!-- ==================================================================== -->
1311 <xsl:template match="productname">
1312 <xsl:call-template name="inline.charseq"/>
1313 <xsl:if test="@class">
1314 <xsl:call-template name="dingbat">
1315 <xsl:with-param name="dingbat" select="@class"/>
1316 </xsl:call-template>
1320 <xsl:template match="productnumber">
1321 <xsl:call-template name="inline.charseq"/>
1324 <!-- ==================================================================== -->
1326 <xsl:template match="pob|street|city|state|postcode|country|otheraddr">
1327 <xsl:call-template name="inline.charseq"/>
1330 <xsl:template match="phone|fax">
1331 <xsl:call-template name="inline.charseq"/>
1334 <!-- in Addresses, for example -->
1335 <xsl:template match="honorific|firstname|surname|lineage|othername">
1336 <xsl:call-template name="inline.charseq"/>
1339 <!-- ==================================================================== -->
1341 <xsl:template match="person">
1342 <xsl:param name="content">
1343 <xsl:call-template name="anchor"/>
1344 <xsl:call-template name="simple.xlink">
1345 <xsl:with-param name="content">
1346 <xsl:apply-templates select="personname"/>
1348 </xsl:call-template>
1349 <xsl:call-template name="apply-annotations"/>
1353 <xsl:apply-templates select="." mode="common.html.attributes"/>
1354 <xsl:copy-of select="$content"/>
1358 <xsl:template match="personname">
1359 <xsl:param name="content">
1360 <xsl:call-template name="anchor"/>
1361 <xsl:call-template name="simple.xlink">
1362 <xsl:with-param name="content">
1363 <xsl:call-template name="person.name"/>
1365 </xsl:call-template>
1366 <xsl:call-template name="apply-annotations"/>
1370 <xsl:apply-templates select="." mode="common.html.attributes"/>
1371 <xsl:copy-of select="$content"/>
1375 <!-- ==================================================================== -->
1377 <xsl:template match="org">
1378 <xsl:param name="content">
1379 <xsl:call-template name="anchor"/>
1380 <xsl:call-template name="simple.xlink">
1381 <xsl:with-param name="content">
1382 <xsl:apply-templates/>
1384 </xsl:call-template>
1385 <xsl:call-template name="apply-annotations"/>
1389 <xsl:apply-templates select="." mode="common.html.attributes"/>
1390 <xsl:copy-of select="$content"/>
1394 <xsl:template match="orgname">
1395 <xsl:param name="content">
1396 <xsl:call-template name="anchor"/>
1397 <xsl:call-template name="simple.xlink">
1398 <xsl:with-param name="content">
1399 <xsl:apply-templates/>
1401 </xsl:call-template>
1402 <xsl:call-template name="apply-annotations"/>
1406 <xsl:apply-templates select="." mode="common.html.attributes"/>
1407 <xsl:copy-of select="$content"/>
1411 <xsl:template match="orgdiv">
1412 <xsl:param name="content">
1413 <xsl:call-template name="anchor"/>
1414 <xsl:call-template name="simple.xlink">
1415 <xsl:with-param name="content">
1416 <xsl:apply-templates/>
1418 </xsl:call-template>
1419 <xsl:call-template name="apply-annotations"/>
1423 <xsl:apply-templates select="." mode="common.html.attributes"/>
1424 <xsl:copy-of select="$content"/>
1428 <xsl:template match="affiliation">
1429 <xsl:param name="content">
1430 <xsl:call-template name="anchor"/>
1431 <xsl:call-template name="simple.xlink">
1432 <xsl:with-param name="content">
1433 <xsl:call-template name="person.name"/>
1435 </xsl:call-template>
1436 <xsl:call-template name="apply-annotations"/>
1440 <xsl:apply-templates select="." mode="common.html.attributes"/>
1441 <xsl:copy-of select="$content"/>
1445 <!-- ==================================================================== -->
1447 <xsl:template match="beginpage">
1448 <!-- does nothing; this *is not* markup to force a page break. -->