root/docs/docbook-xsl/fo/refentry.xsl

Revision dd168777927c3e66a41031360333a8744b943b32, 24.7 kB (checked in by Theo Schlossnagle <jesus@omniti.com>, 4 years ago)

Update of docbook-xsl fixes manpage creation.

  • Property mode set to 100644
Line 
1 <?xml version='1.0'?>
2 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
3                 xmlns:fo="http://www.w3.org/1999/XSL/Format"
4                 xmlns:axf="http://www.antennahouse.com/names/XSL/Extensions"
5                 version='1.0'>
6
7 <!-- ********************************************************************
8      $Id: refentry.xsl 9647 2012-10-26 17:42:03Z bobstayton $
9      ********************************************************************
10
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.
14
15      ******************************************************************** -->
16
17 <!-- ==================================================================== -->
18
19 <xsl:template match="reference">
20    <!-- If there is a partintro, it triggers the page  sequence -->
21    <xsl:if test="not(partintro)">
22     <xsl:variable name="id">
23       <xsl:call-template name="object.id"/>
24     </xsl:variable>
25     <xsl:variable name="master-reference">
26       <xsl:call-template name="select.pagemaster"/>
27     </xsl:variable>
28
29     <fo:page-sequence hyphenate="{$hyphenate}"
30                       master-reference="{$master-reference}">
31       <xsl:attribute name="language">
32         <xsl:call-template name="l10n.language"/>
33       </xsl:attribute>
34       <xsl:attribute name="format">
35         <xsl:call-template name="page.number.format">
36           <xsl:with-param name="master-reference" select="$master-reference"/>
37         </xsl:call-template>
38       </xsl:attribute>
39
40       <xsl:attribute name="initial-page-number">
41         <xsl:call-template name="initial.page.number">
42           <xsl:with-param name="master-reference" select="$master-reference"/>
43         </xsl:call-template>
44       </xsl:attribute>
45
46       <xsl:attribute name="force-page-count">
47         <xsl:call-template name="force.page.count">
48           <xsl:with-param name="master-reference" select="$master-reference"/>
49         </xsl:call-template>
50       </xsl:attribute>
51
52       <xsl:attribute name="hyphenation-character">
53         <xsl:call-template name="gentext">
54           <xsl:with-param name="key" select="'hyphenation-character'"/>
55         </xsl:call-template>
56       </xsl:attribute>
57       <xsl:attribute name="hyphenation-push-character-count">
58         <xsl:call-template name="gentext">
59           <xsl:with-param name="key" select="'hyphenation-push-character-count'"/>
60         </xsl:call-template>
61       </xsl:attribute>
62       <xsl:attribute name="hyphenation-remain-character-count">
63         <xsl:call-template name="gentext">
64           <xsl:with-param name="key" select="'hyphenation-remain-character-count'"/>
65         </xsl:call-template>
66       </xsl:attribute>
67
68       <xsl:apply-templates select="." mode="running.head.mode">
69         <xsl:with-param name="master-reference" select="$master-reference"/>
70       </xsl:apply-templates>
71       <xsl:apply-templates select="." mode="running.foot.mode">
72         <xsl:with-param name="master-reference" select="$master-reference"/>
73       </xsl:apply-templates>
74
75       <fo:flow flow-name="xsl-region-body">
76         <xsl:call-template name="set.flow.properties">
77           <xsl:with-param name="element" select="local-name(.)"/>
78           <xsl:with-param name="master-reference" select="$master-reference"/>
79         </xsl:call-template>
80
81         <fo:block id="{$id}">
82           <xsl:call-template name="reference.titlepage"/>
83         </fo:block>
84
85         <xsl:variable name="toc.params">
86           <xsl:call-template name="find.path.params">
87             <xsl:with-param name="table"
88                             select="normalize-space($generate.toc)"/>
89           </xsl:call-template>
90         </xsl:variable>
91         <xsl:if test="contains($toc.params, 'toc')">
92           <xsl:call-template name="component.toc">
93             <xsl:with-param name="toc.title.p"
94                             select="contains($toc.params, 'title')"/>
95           </xsl:call-template>
96           <xsl:call-template name="component.toc.separator"/>
97         </xsl:if>
98
99         <!-- Create one page sequence if no pagebreaks needed -->
100         <xsl:if test="$refentry.pagebreak = 0">
101           <xsl:apply-templates select="refentry"/>
102         </xsl:if>
103       </fo:flow>
104     </fo:page-sequence>
105   </xsl:if>
106   <xsl:apply-templates select="partintro"/>
107   <xsl:if test="$refentry.pagebreak != 0">
108     <xsl:apply-templates select="refentry"/>
109   </xsl:if>
110 </xsl:template>
111
112 <xsl:template match="reference" mode="reference.titlepage.mode">
113   <xsl:call-template name="reference.titlepage"/>
114 </xsl:template>
115
116 <xsl:template match="reference/partintro">
117   <xsl:variable name="id">
118     <xsl:call-template name="object.id">
119       <xsl:with-param name="object" select="ancestor::reference"/>
120     </xsl:call-template>
121   </xsl:variable>
122   <xsl:variable name="master-reference">
123     <xsl:call-template name="select.pagemaster"/>
124   </xsl:variable>
125
126   <fo:page-sequence hyphenate="{$hyphenate}"
127                     master-reference="{$master-reference}">
128     <xsl:attribute name="language">
129       <xsl:call-template name="l10n.language"/>
130     </xsl:attribute>
131     <xsl:attribute name="format">
132       <xsl:call-template name="page.number.format">
133         <xsl:with-param name="master-reference" select="$master-reference"/>
134       </xsl:call-template>
135     </xsl:attribute>
136
137     <xsl:attribute name="initial-page-number">
138       <xsl:call-template name="initial.page.number">
139         <xsl:with-param name="master-reference" select="$master-reference"/>
140       </xsl:call-template>
141     </xsl:attribute>
142
143     <xsl:attribute name="force-page-count">
144       <xsl:call-template name="force.page.count">
145         <xsl:with-param name="master-reference" select="$master-reference"/>
146       </xsl:call-template>
147     </xsl:attribute>
148
149     <xsl:attribute name="hyphenation-character">
150       <xsl:call-template name="gentext">
151         <xsl:with-param name="key" select="'hyphenation-character'"/>
152       </xsl:call-template>
153     </xsl:attribute>
154     <xsl:attribute name="hyphenation-push-character-count">
155       <xsl:call-template name="gentext">
156         <xsl:with-param name="key" select="'hyphenation-push-character-count'"/>
157       </xsl:call-template>
158     </xsl:attribute>
159     <xsl:attribute name="hyphenation-remain-character-count">
160       <xsl:call-template name="gentext">
161         <xsl:with-param name="key" select="'hyphenation-remain-character-count'"/>
162       </xsl:call-template>
163     </xsl:attribute>
164
165     <xsl:apply-templates select="." mode="running.head.mode">
166       <xsl:with-param name="master-reference" select="$master-reference"/>
167     </xsl:apply-templates>
168     <xsl:apply-templates select="." mode="running.foot.mode">
169       <xsl:with-param name="master-reference" select="$master-reference"/>
170     </xsl:apply-templates>
171
172     <fo:flow flow-name="xsl-region-body">
173       <xsl:call-template name="set.flow.properties">
174         <xsl:with-param name="element" select="local-name(.)"/>
175         <xsl:with-param name="master-reference" select="$master-reference"/>
176       </xsl:call-template>
177       <fo:block id="{$id}">
178         <xsl:apply-templates select=".." mode="reference.titlepage.mode"/>
179       </fo:block>
180       <xsl:if test="title">
181         <xsl:call-template name="partintro.titlepage"/>
182       </xsl:if>
183       <xsl:apply-templates/>
184
185       <!-- switch contexts to generate any toc -->
186       <xsl:for-each select="..">
187         <xsl:variable name="toc.params">
188           <xsl:call-template name="find.path.params">
189             <xsl:with-param name="table"
190                             select="normalize-space($generate.toc)"/>
191           </xsl:call-template>
192         </xsl:variable>
193         <xsl:if test="contains($toc.params, 'toc')">
194           <xsl:call-template name="component.toc">
195             <xsl:with-param name="toc.title.p"
196                             select="contains($toc.params, 'title')"/>
197           </xsl:call-template>
198           <xsl:call-template name="component.toc.separator"/>
199         </xsl:if>
200       </xsl:for-each>
201
202       <!-- Create one page sequence if no pagebreaks needed -->
203       <xsl:if test="$refentry.pagebreak = 0">
204         <xsl:apply-templates select="../refentry"/>
205       </xsl:if>
206     </fo:flow>
207   </fo:page-sequence>
208 </xsl:template>
209
210 <xsl:template match="reference/docinfo|refentry/refentryinfo"></xsl:template>
211 <xsl:template match="reference/info"></xsl:template>
212 <xsl:template match="reference/title"></xsl:template>
213 <xsl:template match="reference/subtitle"></xsl:template>
214
215 <!-- ==================================================================== -->
216
217 <xsl:template match="refentry">
218   <xsl:variable name="id">
219     <xsl:call-template name="object.id"/>
220   </xsl:variable>
221
222   <xsl:variable name="master-reference">
223     <xsl:call-template name="select.pagemaster"/>
224   </xsl:variable>
225
226   <xsl:variable name="refentry.content">
227     <fo:block id="{$id}">
228       <xsl:apply-templates/>
229     </fo:block>
230   </xsl:variable>
231
232   <xsl:choose>
233     <xsl:when test="not(parent::*) or
234                     (parent::reference and $refentry.pagebreak != 0) or
235                     parent::part">
236       <!-- make a page sequence -->
237       <fo:page-sequence hyphenate="{$hyphenate}"
238                         master-reference="{$master-reference}">
239         <xsl:attribute name="language">
240           <xsl:call-template name="l10n.language"/>
241         </xsl:attribute>
242         <xsl:attribute name="format">
243           <xsl:call-template name="page.number.format">
244             <xsl:with-param name="master-reference" select="$master-reference"/>
245           </xsl:call-template>
246         </xsl:attribute>
247
248         <xsl:attribute name="initial-page-number">
249           <xsl:call-template name="initial.page.number">
250             <xsl:with-param name="master-reference" select="$master-reference"/>
251           </xsl:call-template>
252         </xsl:attribute>
253
254         <xsl:attribute name="force-page-count">
255           <xsl:call-template name="force.page.count">
256             <xsl:with-param name="master-reference" select="$master-reference"/>
257           </xsl:call-template>
258         </xsl:attribute>
259
260         <xsl:attribute name="hyphenation-character">
261           <xsl:call-template name="gentext">
262             <xsl:with-param name="key" select="'hyphenation-character'"/>
263           </xsl:call-template>
264         </xsl:attribute>
265         <xsl:attribute name="hyphenation-push-character-count">
266           <xsl:call-template name="gentext">
267             <xsl:with-param name="key" select="'hyphenation-push-character-count'"/>
268           </xsl:call-template>
269         </xsl:attribute>
270         <xsl:attribute name="hyphenation-remain-character-count">
271           <xsl:call-template name="gentext">
272             <xsl:with-param name="key" select="'hyphenation-remain-character-count'"/>
273           </xsl:call-template>
274         </xsl:attribute>
275
276         <xsl:apply-templates select="." mode="running.head.mode">
277           <xsl:with-param name="master-reference" select="$master-reference"/>
278         </xsl:apply-templates>
279         <xsl:apply-templates select="." mode="running.foot.mode">
280           <xsl:with-param name="master-reference" select="$master-reference"/>
281         </xsl:apply-templates>
282
283         <fo:flow flow-name="xsl-region-body">
284           <xsl:call-template name="set.flow.properties">
285             <xsl:with-param name="element" select="local-name(.)"/>
286             <xsl:with-param name="master-reference" select="$master-reference"/>
287           </xsl:call-template>
288
289           <xsl:copy-of select="$refentry.content"/>
290         </fo:flow>
291       </fo:page-sequence>
292     </xsl:when>
293     <xsl:otherwise>
294       <fo:block>
295         <xsl:if test="$refentry.pagebreak != 0">
296           <xsl:attribute name="break-before">page</xsl:attribute>
297         </xsl:if>
298         <xsl:copy-of select="$refentry.content"/>
299       </fo:block>
300     </xsl:otherwise>
301   </xsl:choose>
302 </xsl:template>
303
304 <xsl:template match="refmeta">
305   <xsl:apply-templates select=".//indexterm"/>
306 </xsl:template>
307
308 <xsl:template match="manvolnum">
309   <xsl:if test="$refentry.xref.manvolnum != 0">
310     <xsl:text>(</xsl:text>
311     <xsl:apply-templates/>
312     <xsl:text>)</xsl:text>
313   </xsl:if>
314 </xsl:template>
315
316 <xsl:template match="refmiscinfo">
317 </xsl:template>
318
319 <xsl:template match="refentrytitle">
320   <xsl:call-template name="inline.charseq"/>
321 </xsl:template>
322
323 <xsl:template match="refnamediv">
324   <xsl:variable name="id">
325     <xsl:call-template name="object.id"/>
326   </xsl:variable>
327
328   <fo:block id="{$id}">
329
330     <!-- if refentry.generate.name is non-zero, then we need to generate a -->
331     <!-- localized "Name" subheading for this refnamdiv (unless it has a -->
332     <!-- preceding sibling that is a refnamediv, in which case we have already -->
333     <!-- generated a "Name" subheading, so we don't need to do it again -->
334     <xsl:if test="$refentry.generate.name != 0">
335         <xsl:choose>
336           <xsl:when test="preceding-sibling::refnamediv">
337             <!-- no generated title on secondary refnamedivs! -->
338           </xsl:when>
339           <xsl:otherwise>
340             <fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format"
341                       xsl:use-attribute-sets="refnamediv.titlepage.recto.style"
342                       font-family="{$title.fontset}">
343               <!-- Contents of what is now the format.refentry.subheading -->
344               <!-- template were formerly intended to be used only to -->
345               <!-- process those subsections of Refentry that have "real" -->
346               <!-- title children. So as a kludge to get around the fact -->
347               <!-- that the template still basically "expects" to be -->
348               <!-- processing that kind of a node, when we call the -->
349               <!-- template to process generated titles, we must call it -->
350               <!-- with values for the "offset" and "section" parameters -->
351               <!-- that are different from the default values in the -->
352               <!-- format.refentry.subheading template itself. Because -->
353               <!-- those defaults are the values appropriate for processing -->
354               <!-- "real" title nodes. -->
355               <xsl:call-template name="format.refentry.subheading">
356                 <xsl:with-param name="section" select="self::*"/>
357                 <xsl:with-param name="offset" select="1"/>
358                 <xsl:with-param name="gentext.key" select="'RefName'"/>
359               </xsl:call-template>
360             </fo:block>
361           </xsl:otherwise>
362         </xsl:choose>
363       </xsl:if>
364
365       <xsl:if test="$refentry.generate.title != 0">
366   <xsl:variable name="section.level">
367     <xsl:call-template name="refentry.level">
368       <xsl:with-param name="node" select="ancestor::refentry"/>
369     </xsl:call-template>
370   </xsl:variable>
371
372   <xsl:variable name="reftitle">
373         <xsl:choose>
374           <xsl:when test="../refmeta/refentrytitle">
375             <xsl:apply-templates select="../refmeta/refentrytitle"/>
376           </xsl:when>
377           <xsl:otherwise>
378             <xsl:apply-templates select="refname[1]"/>
379           </xsl:otherwise>
380         </xsl:choose>
381   </xsl:variable>
382
383   <!-- xsl:use-attribute-sets takes only a Qname, not a variable -->
384     <xsl:choose>
385       <xsl:when test="preceding-sibling::refnamediv">
386         <!-- no title on secondary refnamedivs! -->
387       </xsl:when>
388       <xsl:when test="$section.level = 1">
389         <fo:block xsl:use-attribute-sets="refentry.title.properties">
390           <fo:block xsl:use-attribute-sets="section.title.level1.properties">
391             <xsl:value-of select="$reftitle"/>
392           </fo:block>
393         </fo:block>
394       </xsl:when>
395       <xsl:when test="$section.level = 2">
396         <fo:block xsl:use-attribute-sets="refentry.title.properties">
397           <fo:block xsl:use-attribute-sets="section.title.level2.properties">
398             <xsl:value-of select="$reftitle"/>
399           </fo:block>
400         </fo:block>
401       </xsl:when>
402       <xsl:when test="$section.level = 3">
403         <fo:block xsl:use-attribute-sets="refentry.title.properties">
404           <fo:block xsl:use-attribute-sets="section.title.level3.properties">
405             <xsl:value-of select="$reftitle"/>
406           </fo:block>
407         </fo:block>
408       </xsl:when>
409       <xsl:when test="$section.level = 4">
410         <fo:block xsl:use-attribute-sets="refentry.title.properties">
411           <fo:block xsl:use-attribute-sets="section.title.level4.properties">
412             <xsl:value-of select="$reftitle"/>
413           </fo:block>
414         </fo:block>
415       </xsl:when>
416       <xsl:when test="$section.level = 5">
417         <fo:block xsl:use-attribute-sets="refentry.title.properties">
418           <fo:block xsl:use-attribute-sets="section.title.level5.properties">
419             <xsl:value-of select="$reftitle"/>
420           </fo:block>
421         </fo:block>
422       </xsl:when>
423       <xsl:otherwise>
424         <fo:block xsl:use-attribute-sets="refentry.title.properties">
425           <fo:block xsl:use-attribute-sets="section.title.level6.properties">
426             <xsl:value-of select="$reftitle"/>
427           </fo:block>
428         </fo:block>
429       </xsl:otherwise>
430     </xsl:choose>
431     </xsl:if>
432
433     <fo:block>
434       <xsl:if test="not(following-sibling::refnamediv)">
435         <xsl:attribute name="space-after">1em</xsl:attribute>
436       </xsl:if>
437       <xsl:apply-templates/>
438     </fo:block>
439   </fo:block>
440 </xsl:template>
441
442 <xsl:template match="refname">
443   <xsl:if test="not(preceding-sibling::refdescriptor)">
444     <xsl:apply-templates/>
445     <xsl:if test="following-sibling::refname">
446       <xsl:text>, </xsl:text>
447     </xsl:if>
448   </xsl:if>
449 </xsl:template>
450
451 <xsl:template match="refpurpose">
452   <xsl:if test="node()">
453     <xsl:text> </xsl:text>
454     <xsl:call-template name="dingbat">
455       <xsl:with-param name="dingbat">em-dash</xsl:with-param>
456     </xsl:call-template>
457     <xsl:text> </xsl:text>
458     <xsl:apply-templates/>
459   </xsl:if>
460 </xsl:template>
461
462 <xsl:template match="refdescriptor">
463   <xsl:apply-templates/>
464 </xsl:template>
465
466 <xsl:template match="refclass">
467   <xsl:if test="$refclass.suppress = 0">
468   <fo:block font-weight="bold">
469     <xsl:if test="@role">
470       <xsl:value-of select="@role"/>
471       <xsl:text>: </xsl:text>
472     </xsl:if>
473     <xsl:apply-templates/>
474   </fo:block>
475   </xsl:if>
476 </xsl:template>
477
478 <xsl:template match="refsynopsisdiv">
479   <xsl:variable name="id">
480     <xsl:call-template name="object.id"/>
481   </xsl:variable>
482
483   <fo:block id="{$id}">
484     <xsl:if test="not(refsynopsisdivinfo/title|docinfo/title|info/title|title)">
485       <!-- * if we there is no appropriate title for this Refsynopsisdiv, -->
486       <!-- * then we need to call format.refentry.subheading to generate one -->
487       <fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format"
488                 xsl:use-attribute-sets="refsynopsisdiv.titlepage.recto.style"
489                 font-family="{$title.fontset}">
490         <!-- Contents of what is now the format.refentry.subheading -->
491         <!-- template were formerly intended to be used only to -->
492         <!-- process those subsections of Refentry that have "real" -->
493         <!-- title children. So as a kludge to get around the fact -->
494         <!-- that the template still basically "expects" to be -->
495         <!-- processing that kind of a node, when we call the -->
496         <!-- template to process generated titles, we must call it -->
497         <!-- with values for the "offset" and "section" parameters -->
498         <!-- that are different from the default values in the -->
499         <!-- format.refentry.subheading template itself. Because -->
500         <!-- those defaults are the values appropriate for processing -->
501         <!-- "real" title nodes. -->
502         <xsl:call-template name="format.refentry.subheading">
503           <xsl:with-param name="section" select="parent::*"/>
504           <xsl:with-param name="offset" select="1"/>
505           <xsl:with-param name="gentext.key" select="'RefSynopsisDiv'"/>
506         </xsl:call-template>
507       </fo:block>
508     </xsl:if>
509     <xsl:call-template name="refsynopsisdiv.titlepage"/>
510     <xsl:apply-templates/>
511   </fo:block>
512 </xsl:template>
513
514 <xsl:template match="refsection">
515   <xsl:variable name="id">
516     <xsl:call-template name="object.id"/>
517   </xsl:variable>
518
519   <fo:block id="{$id}">
520     <xsl:call-template name="refsection.titlepage"/>
521     <xsl:apply-templates/>
522   </fo:block>
523 </xsl:template>
524
525 <xsl:template match="refsect1">
526   <xsl:variable name="id">
527     <xsl:call-template name="object.id"/>
528   </xsl:variable>
529
530   <fo:block id="{$id}">
531     <xsl:call-template name="refsect1.titlepage"/>
532     <xsl:apply-templates/>
533   </fo:block>
534 </xsl:template>
535
536 <xsl:template match="refsect2">
537   <xsl:variable name="id">
538     <xsl:call-template name="object.id"/>
539   </xsl:variable>
540
541   <fo:block id="{$id}">
542     <xsl:call-template name="refsect2.titlepage"/>
543     <xsl:apply-templates/>
544   </fo:block>
545 </xsl:template>
546
547 <xsl:template match="refsect3">
548   <xsl:variable name="id">
549     <xsl:call-template name="object.id"/>
550   </xsl:variable>
551
552   <fo:block id="{$id}">
553     <xsl:call-template name="refsect3.titlepage"/>
554     <xsl:apply-templates/>
555   </fo:block>
556 </xsl:template>
557
558 <xsl:template match="refsynopsisdiv/title
559                      |refsection/title
560                      |refsect1/title
561                      |refsect2/title
562                      |refsect3/title">
563   <!-- nop; titlepage.mode instead -->
564 </xsl:template>
565
566 <xsl:template match="refsynopsisdiv/title
567                      |refsection/title
568                      |refsect1/title
569                      |refsect2/title
570                      |refsect3/title
571                      |refsynopsisdiv/info/title
572                      |refsection/info/title
573                      |refsect1/info/title
574                      |refsect2/info/title
575                      |refsect3/info/title"
576               mode="titlepage.mode"
577               priority="2">
578   <xsl:call-template name="format.refentry.subheading"/>
579 </xsl:template>
580
581 <xsl:template name="format.refentry.subheading">
582 <!-- This template is now called to process generated titles for -->
583 <!-- Refnamediv and Refsynopsisdiv, as well as "real" titles for -->
584 <!-- Refsynopsisdiv, Refsection, and Refsect[1-3]. -->
585 <!-- -->
586 <!-- But the contents of this template were formerly intended to be used -->
587 <!-- only to process those subsections of Refentry that have "real" title -->
588 <!-- children. So as a kludge to get around the fact that the template -->
589 <!-- still basically "expects" to be processing that kind of a node, the -->
590 <!-- "offset" parameter was added and the "section" variable was changed to -->
591 <!-- a parameter so that when called for a generated title on a Refnamediv -->
592 <!-- or Refsynopsisdiv, we can call it like this: -->
593 <!-- -->
594 <!--     <xsl:call-template name="format.refentry.subheading"> -->
595 <!--       <xsl:with-param name="section" select="self::*"/> -->
596 <!--       <xsl:with-param name="offset" select="1"/> -->
597 <!--       <xsl:with-param name="gentext.key" select="'RefName'"/> -->
598 <!--     </xsl:call-template> -->
599 <!-- -->
600   <xsl:param name="section"
601              select="(ancestor::refsynopsisdiv
602                      |ancestor::refsection
603                      |ancestor::refsect1
604                      |ancestor::refsect2
605                      |ancestor::refsect3)[last()]"/>
606   <xsl:param name="offset" select="0"/>
607   <xsl:param name="gentext.key"/>
608
609   <fo:block keep-with-next.within-column="always">
610     <xsl:variable name="id">
611       <xsl:call-template name="object.id">
612         <xsl:with-param name="object" select="$section"/>
613       </xsl:call-template>
614     </xsl:variable>
615
616     <xsl:variable name="level">
617       <xsl:call-template name="section.level">
618         <xsl:with-param name="node" select="$section"/>
619       </xsl:call-template>
620     </xsl:variable>
621
622     <xsl:variable name="title">
623       <!-- If we have a non-empty value for the $gentext.key param, then we -->
624       <!-- generate an appropriate title here. Otherwise, we have a real -->
625       <!-- title child, so we copy contents of that to the result tree. -->
626       <xsl:choose>
627         <xsl:when test="$gentext.key != ''">
628           <xsl:call-template name="gentext">
629             <xsl:with-param name="key" select="$gentext.key"/>
630           </xsl:call-template>
631         </xsl:when>
632         <xsl:otherwise>
633           <xsl:apply-templates select="$section" mode="object.title.markup">
634             <xsl:with-param name="allow-anchors" select="1"/>
635           </xsl:apply-templates>
636         </xsl:otherwise>
637       </xsl:choose>
638     </xsl:variable>
639
640     <xsl:if test="$axf.extensions != 0">
641       <xsl:attribute name="axf:outline-level">
642         <xsl:value-of select="count(ancestor::*)-1 + $offset"/>
643       </xsl:attribute>
644       <xsl:attribute name="axf:outline-expand">false</xsl:attribute>
645       <xsl:attribute name="axf:outline-title">
646         <xsl:value-of select="$title"/>
647       </xsl:attribute>
648     </xsl:if>
649
650     <xsl:call-template name="section.heading">
651       <xsl:with-param name="level" select="$level + $offset"/>
652       <xsl:with-param name="title" select="$title"/>
653     </xsl:call-template>
654   </fo:block>
655 </xsl:template>
656
657 <xsl:template match="refsectioninfo|refsection/info"></xsl:template>
658 <xsl:template match="refsect1info|refsect1/info"></xsl:template>
659 <xsl:template match="refsect2info|refsect2/info"></xsl:template>
660 <xsl:template match="refsect3info|refsect3/info"></xsl:template>
661
662 <!-- ==================================================================== -->
663
664 </xsl:stylesheet>
Note: See TracBrowser for help on using the browser.