2 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
3 xmlns:doc="http://nwalsh.com/xsl/documentation/1.0"
4 exclude-result-prefixes="doc"
7 <!-- ********************************************************************
8 $Id: gentext.xsl 9790 2013-08-28 22:55:38Z bobstayton $
9 ********************************************************************
11 This file is part of the XSL DocBook Stylesheet distribution.
12 See ../README or http://docbook.sf.net/release/xsl/current/ for
13 copyright and other information.
15 ******************************************************************** -->
17 <!-- ==================================================================== -->
20 <xsl:template match="*" mode="object.title.template">
21 <xsl:call-template name="gentext.template">
22 <xsl:with-param name="context" select="'title'"/>
23 <xsl:with-param name="name">
24 <xsl:call-template name="xpath.location"/>
29 <xsl:template match="chapter" mode="object.title.template">
31 <xsl:when test="string($chapter.autolabel) != 0">
32 <xsl:call-template name="gentext.template">
33 <xsl:with-param name="context" select="'title-numbered'"/>
34 <xsl:with-param name="name">
35 <xsl:call-template name="xpath.location"/>
40 <xsl:call-template name="gentext.template">
41 <xsl:with-param name="context" select="'title-unnumbered'"/>
42 <xsl:with-param name="name">
43 <xsl:call-template name="xpath.location"/>
50 <xsl:template match="appendix" mode="object.title.template">
52 <xsl:when test="string($appendix.autolabel) != 0">
53 <xsl:call-template name="gentext.template">
54 <xsl:with-param name="context" select="'title-numbered'"/>
55 <xsl:with-param name="name">
56 <xsl:call-template name="xpath.location"/>
61 <xsl:call-template name="gentext.template">
62 <xsl:with-param name="context" select="'title-unnumbered'"/>
63 <xsl:with-param name="name">
64 <xsl:call-template name="xpath.location"/>
71 <xsl:template match="part" mode="object.title.template">
73 <xsl:when test="string($part.autolabel) != 0">
74 <xsl:call-template name="gentext.template">
75 <xsl:with-param name="context" select="'title-numbered'"/>
76 <xsl:with-param name="name">
77 <xsl:call-template name="xpath.location"/>
82 <xsl:call-template name="gentext.template">
83 <xsl:with-param name="context" select="'title-unnumbered'"/>
84 <xsl:with-param name="name">
85 <xsl:call-template name="xpath.location"/>
92 <xsl:template match="section|sect1|sect2|sect3|sect4|sect5|simplesect
94 mode="object.title.template">
95 <xsl:variable name="is.numbered">
96 <xsl:call-template name="label.this.section"/>
99 <xsl:when test="$is.numbered != 0">
100 <xsl:call-template name="gentext.template">
101 <xsl:with-param name="context" select="'title-numbered'"/>
102 <xsl:with-param name="name">
103 <xsl:call-template name="xpath.location"/>
108 <xsl:call-template name="gentext.template">
109 <xsl:with-param name="context" select="'title-unnumbered'"/>
110 <xsl:with-param name="name">
111 <xsl:call-template name="xpath.location"/>
118 <xsl:template match="procedure" mode="object.title.template">
119 <xsl:variable name="title" select="title|blockinfo/title|info/title"/>
121 <xsl:when test="$formal.procedures != 0 and $title">
122 <xsl:call-template name="gentext.template">
123 <xsl:with-param name="context" select="'title'"/>
124 <xsl:with-param name="name">
125 <xsl:call-template name="xpath.location"/>
126 <xsl:text>.formal</xsl:text>
131 <xsl:call-template name="gentext.template">
132 <xsl:with-param name="context" select="'title'"/>
133 <xsl:with-param name="name">
134 <xsl:call-template name="xpath.location"/>
141 <!-- ============================================================ -->
143 <xsl:template match="*" mode="object.subtitle.template">
144 <xsl:call-template name="gentext.template">
145 <xsl:with-param name="context" select="'subtitle'"/>
146 <xsl:with-param name="name">
147 <xsl:call-template name="xpath.location"/>
152 <!-- ============================================================ -->
154 <xsl:template match="*" mode="is.autonumber">
155 <xsl:value-of select="'0'"/>
158 <xsl:template match="section|sect1|sect2|sect3|sect4|sect5"
159 mode="is.autonumber">
160 <xsl:call-template name="label.this.section"/>
163 <xsl:template match="figure|example|table|equation" mode="is.autonumber">
164 <xsl:value-of select="'1'"/>
167 <xsl:template match="appendix" mode="is.autonumber">
168 <xsl:value-of select="$appendix.autolabel"/>
171 <xsl:template match="chapter" mode="is.autonumber">
172 <xsl:value-of select="$chapter.autolabel"/>
175 <xsl:template match="part" mode="is.autonumber">
176 <xsl:value-of select="$part.autolabel"/>
179 <xsl:template match="preface" mode="is.autonumber">
180 <xsl:value-of select="$preface.autolabel"/>
183 <xsl:template match="question|answer" mode="is.autonumber">
185 <xsl:when test="$qanda.defaultlabel = 'number'
187 <xsl:value-of select="'1'"/>
190 <xsl:value-of select="'0'"/>
195 <xsl:template match="qandadiv" mode="is.autonumber">
196 <xsl:value-of select="$qandadiv.autolabel"/>
199 <xsl:template match="bridgehead" mode="is.autonumber">
200 <!-- bridgeheads are not numbered -->
201 <xsl:text>0</xsl:text>
204 <xsl:template match="procedure" mode="is.autonumber">
205 <xsl:value-of select="$formal.procedures"/>
209 <xsl:template match="*" mode="object.xref.template">
210 <xsl:param name="purpose"/>
211 <xsl:param name="xrefstyle"/>
212 <xsl:param name="referrer"/>
214 <!-- Is autonumbering on? -->
215 <xsl:variable name="autonumber">
216 <xsl:apply-templates select="." mode="is.autonumber"/>
219 <xsl:variable name="number-and-title-template">
220 <xsl:call-template name="gentext.template.exists">
221 <xsl:with-param name="context" select="'xref-number-and-title'"/>
222 <xsl:with-param name="name">
223 <xsl:call-template name="xpath.location"/>
228 <xsl:variable name="number-template">
229 <xsl:call-template name="gentext.template.exists">
230 <xsl:with-param name="context" select="'xref-number'"/>
231 <xsl:with-param name="name">
232 <xsl:call-template name="xpath.location"/>
237 <xsl:variable name="context">
239 <xsl:when test="self::equation and not(title) and not(info/title)">
240 <xsl:value-of select="'xref-number'"/>
242 <xsl:when test="string($autonumber) != 0
243 and $number-and-title-template != 0
244 and $xref.with.number.and.title != 0">
245 <xsl:value-of select="'xref-number-and-title'"/>
247 <xsl:when test="string($autonumber) != 0
248 and $number-template != 0">
249 <xsl:value-of select="'xref-number'"/>
252 <xsl:value-of select="'xref'"/>
257 <xsl:call-template name="gentext.template">
258 <xsl:with-param name="context" select="$context"/>
259 <xsl:with-param name="name">
260 <xsl:call-template name="xpath.location"/>
262 <xsl:with-param name="purpose" select="$purpose"/>
263 <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
264 <xsl:with-param name="referrer" select="$referrer"/>
270 <!-- ============================================================ -->
272 <xsl:template match="*" mode="object.title.markup">
273 <xsl:param name="allow-anchors" select="0"/>
274 <xsl:variable name="template">
275 <xsl:apply-templates select="." mode="object.title.template"/>
280 <xsl:text>object.title.markup: </xsl:text>
281 <xsl:value-of select="local-name(.)"/>
282 <xsl:text>: </xsl:text>
283 <xsl:value-of select="$template"/>
287 <xsl:call-template name="substitute-markup">
288 <xsl:with-param name="allow-anchors" select="$allow-anchors"/>
289 <xsl:with-param name="template" select="$template"/>
293 <xsl:template match="*" mode="object.title.markup.textonly">
294 <xsl:variable name="title">
295 <xsl:apply-templates select="." mode="object.title.markup"/>
297 <xsl:value-of select="normalize-space($title)"/>
300 <!-- ============================================================ -->
302 <xsl:template match="*" mode="object.titleabbrev.markup">
303 <xsl:param name="allow-anchors" select="0"/>
305 <!-- Just for consistency in template naming -->
307 <xsl:apply-templates select="." mode="titleabbrev.markup">
308 <xsl:with-param name="allow-anchors" select="$allow-anchors"/>
309 </xsl:apply-templates>
312 <!-- ============================================================ -->
314 <xsl:template match="*" mode="object.subtitle.markup">
315 <xsl:variable name="template">
316 <xsl:apply-templates select="." mode="object.subtitle.template"/>
319 <xsl:call-template name="substitute-markup">
320 <xsl:with-param name="template" select="$template"/>
324 <!-- ============================================================ -->
326 <xsl:template match="*" mode="object.xref.markup">
327 <xsl:param name="purpose"/>
328 <xsl:param name="xrefstyle"/>
329 <xsl:param name="referrer"/>
330 <xsl:param name="verbose" select="1"/>
332 <xsl:variable name="template">
334 <xsl:when test="starts-with(normalize-space($xrefstyle), 'select:')">
335 <xsl:call-template name="make.gentext.template">
336 <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
337 <xsl:with-param name="purpose" select="$purpose"/>
338 <xsl:with-param name="referrer" select="$referrer"/>
341 <xsl:when test="starts-with(normalize-space($xrefstyle), 'template:')">
342 <xsl:value-of select="substring-after(normalize-space($xrefstyle), 'template:')"/>
345 <xsl:apply-templates select="." mode="object.xref.template">
346 <xsl:with-param name="purpose" select="$purpose"/>
347 <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
348 <xsl:with-param name="referrer" select="$referrer"/>
349 </xsl:apply-templates>
356 <xsl:text>object.xref.markup: </xsl:text>
357 <xsl:value-of select="local-name(.)"/>
358 <xsl:text>(</xsl:text>
359 <xsl:value-of select="$xrefstyle"/>
360 <xsl:text>, </xsl:text>
361 <xsl:value-of select="$purpose"/>
362 <xsl:text>)</xsl:text>
363 <xsl:text>: [</xsl:text>
364 <xsl:value-of select="$template"/>
365 <xsl:text>]</xsl:text>
369 <xsl:if test="$template = '' and $verbose != 0">
371 <xsl:text>object.xref.markup: empty xref template</xsl:text>
372 <xsl:text> for linkend="</xsl:text>
373 <xsl:value-of select="@id|@xml:id"/>
374 <xsl:text>" and @xrefstyle="</xsl:text>
375 <xsl:value-of select="$xrefstyle"/>
376 <xsl:text>"</xsl:text>
380 <xsl:call-template name="substitute-markup">
381 <xsl:with-param name="purpose" select="$purpose"/>
382 <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
383 <xsl:with-param name="referrer" select="$referrer"/>
384 <xsl:with-param name="template" select="$template"/>
385 <xsl:with-param name="verbose" select="$verbose"/>
389 <xsl:template match="listitem" mode="object.xref.markup">
390 <xsl:param name="verbose" select="1"/>
393 <xsl:when test="parent::orderedlist">
394 <xsl:variable name="template">
395 <xsl:apply-templates select="." mode="object.xref.template"/>
397 <xsl:call-template name="substitute-markup">
398 <xsl:with-param name="template" select="$template"/>
401 <xsl:when test="$verbose != 0">
403 <xsl:text>Xref is only supported to listitems in an</xsl:text>
404 <xsl:text> orderedlist: </xsl:text>
405 <xsl:value-of select=".//@id|.//@xml:id"/>
407 <xsl:text>???</xsl:text>
412 <xsl:template match="question" mode="object.xref.markup">
413 <xsl:param name="purpose"/>
414 <xsl:param name="xrefstyle"/>
415 <xsl:param name="referrer"/>
417 <xsl:variable name="deflabel">
419 <xsl:when test="ancestor-or-self::*[@defaultlabel]">
420 <xsl:value-of select="(ancestor-or-self::*[@defaultlabel])[last()]
424 <xsl:value-of select="$qanda.defaultlabel"/>
429 <xsl:variable name="template">
431 <!-- This avoids double Q: Q: in xref when defaultlabel=qanda -->
432 <xsl:when test="$deflabel = 'qanda' and not(label)">%n</xsl:when>
434 <xsl:apply-templates select="." mode="object.xref.template">
435 <xsl:with-param name="purpose" select="$purpose"/>
436 <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
437 <xsl:with-param name="referrer" select="$referrer"/>
438 </xsl:apply-templates>
443 <xsl:call-template name="substitute-markup">
444 <xsl:with-param name="purpose" select="$purpose"/>
445 <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
446 <xsl:with-param name="referrer" select="$referrer"/>
447 <xsl:with-param name="template" select="$template"/>
451 <!-- ============================================================ -->
453 <xsl:template name="substitute-markup">
454 <xsl:param name="template" select="''"/>
455 <xsl:param name="allow-anchors" select="'0'"/>
456 <xsl:param name="title" select="''"/>
457 <xsl:param name="subtitle" select="''"/>
458 <xsl:param name="docname" select="''"/>
459 <xsl:param name="label" select="''"/>
460 <xsl:param name="pagenumber" select="''"/>
461 <xsl:param name="purpose"/>
462 <xsl:param name="xrefstyle"/>
463 <xsl:param name="referrer"/>
464 <xsl:param name="verbose"/>
467 <xsl:when test="contains($template, '%')">
468 <xsl:value-of select="substring-before($template, '%')"/>
469 <xsl:variable name="candidate"
470 select="substring(substring-after($template, '%'), 1, 1)"/>
472 <xsl:when test="$candidate = 't'">
473 <xsl:apply-templates select="." mode="insert.title.markup">
474 <xsl:with-param name="purpose" select="$purpose"/>
475 <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
476 <xsl:with-param name="title">
478 <xsl:when test="$title != ''">
479 <xsl:copy-of select="$title"/>
481 <xsl:when test="$purpose = 'xref'">
482 <xsl:apply-templates select="." mode="titleabbrev.markup">
483 <xsl:with-param name="allow-anchors" select="$allow-anchors"/>
484 <xsl:with-param name="verbose" select="$verbose"/>
485 </xsl:apply-templates>
488 <xsl:apply-templates select="." mode="title.markup">
489 <xsl:with-param name="allow-anchors" select="$allow-anchors"/>
490 <xsl:with-param name="verbose" select="$verbose"/>
491 </xsl:apply-templates>
495 </xsl:apply-templates>
497 <xsl:when test="$candidate = 's'">
498 <xsl:apply-templates select="." mode="insert.subtitle.markup">
499 <xsl:with-param name="purpose" select="$purpose"/>
500 <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
501 <xsl:with-param name="subtitle">
503 <xsl:when test="$subtitle != ''">
504 <xsl:copy-of select="$subtitle"/>
507 <xsl:apply-templates select="." mode="subtitle.markup">
508 <xsl:with-param name="allow-anchors" select="$allow-anchors"/>
509 </xsl:apply-templates>
513 </xsl:apply-templates>
515 <xsl:when test="$candidate = 'n'">
516 <xsl:apply-templates select="." mode="insert.label.markup">
517 <xsl:with-param name="purpose" select="$purpose"/>
518 <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
519 <xsl:with-param name="label">
521 <xsl:when test="$label != ''">
522 <xsl:copy-of select="$label"/>
525 <xsl:apply-templates select="." mode="label.markup"/>
529 </xsl:apply-templates>
531 <xsl:when test="$candidate = 'p'">
532 <xsl:apply-templates select="." mode="insert.pagenumber.markup">
533 <xsl:with-param name="purpose" select="$purpose"/>
534 <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
535 <xsl:with-param name="pagenumber">
537 <xsl:when test="$pagenumber != ''">
538 <xsl:copy-of select="$pagenumber"/>
541 <xsl:apply-templates select="." mode="pagenumber.markup"/>
545 </xsl:apply-templates>
547 <xsl:when test="$candidate = 'o'">
548 <!-- olink target document title -->
549 <xsl:apply-templates select="." mode="insert.olink.docname.markup">
550 <xsl:with-param name="purpose" select="$purpose"/>
551 <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
552 <xsl:with-param name="docname">
554 <xsl:when test="$docname != ''">
555 <xsl:copy-of select="$docname"/>
558 <xsl:apply-templates select="." mode="olink.docname.markup"/>
562 </xsl:apply-templates>
564 <xsl:when test="$candidate = 'd'">
565 <xsl:apply-templates select="." mode="insert.direction.markup">
566 <xsl:with-param name="purpose" select="$purpose"/>
567 <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
568 <xsl:with-param name="direction">
570 <xsl:when test="$referrer">
571 <xsl:variable name="referent-is-below">
572 <xsl:for-each select="preceding::xref">
573 <xsl:if test="generate-id(.) = generate-id($referrer)">1</xsl:if>
577 <xsl:when test="$referent-is-below = ''">
578 <xsl:call-template name="gentext">
579 <xsl:with-param name="key" select="'above'"/>
583 <xsl:call-template name="gentext">
584 <xsl:with-param name="key" select="'below'"/>
590 <xsl:message>Attempt to use %d in gentext with no referrer!</xsl:message>
594 </xsl:apply-templates>
596 <xsl:when test="$candidate = '%' ">
597 <xsl:text>%</xsl:text>
600 <xsl:text>%</xsl:text><xsl:value-of select="$candidate"/>
603 <!-- recurse with the rest of the template string -->
604 <xsl:variable name="rest"
605 select="substring($template,
606 string-length(substring-before($template, '%'))+3)"/>
607 <xsl:call-template name="substitute-markup">
608 <xsl:with-param name="template" select="$rest"/>
609 <xsl:with-param name="allow-anchors" select="$allow-anchors"/>
610 <xsl:with-param name="title" select="$title"/>
611 <xsl:with-param name="subtitle" select="$subtitle"/>
612 <xsl:with-param name="docname" select="$docname"/>
613 <xsl:with-param name="label" select="$label"/>
614 <xsl:with-param name="pagenumber" select="$pagenumber"/>
615 <xsl:with-param name="purpose" select="$purpose"/>
616 <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
617 <xsl:with-param name="referrer" select="$referrer"/>
618 <xsl:with-param name="verbose" select="$verbose"/>
622 <xsl:value-of select="$template"/>
627 <!-- ============================================================ -->
629 <xsl:template name="make.gentext.template">
630 <xsl:param name="xrefstyle" select="''"/>
631 <xsl:param name="purpose"/>
632 <xsl:param name="referrer"/>
633 <xsl:param name="lang">
634 <xsl:call-template name="l10n.language"/>
636 <xsl:param name="target.elem" select="local-name(.)"/>
638 <!-- Referrer's local name, if any -->
639 <xsl:variable name="referrer.local.name">
640 <xsl:if test="$referrer">
641 <xsl:value-of select="local-name($referrer)"/>
645 <!-- parse xrefstyle to get parts -->
646 <xsl:variable name="parts"
647 select="substring-after(normalize-space($xrefstyle), 'select:')"/>
649 <xsl:variable name="labeltype">
651 <xsl:when test="contains($parts, 'labelnumber')">
652 <xsl:text>labelnumber</xsl:text>
654 <xsl:when test="contains($parts, 'labelname')">
655 <xsl:text>labelname</xsl:text>
657 <xsl:when test="contains($parts, 'label')">
658 <xsl:text>label</xsl:text>
663 <xsl:variable name="titletype">
665 <xsl:when test="contains($parts, 'quotedtitle')">
666 <xsl:text>quotedtitle</xsl:text>
668 <xsl:when test="contains($parts, 'title')">
669 <xsl:text>title</xsl:text>
674 <xsl:variable name="pagetype">
676 <xsl:when test="$insert.olink.page.number = 'no' and
677 $referrer.local.name = 'olink'">
678 <!-- suppress page numbers -->
680 <xsl:when test="$insert.xref.page.number = 'no' and
681 $referrer.local.name != 'olink'">
682 <!-- suppress page numbers -->
684 <xsl:when test="contains($parts, 'nopage')">
685 <xsl:text>nopage</xsl:text>
687 <xsl:when test="contains($parts, 'pagenumber')">
688 <xsl:text>pagenumber</xsl:text>
690 <xsl:when test="contains($parts, 'pageabbrev')">
691 <xsl:text>pageabbrev</xsl:text>
693 <xsl:when test="contains($parts, 'Page')">
694 <xsl:text>Page</xsl:text>
696 <xsl:when test="contains($parts, 'page')">
697 <xsl:text>page</xsl:text>
702 <xsl:variable name="docnametype">
704 <xsl:when test="($olink.doctitle = 0 or
705 $olink.doctitle = 'no') and
706 $referrer.local.name = 'olink'">
707 <!-- suppress docname -->
709 <xsl:when test="contains($parts, 'nodocname')">
710 <xsl:text>nodocname</xsl:text>
712 <xsl:when test="contains($parts, 'docnamelong')">
713 <xsl:text>docnamelong</xsl:text>
715 <xsl:when test="contains($parts, 'docname')">
716 <xsl:text>docname</xsl:text>
721 <xsl:if test="$labeltype != ''">
723 <xsl:when test="$labeltype = 'labelname'">
724 <xsl:call-template name="gentext">
725 <xsl:with-param name="key">
727 <xsl:when test="$referrer.local.name = 'olink'">
728 <xsl:value-of select="$target.elem"/>
731 <xsl:value-of select="local-name(.)"/>
737 <xsl:when test="$labeltype = 'labelnumber'">
738 <xsl:text>%n</xsl:text>
740 <xsl:when test="$labeltype = 'label'">
741 <xsl:call-template name="gentext.template">
742 <xsl:with-param name="context" select="'xref-number'"/>
743 <xsl:with-param name="name">
745 <xsl:when test="$referrer.local.name = 'olink'">
746 <xsl:value-of select="$target.elem"/>
749 <xsl:call-template name="xpath.location"/>
753 <xsl:with-param name="purpose" select="$purpose"/>
754 <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
755 <xsl:with-param name="referrer" select="$referrer"/>
761 <xsl:when test="$titletype != ''">
762 <xsl:value-of select="$xref.label-title.separator"/>
764 <xsl:when test="$pagetype != '' and $pagetype != 'nopage'">
765 <xsl:value-of select="$xref.label-page.separator"/>
770 <xsl:if test="$titletype != ''">
772 <xsl:when test="$titletype = 'title'">
773 <xsl:text>%t</xsl:text>
775 <xsl:when test="$titletype = 'quotedtitle'">
776 <xsl:call-template name="gentext.dingbat">
777 <xsl:with-param name="dingbat" select="'startquote'"/>
779 <xsl:text>%t</xsl:text>
780 <xsl:call-template name="gentext.dingbat">
781 <xsl:with-param name="dingbat" select="'endquote'"/>
787 <xsl:when test="$pagetype != '' and $pagetype != 'nopage'">
788 <xsl:value-of select="$xref.title-page.separator"/>
793 <!-- special case: use regular xref template if just turning off page -->
794 <xsl:if test="($pagetype = 'nopage' or $docnametype = 'nodocname')
795 and $referrer.local.name != 'olink'
797 and $titletype = ''">
798 <xsl:apply-templates select="." mode="object.xref.template">
799 <xsl:with-param name="purpose" select="$purpose"/>
800 <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
801 <xsl:with-param name="referrer" select="$referrer"/>
802 </xsl:apply-templates>
805 <xsl:if test="$pagetype != ''">
807 <xsl:when test="$pagetype = 'page'">
808 <xsl:call-template name="gentext.template">
809 <xsl:with-param name="context" select="'xref'"/>
810 <xsl:with-param name="name" select="'page'"/>
813 <xsl:when test="$pagetype = 'Page'">
814 <xsl:call-template name="gentext.template">
815 <xsl:with-param name="context" select="'xref'"/>
816 <xsl:with-param name="name" select="'Page'"/>
819 <xsl:when test="$pagetype = 'pageabbrev'">
820 <xsl:call-template name="gentext.template">
821 <xsl:with-param name="context" select="'xref'"/>
822 <xsl:with-param name="name" select="'pageabbrev'"/>
825 <xsl:when test="$pagetype = 'pagenumber'">
826 <xsl:text>%p</xsl:text>
832 <!-- Add reference to other document title -->
833 <xsl:if test="$docnametype != '' and $referrer.local.name = 'olink'">
834 <!-- Any separator should be in the gentext template -->
836 <xsl:when test="$docnametype = 'docnamelong'">
837 <xsl:call-template name="gentext.template">
838 <xsl:with-param name="context" select="'xref'"/>
839 <xsl:with-param name="name" select="'docnamelong'"/>
842 <xsl:when test="$docnametype = 'docname'">
843 <xsl:call-template name="gentext.template">
844 <xsl:with-param name="context" select="'xref'"/>
845 <xsl:with-param name="name" select="'docname'"/>