2 <!DOCTYPE xsl:stylesheet [
3 <!ENTITY % common.entities SYSTEM "../common/entities.ent">
6 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
7 xmlns:xlink='http://www.w3.org/1999/xlink'
8 xmlns:suwl="http://nwalsh.com/xslt/ext/com.nwalsh.saxon.UnwrapLinks"
9 exclude-result-prefixes="xlink suwl"
12 <!-- ********************************************************************
13 $Id: inline.xsl 8421 2009-05-04 07:49:49Z bobstayton $
14 ********************************************************************
16 This file is part of the XSL DocBook Stylesheet distribution.
17 See ../README or http://docbook.sf.net/release/xsl/current/ for
18 copyright and other information.
20 ******************************************************************** -->
21 <xsl:template name="simple.xlink">
22 <xsl:param name="node" select="."/>
23 <xsl:param name="content">
24 <xsl:apply-templates/>
26 <xsl:param name="linkend" select="$node/@linkend"/>
27 <xsl:param name="xhref" select="$node/@xlink:href"/>
29 <!-- Support for @xlink:show -->
30 <xsl:variable name="target.show">
32 <xsl:when test="$node/@xlink:show = 'new'">_blank</xsl:when>
33 <xsl:when test="$node/@xlink:show = 'replace'">_top</xsl:when>
34 <xsl:otherwise></xsl:otherwise>
38 <xsl:variable name="link">
40 <xsl:when test="$xhref and
41 (not($node/@xlink:type) or
42 $node/@xlink:type='simple')">
44 <!-- Is it a local idref or a uri? -->
45 <xsl:variable name="is.idref">
47 <!-- if the href starts with # and does not contain an "(" -->
48 <!-- or if the href starts with #xpointer(id(, it's just an ID -->
49 <xsl:when test="starts-with($xhref,'#')
50 and (not(contains($xhref,'('))
51 or starts-with($xhref,
52 '#xpointer(id('))">1</xsl:when>
53 <xsl:otherwise>0</xsl:otherwise>
57 <!-- Is it an olink ? -->
58 <xsl:variable name="is.olink">
60 <!-- If xlink:role="http://docbook.org/xlink/role/olink" -->
61 <!-- and if the href contains # -->
62 <xsl:when test="contains($xhref,'#') and
63 @xlink:role = $xolink.role">1</xsl:when>
64 <xsl:otherwise>0</xsl:otherwise>
69 <xsl:when test="$is.olink = 1">
70 <xsl:call-template name="olink">
71 <xsl:with-param name="content" select="$content"/>
75 <xsl:when test="$is.idref = 1">
77 <xsl:variable name="idref">
78 <xsl:call-template name="xpointer.idref">
79 <xsl:with-param name="xpointer" select="$xhref"/>
83 <xsl:variable name="targets" select="key('id',$idref)"/>
84 <xsl:variable name="target" select="$targets[1]"/>
86 <xsl:call-template name="check.id.unique">
87 <xsl:with-param name="linkend" select="$idref"/>
91 <xsl:when test="count($target) = 0">
93 <xsl:text>XLink to nonexistent id: </xsl:text>
94 <xsl:value-of select="$idref"/>
96 <xsl:copy-of select="$content"/>
101 <xsl:apply-templates select="." mode="common.html.attributes"/>
103 <xsl:attribute name="href">
104 <xsl:call-template name="href.target">
105 <xsl:with-param name="object" select="$target"/>
110 <xsl:when test="$node/@xlink:title">
111 <xsl:attribute name="title">
112 <xsl:value-of select="$node/@xlink:title"/>
116 <xsl:apply-templates select="$target"
117 mode="html.title.attribute"/>
121 <xsl:if test="$target.show !=''">
122 <xsl:attribute name="target">
123 <xsl:value-of select="$target.show"/>
127 <xsl:copy-of select="$content"/>
134 <!-- otherwise it's a URI -->
137 <xsl:apply-templates select="." mode="common.html.attributes"/>
138 <xsl:attribute name="href">
139 <xsl:value-of select="$xhref"/>
141 <xsl:if test="$node/@xlink:title">
142 <xsl:attribute name="title">
143 <xsl:value-of select="$node/@xlink:title"/>
147 <!-- For URIs, use @xlink:show if defined, otherwise use ulink.target -->
148 <xsl:attribute name="target">
150 <xsl:when test="$target.show !=''">
151 <xsl:value-of select="$target.show"/>
154 <xsl:value-of select="$ulink.target"/>
159 <xsl:copy-of select="$content"/>
165 <xsl:when test="$linkend">
166 <xsl:variable name="targets" select="key('id',$linkend)"/>
167 <xsl:variable name="target" select="$targets[1]"/>
169 <xsl:call-template name="check.id.unique">
170 <xsl:with-param name="linkend" select="$linkend"/>
174 <xsl:apply-templates select="." mode="common.html.attributes"/>
175 <xsl:attribute name="href">
176 <xsl:call-template name="href.target">
177 <xsl:with-param name="object" select="$target"/>
181 <xsl:apply-templates select="$target" mode="html.title.attribute"/>
183 <xsl:copy-of select="$content"/>
188 <xsl:copy-of select="$content"/>
194 <xsl:when test="function-available('suwl:unwrapLinks')">
195 <xsl:copy-of select="suwl:unwrapLinks($link)"/>
198 <xsl:copy-of select="$link"/>
203 <xsl:template name="inline.charseq">
204 <xsl:param name="content">
205 <xsl:call-template name="anchor"/>
206 <xsl:call-template name="simple.xlink">
207 <xsl:with-param name="content">
208 <xsl:apply-templates/>
212 <!-- * if you want output from the inline.charseq template wrapped in -->
213 <!-- * something other than a Span, call the template with some value -->
214 <!-- * for the 'wrapper-name' param -->
215 <xsl:param name="wrapper-name">span</xsl:param>
216 <xsl:element name="{$wrapper-name}">
217 <xsl:attribute name="class">
218 <xsl:value-of select="local-name(.)"/>
220 <xsl:call-template name="dir"/>
221 <xsl:call-template name="generate.html.title"/>
222 <xsl:copy-of select="$content"/>
223 <xsl:call-template name="apply-annotations"/>
227 <xsl:template name="inline.monoseq">
228 <xsl:param name="content">
229 <xsl:call-template name="anchor"/>
230 <xsl:call-template name="simple.xlink">
231 <xsl:with-param name="content">
232 <xsl:apply-templates/>
237 <xsl:apply-templates select="." mode="common.html.attributes"/>
238 <xsl:copy-of select="$content"/>
239 <xsl:call-template name="apply-annotations"/>
243 <xsl:template name="inline.boldseq">
244 <xsl:param name="content">
245 <xsl:call-template name="anchor"/>
246 <xsl:call-template name="simple.xlink">
247 <xsl:with-param name="content">
248 <xsl:apply-templates/>
254 <xsl:apply-templates select="." mode="common.html.attributes"/>
256 <!-- don't put <strong> inside figure, example, or table titles -->
258 <xsl:when test="local-name(..) = 'title'
259 and (local-name(../..) = 'figure'
260 or local-name(../..) = 'example'
261 or local-name(../..) = 'table')">
262 <xsl:copy-of select="$content"/>
266 <xsl:copy-of select="$content"/>
270 <xsl:call-template name="apply-annotations"/>
274 <xsl:template name="inline.italicseq">
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/>
284 <xsl:call-template name="common.html.attributes"/>
285 <xsl:copy-of select="$content"/>
286 <xsl:call-template name="apply-annotations"/>
290 <xsl:template name="inline.boldmonoseq">
291 <xsl:param name="content">
292 <xsl:call-template name="anchor"/>
293 <xsl:call-template name="simple.xlink">
294 <xsl:with-param name="content">
295 <xsl:apply-templates/>
299 <!-- don't put <strong> inside figure, example, or table titles -->
300 <!-- or other titles that may already be represented with <strong>'s. -->
302 <xsl:when test="local-name(..) = 'title'
303 and (local-name(../..) = 'figure'
304 or local-name(../..) = 'example'
305 or local-name(../..) = 'table'
306 or local-name(../..) = 'formalpara')">
308 <xsl:call-template name="common.html.attributes"/>
309 <xsl:copy-of select="$content"/>
310 <xsl:call-template name="apply-annotations"/>
315 <xsl:call-template name="common.html.attributes"/>
317 <xsl:call-template name="generate.html.title"/>
318 <xsl:call-template name="dir"/>
319 <xsl:copy-of select="$content"/>
321 <xsl:call-template name="apply-annotations"/>
327 <xsl:template name="inline.italicmonoseq">
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="common.html.attributes"/>
339 <xsl:call-template name="generate.html.title"/>
340 <xsl:call-template name="dir"/>
341 <xsl:copy-of select="$content"/>
342 <xsl:call-template name="apply-annotations"/>
347 <xsl:template name="inline.superscriptseq">
348 <xsl:param name="content">
349 <xsl:call-template name="anchor"/>
350 <xsl:call-template name="simple.xlink">
351 <xsl:with-param name="content">
352 <xsl:apply-templates/>
357 <xsl:call-template name="generate.html.title"/>
358 <xsl:call-template name="dir"/>
359 <xsl:copy-of select="$content"/>
360 <xsl:call-template name="apply-annotations"/>
364 <xsl:template name="inline.subscriptseq">
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:apply-templates/>
374 <xsl:call-template name="generate.html.title"/>
375 <xsl:call-template name="dir"/>
376 <xsl:copy-of select="$content"/>
377 <xsl:call-template name="apply-annotations"/>
381 <!-- ==================================================================== -->
382 <!-- some special cases -->
384 <xsl:template match="author">
385 <xsl:param name="content">
386 <xsl:call-template name="anchor"/>
387 <xsl:call-template name="simple.xlink">
388 <xsl:with-param name="content">
389 <xsl:call-template name="person.name"/>
392 <xsl:call-template name="apply-annotations"/>
396 <xsl:call-template name="common.html.attributes"/>
397 <xsl:copy-of select="$content"/>
401 <xsl:template match="editor">
402 <xsl:param name="content">
403 <xsl:call-template name="anchor"/>
404 <xsl:call-template name="simple.xlink">
405 <xsl:with-param name="content">
406 <xsl:call-template name="person.name"/>
409 <xsl:call-template name="apply-annotations"/>
413 <xsl:call-template name="common.html.attributes"/>
414 <xsl:copy-of select="$content"/>
418 <xsl:template match="othercredit">
419 <xsl:param name="content">
420 <xsl:call-template name="anchor"/>
421 <xsl:call-template name="simple.xlink">
422 <xsl:with-param name="content">
423 <xsl:call-template name="person.name"/>
426 <xsl:call-template name="apply-annotations"/>
430 <xsl:call-template name="common.html.attributes"/>
431 <xsl:copy-of select="$content"/>
435 <xsl:template match="authorinitials">
436 <xsl:call-template name="inline.charseq"/>
439 <!-- ==================================================================== -->
441 <xsl:template match="accel">
442 <xsl:call-template name="inline.charseq"/>
445 <xsl:template match="action">
446 <xsl:call-template name="inline.charseq"/>
449 <xsl:template match="application">
450 <xsl:call-template name="inline.charseq"/>
453 <xsl:template match="classname">
454 <xsl:call-template name="inline.monoseq"/>
457 <xsl:template match="exceptionname">
458 <xsl:call-template name="inline.monoseq"/>
461 <xsl:template match="interfacename">
462 <xsl:call-template name="inline.monoseq"/>
465 <xsl:template match="methodname">
466 <xsl:call-template name="inline.monoseq"/>
469 <xsl:template match="command">
470 <xsl:call-template name="inline.boldseq"/>
473 <xsl:template match="computeroutput">
474 <xsl:call-template name="inline.monoseq"/>
477 <xsl:template match="constant">
478 <xsl:call-template name="inline.monoseq"/>
481 <xsl:template match="database">
482 <xsl:call-template name="inline.charseq"/>
485 <xsl:template match="date">
486 <!-- should this support locale-specific formatting? how? -->
487 <xsl:call-template name="inline.charseq"/>
490 <xsl:template match="errorcode">
491 <xsl:call-template name="inline.charseq"/>
494 <xsl:template match="errorname">
495 <xsl:call-template name="inline.charseq"/>
498 <xsl:template match="errortype">
499 <xsl:call-template name="inline.charseq"/>
502 <xsl:template match="errortext">
503 <xsl:call-template name="inline.charseq"/>
506 <xsl:template match="envar">
507 <xsl:call-template name="inline.monoseq"/>
510 <xsl:template match="filename">
511 <xsl:call-template name="inline.monoseq"/>
514 <xsl:template match="function">
516 <xsl:when test="$function.parens != '0'
517 and (parameter or function or replaceable)">
518 <xsl:variable name="nodes" select="text()|*"/>
519 <xsl:call-template name="inline.monoseq">
520 <xsl:with-param name="content">
521 <xsl:call-template name="simple.xlink">
522 <xsl:with-param name="content">
523 <xsl:apply-templates select="$nodes[1]"/>
528 <xsl:text>(</xsl:text>
529 <xsl:apply-templates select="$nodes[position()>1]"/>
530 <xsl:text>)</xsl:text>
533 <xsl:call-template name="inline.monoseq"/>
538 <xsl:template match="function/parameter" priority="2">
539 <xsl:call-template name="inline.italicmonoseq"/>
540 <xsl:if test="following-sibling::*">
541 <xsl:text>, </xsl:text>
545 <xsl:template match="function/replaceable" priority="2">
546 <xsl:call-template name="inline.italicmonoseq"/>
547 <xsl:if test="following-sibling::*">
548 <xsl:text>, </xsl:text>
552 <xsl:template match="guibutton">
553 <xsl:call-template name="inline.charseq"/>
556 <xsl:template match="guiicon">
557 <xsl:call-template name="inline.charseq"/>
560 <xsl:template match="guilabel">
561 <xsl:call-template name="inline.charseq"/>
564 <xsl:template match="guimenu">
565 <xsl:call-template name="inline.charseq"/>
568 <xsl:template match="guimenuitem">
569 <xsl:call-template name="inline.charseq"/>
572 <xsl:template match="guisubmenu">
573 <xsl:call-template name="inline.charseq"/>
576 <xsl:template match="hardware">
577 <xsl:call-template name="inline.charseq"/>
580 <xsl:template match="interface">
581 <xsl:call-template name="inline.charseq"/>
584 <xsl:template match="interfacedefinition">
585 <xsl:call-template name="inline.charseq"/>
588 <xsl:template match="keycap">
589 <xsl:call-template name="inline.boldseq"/>
592 <xsl:template match="keycode">
593 <xsl:call-template name="inline.charseq"/>
596 <xsl:template match="keysym">
597 <xsl:call-template name="inline.charseq"/>
600 <xsl:template match="literal">
601 <xsl:call-template name="inline.monoseq"/>
604 <xsl:template match="code">
605 <xsl:call-template name="inline.monoseq"/>
608 <xsl:template match="medialabel">
609 <xsl:call-template name="inline.italicseq"/>
612 <xsl:template match="shortcut">
613 <xsl:call-template name="inline.boldseq"/>
616 <xsl:template match="mousebutton">
617 <xsl:call-template name="inline.charseq"/>
620 <xsl:template match="option">
621 <xsl:call-template name="inline.monoseq"/>
624 <xsl:template match="package">
625 <xsl:call-template name="inline.charseq"/>
628 <xsl:template match="parameter">
629 <xsl:call-template name="inline.italicmonoseq"/>
632 <xsl:template match="property">
633 <xsl:call-template name="inline.charseq"/>
636 <xsl:template match="prompt">
637 <xsl:call-template name="inline.monoseq"/>
640 <xsl:template match="replaceable" priority="1">
641 <xsl:call-template name="inline.italicmonoseq"/>
644 <xsl:template match="returnvalue">
645 <xsl:call-template name="inline.charseq"/>
648 <xsl:template match="structfield">
649 <xsl:call-template name="inline.italicmonoseq"/>
652 <xsl:template match="structname">
653 <xsl:call-template name="inline.charseq"/>
656 <xsl:template match="symbol">
657 <xsl:call-template name="inline.charseq"/>
660 <xsl:template match="systemitem">
661 <xsl:call-template name="inline.monoseq"/>
664 <xsl:template match="token">
665 <xsl:call-template name="inline.charseq"/>
668 <xsl:template match="type">
669 <xsl:call-template name="inline.charseq"/>
672 <xsl:template match="userinput">
673 <xsl:call-template name="inline.boldmonoseq"/>
676 <xsl:template match="abbrev">
677 <xsl:call-template name="inline.charseq">
678 <xsl:with-param name="wrapper-name">abbr</xsl:with-param>
682 <xsl:template match="acronym">
683 <xsl:call-template name="inline.charseq">
684 <xsl:with-param name="wrapper-name">acronym</xsl:with-param>
688 <xsl:template match="citerefentry">
690 <xsl:when test="$citerefentry.link != '0'">
692 <xsl:apply-templates select="." mode="common.html.attributes"/>
693 <xsl:attribute name="href">
694 <xsl:call-template name="generate.citerefentry.link"/>
696 <xsl:call-template name="inline.charseq"/>
700 <xsl:call-template name="inline.charseq"/>
705 <xsl:template name="generate.citerefentry.link">
709 <xsl:template name="x.generate.citerefentry.link">
710 <xsl:text>http://example.com/cgi-bin/man.cgi?</xsl:text>
711 <xsl:value-of select="refentrytitle"/>
712 <xsl:text>(</xsl:text>
713 <xsl:value-of select="manvolnum"/>
714 <xsl:text>)</xsl:text>
717 <xsl:template match="citetitle">
719 <xsl:when test="@pubwork = 'article'">
720 <xsl:call-template name="gentext.startquote"/>
721 <xsl:call-template name="inline.charseq"/>
722 <xsl:call-template name="gentext.endquote"/>
725 <xsl:call-template name="inline.italicseq"/>
730 <xsl:template match="emphasis">
733 <!-- We don't want empty @class values, so do not propagate empty @roles -->
734 <xsl:when test="@role and
735 normalize-space(@role) != '' and
736 $emphasis.propagates.style != 0">
737 <xsl:apply-templates select="." mode="common.html.attributes">
738 <xsl:with-param name="class" select="@role"/>
739 </xsl:apply-templates>
742 <xsl:apply-templates select="." mode="common.html.attributes"/>
745 <xsl:call-template name="anchor"/>
747 <xsl:call-template name="simple.xlink">
748 <xsl:with-param name="content">
750 <xsl:when test="@role = 'bold' or @role='strong'">
751 <!-- backwards compatibility: make bold into b elements, but -->
752 <!-- don't put bold inside figure, example, or table titles -->
754 <xsl:when test="local-name(..) = 'title'
755 and (local-name(../..) = 'figure'
756 or local-name(../..) = 'example'
757 or local-name(../..) = 'table')">
758 <xsl:apply-templates/>
761 <strong><xsl:apply-templates/></strong>
765 <xsl:when test="@role and $emphasis.propagates.style != 0">
766 <xsl:apply-templates/>
769 <em><xsl:apply-templates/></em>
777 <xsl:template match="foreignphrase">
779 <xsl:apply-templates select="." mode="common.html.attributes"/>
780 <xsl:call-template name="inline.italicseq"/>
784 <xsl:template match="markup">
785 <xsl:call-template name="inline.charseq"/>
788 <xsl:template match="phrase">
790 <xsl:call-template name="locale.html.attributes"/>
791 <!-- We don't want empty @class values, so do not propagate empty @roles -->
792 <xsl:if test="@role and
793 normalize-space(@role) != '' and
794 $phrase.propagates.style != 0">
795 <xsl:apply-templates select="." mode="class.attribute">
796 <xsl:with-param name="class" select="@role"/>
797 </xsl:apply-templates>
799 <xsl:call-template name="dir"/>
800 <xsl:call-template name="anchor"/>
801 <xsl:call-template name="simple.xlink">
802 <xsl:with-param name="content">
803 <xsl:apply-templates/>
806 <xsl:call-template name="apply-annotations"/>
810 <xsl:template match="quote">
811 <xsl:variable name="depth">
812 <xsl:call-template name="dot.count">
813 <xsl:with-param name="string">
814 <xsl:number level="multiple"/>
819 <xsl:apply-templates select="." mode="common.html.attributes"/>
820 <xsl:call-template name="anchor"/>
822 <xsl:when test="$depth mod 2 = 0">
823 <xsl:call-template name="gentext.startquote"/>
824 <xsl:call-template name="inline.charseq"/>
825 <xsl:call-template name="gentext.endquote"/>
828 <xsl:call-template name="gentext.nestedstartquote"/>
829 <xsl:call-template name="inline.charseq"/>
830 <xsl:call-template name="gentext.nestedendquote"/>
836 <xsl:template match="varname">
837 <xsl:call-template name="inline.monoseq"/>
840 <xsl:template match="wordasword">
841 <xsl:call-template name="inline.italicseq"/>
844 <xsl:template match="lineannotation">
846 <xsl:apply-templates select="." mode="common.html.attributes"/>
847 <xsl:call-template name="inline.charseq"/>
851 <xsl:template match="superscript">
852 <xsl:call-template name="inline.superscriptseq"/>
855 <xsl:template match="subscript">
856 <xsl:call-template name="inline.subscriptseq"/>
859 <xsl:template match="trademark">
860 <xsl:call-template name="inline.charseq"/>
862 <xsl:when test="@class = 'copyright'
863 or @class = 'registered'">
864 <xsl:call-template name="dingbat">
865 <xsl:with-param name="dingbat" select="@class"/>
868 <xsl:when test="@class = 'service'">
872 <xsl:call-template name="dingbat">
873 <xsl:with-param name="dingbat" select="'trademark'"/>
879 <xsl:template match="firstterm">
880 <xsl:call-template name="glossterm">
881 <xsl:with-param name="firstterm" select="1"/>
885 <xsl:template match="glossterm" name="glossterm">
886 <xsl:param name="firstterm" select="0"/>
888 <!-- To avoid extra <a name=""> anchor from inline.italicseq -->
889 <xsl:variable name="content">
890 <xsl:apply-templates/>
894 <xsl:when test="($firstterm.only.link = 0 or $firstterm = 1) and @linkend">
895 <xsl:variable name="targets" select="key('id',@linkend)"/>
896 <xsl:variable name="target" select="$targets[1]"/>
898 <xsl:call-template name="check.id.unique">
899 <xsl:with-param name="linkend" select="@linkend"/>
903 <xsl:when test="$target">
905 <xsl:apply-templates select="." mode="common.html.attributes"/>
906 <xsl:if test="@id or @xml:id">
907 <xsl:attribute name="name">
908 <xsl:value-of select="(@id|@xml:id)[1]"/>
912 <xsl:attribute name="href">
913 <xsl:call-template name="href.target">
914 <xsl:with-param name="object" select="$target"/>
918 <xsl:call-template name="inline.italicseq">
919 <xsl:with-param name="content" select="$content"/>
924 <xsl:call-template name="inline.italicseq">
925 <xsl:with-param name="content" select="$content"/>
931 <xsl:when test="not(@linkend)
932 and ($firstterm.only.link = 0 or $firstterm = 1)
933 and ($glossterm.auto.link != 0)
934 and $glossary.collection != ''">
935 <xsl:variable name="term">
937 <xsl:when test="@baseform"><xsl:value-of select="@baseform"/></xsl:when>
938 <xsl:otherwise><xsl:value-of select="."/></xsl:otherwise>
942 <xsl:variable name="cterm"
943 select="(document($glossary.collection,.)//glossentry[glossterm=$term])[1]"/>
945 <!-- HACK HACK HACK! But it works... -->
946 <!-- You'd need to do more work if you wanted to chunk on glossdiv, though -->
948 <xsl:variable name="glossary" select="//glossary[@role='auto']"/>
950 <xsl:if test="count($glossary) != 1">
952 <xsl:text>Warning: glossary.collection specified, but there are </xsl:text>
953 <xsl:value-of select="count($glossary)"/>
954 <xsl:text> automatic glossaries</xsl:text>
958 <xsl:variable name="glosschunk">
959 <xsl:call-template name="href.target">
960 <xsl:with-param name="object" select="$glossary"/>
964 <xsl:variable name="chunkbase">
966 <xsl:when test="contains($glosschunk, '#')">
967 <xsl:value-of select="substring-before($glosschunk, '#')"/>
970 <xsl:value-of select="$glosschunk"/>
976 <xsl:when test="not($cterm)">
978 <xsl:text>There's no entry for </xsl:text>
979 <xsl:value-of select="$term"/>
980 <xsl:text> in </xsl:text>
981 <xsl:value-of select="$glossary.collection"/>
983 <xsl:call-template name="inline.italicseq"/>
986 <xsl:variable name="id">
987 <xsl:call-template name="object.id">
988 <xsl:with-param name="object" select="$cterm"/>
991 <a href="{$chunkbase}#{$id}">
992 <xsl:apply-templates select="." mode="common.html.attributes"/>
993 <xsl:call-template name="inline.italicseq">
994 <xsl:with-param name="content" select="$content"/>
1001 <xsl:when test="not(@linkend)
1002 and ($firstterm.only.link = 0 or $firstterm = 1)
1003 and $glossterm.auto.link != 0">
1004 <xsl:variable name="term">
1006 <xsl:when test="@baseform">
1007 <xsl:value-of select="normalize-space(@baseform)"/>
1010 <xsl:value-of select="normalize-space(.)"/>
1014 <xsl:variable name="targets"
1015 select="//glossentry[normalize-space(glossterm)=$term
1016 or normalize-space(glossterm/@baseform)=$term]"/>
1017 <xsl:variable name="target" select="$targets[1]"/>
1020 <xsl:when test="count($targets)=0">
1022 <xsl:text>Error: no glossentry for glossterm: </xsl:text>
1023 <xsl:value-of select="."/>
1024 <xsl:text>.</xsl:text>
1026 <xsl:call-template name="inline.italicseq"/>
1030 <xsl:apply-templates select="." mode="common.html.attributes"/>
1031 <xsl:if test="@id or @xml:id">
1032 <xsl:attribute name="name">
1033 <xsl:value-of select="(@id|@xml:id)[1]"/>
1037 <xsl:attribute name="href">
1038 <xsl:call-template name="href.target">
1039 <xsl:with-param name="object" select="$target"/>
1040 </xsl:call-template>
1043 <xsl:call-template name="inline.italicseq">
1044 <xsl:with-param name="content" select="$content"/>
1045 </xsl:call-template>
1052 <xsl:call-template name="inline.italicseq"/>
1057 <xsl:template match="termdef">
1059 <xsl:apply-templates select="." mode="common.html.attributes"/>
1060 <xsl:call-template name="gentext.template">
1061 <xsl:with-param name="context" select="'termdef'"/>
1062 <xsl:with-param name="name" select="'prefix'"/>
1063 </xsl:call-template>
1064 <xsl:apply-templates/>
1065 <xsl:call-template name="gentext.template">
1066 <xsl:with-param name="context" select="'termdef'"/>
1067 <xsl:with-param name="name" select="'suffix'"/>
1068 </xsl:call-template>
1072 <xsl:template match="sgmltag|tag">
1073 <xsl:call-template name="format.sgmltag"/>
1076 <xsl:template name="format.sgmltag">
1077 <xsl:param name="class">
1079 <xsl:when test="@class">
1080 <xsl:value-of select="@class"/>
1082 <xsl:otherwise>element</xsl:otherwise>
1086 <xsl:variable name="content">
1088 <xsl:when test="$class='attribute'">
1089 <xsl:apply-templates/>
1091 <xsl:when test="$class='attvalue'">
1092 <xsl:apply-templates/>
1094 <xsl:when test="$class='element'">
1095 <xsl:apply-templates/>
1097 <xsl:when test="$class='endtag'">
1098 <xsl:text></</xsl:text>
1099 <xsl:apply-templates/>
1100 <xsl:text>></xsl:text>
1102 <xsl:when test="$class='genentity'">
1103 <xsl:text>&</xsl:text>
1104 <xsl:apply-templates/>
1105 <xsl:text>;</xsl:text>
1107 <xsl:when test="$class='numcharref'">
1108 <xsl:text>&#</xsl:text>
1109 <xsl:apply-templates/>
1110 <xsl:text>;</xsl:text>
1112 <xsl:when test="$class='paramentity'">
1113 <xsl:text>%</xsl:text>
1114 <xsl:apply-templates/>
1115 <xsl:text>;</xsl:text>
1117 <xsl:when test="$class='pi'">
1118 <xsl:text><?</xsl:text>
1119 <xsl:apply-templates/>
1120 <xsl:text>></xsl:text>
1122 <xsl:when test="$class='xmlpi'">
1123 <xsl:text><?</xsl:text>
1124 <xsl:apply-templates/>
1125 <xsl:text>?></xsl:text>
1127 <xsl:when test="$class='starttag'">
1128 <xsl:text><</xsl:text>
1129 <xsl:apply-templates/>
1130 <xsl:text>></xsl:text>
1132 <xsl:when test="$class='emptytag'">
1133 <xsl:text><</xsl:text>
1134 <xsl:apply-templates/>
1135 <xsl:text>/></xsl:text>
1137 <xsl:when test="$class='sgmlcomment' or $class='comment'">
1138 <xsl:text><!--</xsl:text>
1139 <xsl:apply-templates/>
1140 <xsl:text>--></xsl:text>
1143 <xsl:apply-templates/>
1149 <xsl:apply-templates select="." mode="common.html.attributes">
1150 <xsl:with-param name="class" select="concat('sgmltag-', $class)"/>
1151 </xsl:apply-templates>
1152 <xsl:call-template name="simple.xlink">
1153 <xsl:with-param name="content" select="$content"/>
1154 </xsl:call-template>
1158 <xsl:template match="email">
1159 <xsl:call-template name="inline.monoseq">
1160 <xsl:with-param name="content">
1161 <xsl:if test="not($email.delimiters.enabled = 0)">
1162 <xsl:text><</xsl:text>
1165 <xsl:apply-templates select="." mode="common.html.attributes"/>
1166 <xsl:attribute name="href">
1167 <xsl:text>mailto:</xsl:text>
1168 <xsl:value-of select="."/>
1170 <xsl:apply-templates/>
1172 <xsl:if test="not($email.delimiters.enabled = 0)">
1173 <xsl:text>></xsl:text>
1176 </xsl:call-template>
1179 <xsl:template match="keycombo">
1180 <xsl:variable name="action" select="@action"/>
1181 <xsl:variable name="joinchar">
1183 <xsl:when test="$action='seq'"><xsl:text> </xsl:text></xsl:when>
1184 <xsl:when test="$action='simul'">+</xsl:when>
1185 <xsl:when test="$action='press'">-</xsl:when>
1186 <xsl:when test="$action='click'">-</xsl:when>
1187 <xsl:when test="$action='double-click'">-</xsl:when>
1188 <xsl:when test="$action='other'"></xsl:when>
1189 <xsl:otherwise>+</xsl:otherwise>
1192 <xsl:for-each select="*">
1193 <xsl:if test="position()>1"><xsl:value-of select="$joinchar"/></xsl:if>
1194 <xsl:apply-templates select="."/>
1198 <xsl:template match="uri">
1199 <xsl:call-template name="inline.monoseq"/>
1202 <!-- ==================================================================== -->
1204 <xsl:template match="menuchoice">
1205 <xsl:variable name="shortcut" select="./shortcut"/>
1206 <xsl:call-template name="process.menuchoice"/>
1207 <xsl:if test="$shortcut">
1208 <xsl:text> (</xsl:text>
1209 <xsl:apply-templates select="$shortcut"/>
1210 <xsl:text>)</xsl:text>
1214 <xsl:template name="process.menuchoice">
1215 <xsl:param name="nodelist" select="guibutton|guiicon|guilabel|guimenu|guimenuitem|guisubmenu|interface"/><!-- not(shortcut) -->
1216 <xsl:param name="count" select="1"/>
1219 <xsl:when test="$count>count($nodelist)"></xsl:when>
1220 <xsl:when test="$count=1">
1221 <xsl:apply-templates select="$nodelist[$count=position()]"/>
1222 <xsl:call-template name="process.menuchoice">
1223 <xsl:with-param name="nodelist" select="$nodelist"/>
1224 <xsl:with-param name="count" select="$count+1"/>
1225 </xsl:call-template>
1228 <xsl:variable name="node" select="$nodelist[$count=position()]"/>
1230 <xsl:when test="local-name($node)='guimenuitem'
1231 or local-name($node)='guisubmenu'">
1232 <xsl:value-of select="$menuchoice.menu.separator"/>
1235 <xsl:value-of select="$menuchoice.separator"/>
1238 <xsl:apply-templates select="$node"/>
1239 <xsl:call-template name="process.menuchoice">
1240 <xsl:with-param name="nodelist" select="$nodelist"/>
1241 <xsl:with-param name="count" select="$count+1"/>
1242 </xsl:call-template>
1247 <!-- ==================================================================== -->
1249 <xsl:template match="optional">
1250 <xsl:value-of select="$arg.choice.opt.open.str"/>
1251 <xsl:call-template name="inline.charseq"/>
1252 <xsl:value-of select="$arg.choice.opt.close.str"/>
1255 <xsl:template match="citation">
1256 <!-- todo: integrate with bibliography collection -->
1257 <xsl:variable name="targets" select="(//biblioentry | //bibliomixed)[abbrev = string(current())]"/>
1258 <xsl:variable name="target" select="$targets[1]"/>
1261 <!-- try automatic linking based on match to abbrev -->
1262 <xsl:when test="$target and not(xref) and not(link)">
1264 <xsl:text>[</xsl:text>
1266 <xsl:apply-templates select="." mode="common.html.attributes"/>
1267 <xsl:attribute name="href">
1268 <xsl:call-template name="href.target">
1269 <xsl:with-param name="object" select="$target"/>
1270 </xsl:call-template>
1274 <xsl:when test="$bibliography.numbered != 0">
1275 <xsl:apply-templates select="$target" mode="citation"/>
1278 <xsl:call-template name="inline.charseq"/>
1283 <xsl:text>]</xsl:text>
1286 <xsl:text>[</xsl:text>
1287 <xsl:call-template name="inline.charseq"/>
1288 <xsl:text>]</xsl:text>
1293 <xsl:template match="citebiblioid">
1294 <xsl:variable name="targets" select="//*[biblioid = string(current())]"/>
1295 <xsl:variable name="target" select="$targets[1]"/>
1298 <!-- try automatic linking based on match to parent of biblioid -->
1299 <xsl:when test="$target and not(xref) and not(link)">
1301 <xsl:text>[</xsl:text>
1303 <xsl:apply-templates select="." mode="common.html.attributes"/>
1304 <xsl:attribute name="href">
1305 <xsl:call-template name="href.target">
1306 <xsl:with-param name="object" select="$target"/>
1307 </xsl:call-template>
1310 <xsl:call-template name="inline.charseq"/>
1313 <xsl:text>]</xsl:text>
1316 <xsl:text>[</xsl:text>
1317 <xsl:call-template name="inline.charseq"/>
1318 <xsl:text>]</xsl:text>
1323 <xsl:template match="biblioentry|bibliomixed" mode="citation">
1324 <xsl:number from="bibliography" count="biblioentry|bibliomixed"
1325 level="any" format="1"/>
1328 <!-- ==================================================================== -->
1330 <xsl:template match="comment[&comment.block.parents;]|remark[&comment.block.parents;]">
1331 <xsl:if test="$show.comments != 0">
1332 <p class="remark"><i><xsl:call-template name="inline.charseq"/></i></p>
1336 <xsl:template match="comment|remark">
1337 <xsl:if test="$show.comments != 0">
1338 <em><xsl:call-template name="inline.charseq"/></em>
1342 <!-- ==================================================================== -->
1344 <xsl:template match="productname">
1345 <xsl:call-template name="inline.charseq"/>
1346 <xsl:if test="@class">
1347 <xsl:call-template name="dingbat">
1348 <xsl:with-param name="dingbat" select="@class"/>
1349 </xsl:call-template>
1353 <xsl:template match="productnumber">
1354 <xsl:call-template name="inline.charseq"/>
1357 <!-- ==================================================================== -->
1359 <xsl:template match="pob|street|city|state|postcode|country|otheraddr">
1360 <xsl:call-template name="inline.charseq"/>
1363 <xsl:template match="phone|fax">
1364 <xsl:call-template name="inline.charseq"/>
1367 <!-- in Addresses, for example -->
1368 <xsl:template match="honorific|firstname|surname|lineage|othername">
1369 <xsl:call-template name="inline.charseq"/>
1372 <!-- ==================================================================== -->
1374 <xsl:template match="person">
1375 <xsl:param name="content">
1376 <xsl:call-template name="anchor"/>
1377 <xsl:call-template name="simple.xlink">
1378 <xsl:with-param name="content">
1379 <xsl:apply-templates select="personname"/>
1381 </xsl:call-template>
1382 <xsl:call-template name="apply-annotations"/>
1386 <xsl:apply-templates select="." mode="common.html.attributes"/>
1387 <xsl:copy-of select="$content"/>
1391 <xsl:template match="personname">
1392 <xsl:param name="content">
1393 <xsl:call-template name="anchor"/>
1394 <xsl:call-template name="simple.xlink">
1395 <xsl:with-param name="content">
1396 <xsl:call-template name="person.name"/>
1398 </xsl:call-template>
1399 <xsl:call-template name="apply-annotations"/>
1403 <xsl:apply-templates select="." mode="common.html.attributes"/>
1404 <xsl:copy-of select="$content"/>
1408 <!-- ==================================================================== -->
1410 <xsl:template match="org">
1411 <xsl:param name="content">
1412 <xsl:call-template name="anchor"/>
1413 <xsl:call-template name="simple.xlink">
1414 <xsl:with-param name="content">
1415 <xsl:apply-templates/>
1417 </xsl:call-template>
1418 <xsl:call-template name="apply-annotations"/>
1422 <xsl:apply-templates select="." mode="common.html.attributes"/>
1423 <xsl:copy-of select="$content"/>
1427 <xsl:template match="orgname">
1428 <xsl:param name="content">
1429 <xsl:call-template name="anchor"/>
1430 <xsl:call-template name="simple.xlink">
1431 <xsl:with-param name="content">
1432 <xsl:apply-templates/>
1434 </xsl:call-template>
1435 <xsl:call-template name="apply-annotations"/>
1439 <xsl:apply-templates select="." mode="common.html.attributes"/>
1440 <xsl:copy-of select="$content"/>
1444 <xsl:template match="orgdiv">
1445 <xsl:param name="content">
1446 <xsl:call-template name="anchor"/>
1447 <xsl:call-template name="simple.xlink">
1448 <xsl:with-param name="content">
1449 <xsl:apply-templates/>
1451 </xsl:call-template>
1452 <xsl:call-template name="apply-annotations"/>
1456 <xsl:apply-templates select="." mode="common.html.attributes"/>
1457 <xsl:copy-of select="$content"/>
1461 <xsl:template match="affiliation">
1462 <xsl:param name="content">
1463 <xsl:call-template name="anchor"/>
1464 <xsl:call-template name="simple.xlink">
1465 <xsl:with-param name="content">
1466 <xsl:call-template name="person.name"/>
1468 </xsl:call-template>
1469 <xsl:call-template name="apply-annotations"/>
1473 <xsl:apply-templates select="." mode="common.html.attributes"/>
1474 <xsl:copy-of select="$content"/>
1478 <!-- ==================================================================== -->
1480 <xsl:template match="beginpage">
1481 <!-- does nothing; this *is not* markup to force a page break. -->