Whamcloud - gitweb
LUDOC-120 presentation: build bits for webhelp.
[doc/manual.git] / webhelp / xhtml / profile-chunk-code.xsl
1 <?xml version="1.0" encoding="ASCII"?>
2 <!--This file was created automatically by html2xhtml-->
3 <!--from the HTML stylesheets.-->
4 <!--This file was created automatically by xsl2profile-->
5 <!--from the DocBook XSL stylesheets.-->
6 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:exsl="http://exslt.org/common" xmlns:cf="http://docbook.sourceforge.net/xmlns/chunkfast/1.0" xmlns:exslt="http://exslt.org/common" xmlns:ng="http://docbook.org/docbook-ng" xmlns:db="http://docbook.org/ns/docbook" xmlns="http://www.w3.org/1999/xhtml" exslt:dummy="dummy" ng:dummy="dummy" db:dummy="dummy" extension-element-prefixes="exslt" exclude-result-prefixes="exsl cf exslt" version="1.0">
7
8 <!-- ********************************************************************
9      $Id: chunk-code.xsl 9936 2014-08-29 21:34:58Z bobstayton $
10      ********************************************************************
11
12      This file is part of the XSL DocBook Stylesheet distribution.
13      See ../README or http://docbook.sf.net/release/xsl/current/ for
14      copyright and other information.
15
16      ******************************************************************** -->
17
18 <!-- ==================================================================== -->
19
20
21 <xsl:template match="*" mode="chunk-filename">
22   <!-- returns the filename of a chunk -->
23   <xsl:variable name="ischunk">
24     <xsl:call-template name="chunk"/>
25   </xsl:variable>
26
27   <xsl:variable name="fn">
28     <xsl:apply-templates select="." mode="recursive-chunk-filename"/>
29   </xsl:variable>
30
31   <!--
32   <xsl:message>
33     <xsl:value-of select="$ischunk"/>
34     <xsl:text> (</xsl:text>
35     <xsl:value-of select="local-name(.)"/>
36     <xsl:text>) </xsl:text>
37     <xsl:value-of select="$fn"/>
38     <xsl:text>, </xsl:text>
39     <xsl:call-template name="dbhtml-dir"/>
40   </xsl:message>
41   -->
42
43   <!-- 2003-11-25 by ndw:
44        The following test used to read test="$ischunk != 0 and $fn != ''"
45        I've removed the ischunk part of the test so that href.to.uri and
46        href.from.uri will be fully qualified even if the source or target
47        isn't a chunk. I *think* that if $fn != '' then it's appropriate
48        to put the directory on the front, even if the element isn't a
49        chunk. I could be wrong. -->
50
51   <xsl:if test="$fn != ''">
52     <xsl:call-template name="dbhtml-dir"/>
53   </xsl:if>
54
55   <xsl:value-of select="$chunked.filename.prefix"/>
56
57   <xsl:value-of select="$fn"/>
58   <!-- You can't add the html.ext here because dbhtml filename= may already -->
59   <!-- have added it. It really does have to be handled in the recursive template -->
60 </xsl:template>
61
62 <xsl:template match="*" mode="recursive-chunk-filename">
63   <xsl:param name="recursive" select="false()"/>
64
65   <!-- returns the filename of a chunk -->
66   <xsl:variable name="ischunk">
67     <xsl:call-template name="chunk"/>
68   </xsl:variable>
69
70   <xsl:variable name="dbhtml-filename">
71     <xsl:call-template name="pi.dbhtml_filename"/>
72   </xsl:variable>
73
74   <xsl:variable name="filename">
75     <xsl:choose>
76       <xsl:when test="$dbhtml-filename != ''">
77         <xsl:value-of select="$dbhtml-filename"/>
78       </xsl:when>
79       <!-- if this is the root element, use the root.filename -->
80       <xsl:when test="not(parent::*) and $root.filename != ''">
81         <xsl:value-of select="$root.filename"/>
82         <xsl:value-of select="$html.ext"/>
83       </xsl:when>
84       <!-- Special case -->
85       <xsl:when test="self::legalnotice and not($generate.legalnotice.link = 0)">
86         <xsl:choose>
87           <xsl:when test="(@id or @xml:id) and not($use.id.as.filename = 0)">
88             <!-- * if this legalnotice has an ID, then go ahead and use -->
89             <!-- * just the value of that ID as the basename for the file -->
90             <!-- * (that is, without prepending an "ln-" too it) -->
91             <xsl:value-of select="(@id|@xml:id)[1]"/>
92             <xsl:value-of select="$html.ext"/>
93           </xsl:when>
94           <xsl:otherwise>
95             <!-- * otherwise, if this legalnotice does not have an ID, -->
96             <!-- * then we generate an ID... -->
97             <xsl:variable name="id">
98               <xsl:call-template name="object.id"/>
99             </xsl:variable>
100             <!-- * ...and then we take that generated ID, prepend an -->
101             <!-- * "ln-" to it, and use that as the basename for the file -->
102             <xsl:value-of select="concat('ln-',$id,$html.ext)"/>
103           </xsl:otherwise>
104         </xsl:choose>
105       </xsl:when>
106       <!-- if there's no dbhtml filename, and if we're to use IDs as -->
107       <!-- filenames, then use the ID to generate the filename. -->
108       <xsl:when test="(@id or @xml:id) and $use.id.as.filename != 0">
109         <xsl:value-of select="(@id|@xml:id)[1]"/>
110         <xsl:value-of select="$html.ext"/>
111       </xsl:when>
112       <xsl:otherwise/>
113     </xsl:choose>
114   </xsl:variable>
115
116   <xsl:choose>
117     <xsl:when test="$ischunk='0'">
118       <!-- if called on something that isn't a chunk, walk up... -->
119       <xsl:choose>
120         <xsl:when test="count(parent::*)&gt;0">
121           <xsl:apply-templates mode="recursive-chunk-filename" select="parent::*">
122             <xsl:with-param name="recursive" select="$recursive"/>
123           </xsl:apply-templates>
124         </xsl:when>
125         <!-- unless there is no up, in which case return "" -->
126         <xsl:otherwise/>
127       </xsl:choose>
128     </xsl:when>
129
130     <xsl:when test="not($recursive) and $filename != ''">
131       <!-- if this chunk has an explicit name, use it -->
132       <xsl:value-of select="$filename"/>
133     </xsl:when>
134
135     <!-- treat nested set separate from root -->
136     <xsl:when test="self::set and ancestor::set">
137       <xsl:text>se</xsl:text>
138       <xsl:number level="any" format="01"/>
139       <xsl:if test="not($recursive)">
140         <xsl:value-of select="$html.ext"/>
141       </xsl:if>
142     </xsl:when>
143
144     <xsl:when test="self::set">
145       <xsl:value-of select="$root.filename"/>
146       <xsl:if test="not($recursive)">
147         <xsl:value-of select="$html.ext"/>
148       </xsl:if>
149     </xsl:when>
150
151     <xsl:when test="self::book">
152       <xsl:text>bk</xsl:text>
153       <xsl:number level="any" format="01"/>
154       <xsl:if test="not($recursive)">
155         <xsl:value-of select="$html.ext"/>
156       </xsl:if>
157     </xsl:when>
158
159     <xsl:when test="self::article">
160       <xsl:if test="/set">
161         <!-- in a set, make sure we inherit the right book info... -->
162         <xsl:apply-templates mode="recursive-chunk-filename" select="parent::*">
163           <xsl:with-param name="recursive" select="true()"/>
164         </xsl:apply-templates>
165       </xsl:if>
166
167       <xsl:text>ar</xsl:text>
168       <xsl:number level="any" format="01" from="book"/>
169       <xsl:if test="not($recursive)">
170         <xsl:value-of select="$html.ext"/>
171       </xsl:if>
172     </xsl:when>
173
174     <xsl:when test="self::preface">
175       <xsl:if test="/set">
176         <!-- in a set, make sure we inherit the right book info... -->
177         <xsl:apply-templates mode="recursive-chunk-filename" select="parent::*">
178           <xsl:with-param name="recursive" select="true()"/>
179         </xsl:apply-templates>
180       </xsl:if>
181
182       <xsl:text>pr</xsl:text>
183       <xsl:number level="any" format="01" from="book"/>
184       <xsl:if test="not($recursive)">
185         <xsl:value-of select="$html.ext"/>
186       </xsl:if>
187     </xsl:when>
188
189     <xsl:when test="self::chapter">
190       <xsl:if test="/set">
191         <!-- in a set, make sure we inherit the right book info... -->
192         <xsl:apply-templates mode="recursive-chunk-filename" select="parent::*">
193           <xsl:with-param name="recursive" select="true()"/>
194         </xsl:apply-templates>
195       </xsl:if>
196
197       <xsl:text>ch</xsl:text>
198       <xsl:number level="any" format="01" from="book"/>
199       <xsl:if test="not($recursive)">
200         <xsl:value-of select="$html.ext"/>
201       </xsl:if>
202     </xsl:when>
203
204     <xsl:when test="self::appendix">
205       <xsl:if test="/set">
206         <!-- in a set, make sure we inherit the right book info... -->
207         <xsl:apply-templates mode="recursive-chunk-filename" select="parent::*">
208           <xsl:with-param name="recursive" select="true()"/>
209         </xsl:apply-templates>
210       </xsl:if>
211
212       <xsl:text>ap</xsl:text>
213       <xsl:number level="any" format="a" from="book"/>
214       <xsl:if test="not($recursive)">
215         <xsl:value-of select="$html.ext"/>
216       </xsl:if>
217     </xsl:when>
218
219     <xsl:when test="self::part">
220       <xsl:choose>
221         <xsl:when test="/set">
222           <!-- in a set, make sure we inherit the right book info... -->
223           <xsl:apply-templates mode="recursive-chunk-filename" select="parent::*">
224             <xsl:with-param name="recursive" select="true()"/>
225           </xsl:apply-templates>
226         </xsl:when>
227         <xsl:otherwise>
228         </xsl:otherwise>
229       </xsl:choose>
230
231       <xsl:text>pt</xsl:text>
232       <xsl:number level="any" format="01" from="book"/>
233       <xsl:if test="not($recursive)">
234         <xsl:value-of select="$html.ext"/>
235       </xsl:if>
236     </xsl:when>
237
238     <xsl:when test="self::reference">
239       <xsl:choose>
240         <xsl:when test="/set">
241           <!-- in a set, make sure we inherit the right book info... -->
242           <xsl:apply-templates mode="recursive-chunk-filename" select="parent::*">
243             <xsl:with-param name="recursive" select="true()"/>
244           </xsl:apply-templates>
245         </xsl:when>
246         <xsl:otherwise>
247         </xsl:otherwise>
248       </xsl:choose>
249
250       <xsl:text>rn</xsl:text>
251       <xsl:number level="any" format="01" from="book"/>
252       <xsl:if test="not($recursive)">
253         <xsl:value-of select="$html.ext"/>
254       </xsl:if>
255     </xsl:when>
256
257     <xsl:when test="self::refentry">
258       <xsl:choose>
259         <xsl:when test="parent::reference">
260           <xsl:apply-templates mode="recursive-chunk-filename" select="parent::*">
261             <xsl:with-param name="recursive" select="true()"/>
262           </xsl:apply-templates>
263         </xsl:when>
264         <xsl:otherwise>
265           <xsl:if test="/set">
266             <!-- in a set, make sure we inherit the right book info... -->
267             <xsl:apply-templates mode="recursive-chunk-filename" select="parent::*">
268               <xsl:with-param name="recursive" select="true()"/>
269             </xsl:apply-templates>
270           </xsl:if>
271         </xsl:otherwise>
272       </xsl:choose>
273
274       <xsl:text>re</xsl:text>
275       <xsl:number level="any" format="01" from="book"/>
276       <xsl:if test="not($recursive)">
277         <xsl:value-of select="$html.ext"/>
278       </xsl:if>
279     </xsl:when>
280
281     <xsl:when test="self::colophon">
282       <xsl:choose>
283         <xsl:when test="/set">
284           <!-- in a set, make sure we inherit the right book info... -->
285           <xsl:apply-templates mode="recursive-chunk-filename" select="parent::*">
286             <xsl:with-param name="recursive" select="true()"/>
287           </xsl:apply-templates>
288         </xsl:when>
289         <xsl:otherwise>
290         </xsl:otherwise>
291       </xsl:choose>
292
293       <xsl:text>co</xsl:text>
294       <xsl:number level="any" format="01" from="book"/>
295       <xsl:if test="not($recursive)">
296         <xsl:value-of select="$html.ext"/>
297       </xsl:if>
298     </xsl:when>
299
300     <xsl:when test="self::sect1                     or self::sect2                     or self::sect3                     or self::sect4                     or self::sect5                     or self::section">
301       <xsl:apply-templates mode="recursive-chunk-filename" select="parent::*">
302         <xsl:with-param name="recursive" select="true()"/>
303       </xsl:apply-templates>
304       <xsl:text>s</xsl:text>
305       <xsl:number format="01"/>
306       <xsl:if test="not($recursive)">
307         <xsl:value-of select="$html.ext"/>
308       </xsl:if>
309     </xsl:when>
310
311     <xsl:when test="self::bibliography">
312       <xsl:choose>
313         <xsl:when test="/set">
314           <!-- in a set, make sure we inherit the right book info... -->
315           <xsl:apply-templates mode="recursive-chunk-filename" select="parent::*">
316             <xsl:with-param name="recursive" select="true()"/>
317           </xsl:apply-templates>
318         </xsl:when>
319         <xsl:otherwise>
320         </xsl:otherwise>
321       </xsl:choose>
322
323       <xsl:text>bi</xsl:text>
324       <xsl:number level="any" format="01" from="book"/>
325       <xsl:if test="not($recursive)">
326         <xsl:value-of select="$html.ext"/>
327       </xsl:if>
328     </xsl:when>
329
330     <xsl:when test="self::glossary">
331       <xsl:choose>
332         <xsl:when test="/set">
333           <!-- in a set, make sure we inherit the right book info... -->
334           <xsl:apply-templates mode="recursive-chunk-filename" select="parent::*">
335             <xsl:with-param name="recursive" select="true()"/>
336           </xsl:apply-templates>
337         </xsl:when>
338         <xsl:otherwise>
339         </xsl:otherwise>
340       </xsl:choose>
341
342       <xsl:text>go</xsl:text>
343       <xsl:number level="any" format="01" from="book"/>
344       <xsl:if test="not($recursive)">
345         <xsl:value-of select="$html.ext"/>
346       </xsl:if>
347     </xsl:when>
348
349     <xsl:when test="self::index">
350       <xsl:choose>
351         <xsl:when test="/set">
352           <!-- in a set, make sure we inherit the right book info... -->
353           <xsl:apply-templates mode="recursive-chunk-filename" select="parent::*">
354             <xsl:with-param name="recursive" select="true()"/>
355           </xsl:apply-templates>
356         </xsl:when>
357         <xsl:otherwise>
358         </xsl:otherwise>
359       </xsl:choose>
360
361       <xsl:text>ix</xsl:text>
362       <xsl:number level="any" format="01" from="book"/>
363       <xsl:if test="not($recursive)">
364         <xsl:value-of select="$html.ext"/>
365       </xsl:if>
366     </xsl:when>
367
368     <xsl:when test="self::setindex">
369       <xsl:text>si</xsl:text>
370       <xsl:number level="any" format="01" from="set"/>
371       <xsl:if test="not($recursive)">
372         <xsl:value-of select="$html.ext"/>
373       </xsl:if>
374     </xsl:when>
375
376     <xsl:when test="self::topic">
377       <xsl:choose>
378         <xsl:when test="/set">
379           <!-- in a set, make sure we inherit the right book info... -->
380           <xsl:apply-templates mode="recursive-chunk-filename" select="parent::*">
381             <xsl:with-param name="recursive" select="true()"/>
382           </xsl:apply-templates>
383         </xsl:when>
384         <xsl:otherwise>
385         </xsl:otherwise>
386       </xsl:choose>
387
388       <xsl:text>to</xsl:text>
389       <xsl:number level="any" format="01" from="book"/>
390       <xsl:if test="not($recursive)">
391         <xsl:value-of select="$html.ext"/>
392       </xsl:if>
393     </xsl:when>
394
395     <xsl:otherwise>
396       <xsl:text>chunk-filename-error-</xsl:text>
397       <xsl:value-of select="name(.)"/>
398       <xsl:number level="any" format="01" from="set"/>
399       <xsl:if test="not($recursive)">
400         <xsl:value-of select="$html.ext"/>
401       </xsl:if>
402     </xsl:otherwise>
403   </xsl:choose>
404 </xsl:template>
405
406 <!-- ==================================================================== -->
407
408
409
410 <xsl:template match="processing-instruction('dbhtml')">
411   <!-- nop -->
412 </xsl:template>
413
414 <!-- ==================================================================== -->
415
416
417 <xsl:template match="*" mode="find.chunks">
418   <xsl:variable name="chunk">
419     <xsl:call-template name="chunk"/>
420   </xsl:variable>
421
422   <xsl:choose>
423     <xsl:when test="$chunk != 0">
424       <cf:div id="{generate-id()}">
425         <xsl:apply-templates select="." mode="class.attribute"/>
426         <xsl:apply-templates select="*" mode="find.chunks"/>
427       </cf:div>
428     </xsl:when>
429     <xsl:otherwise>
430       <xsl:apply-templates select="*" mode="find.chunks"/>
431     </xsl:otherwise>
432   </xsl:choose>
433 </xsl:template>
434
435 <!-- Leave legalnotice chunk out of the list for Next and Prev -->
436 <xsl:template match="legalnotice" mode="find.chunks"/>
437
438 <xslo:include xmlns:xslo="http://www.w3.org/1999/XSL/Transform" href="../profiling/profile-mode.xsl"/><xslo:variable xmlns:xslo="http://www.w3.org/1999/XSL/Transform" name="profiled-content"><xslo:choose><xslo:when test="$exsl.node.set.available != 0 and                      namespace-uri(/*) = 'http://docbook.org/ns/docbook'"><xslo:variable name="no.namespace"><xslo:apply-templates select="/*" mode="stripNS"/></xslo:variable><xslo:call-template name="log.message"><xslo:with-param name="level">Note</xslo:with-param><xslo:with-param name="source"><xslo:call-template name="get.doc.title"/></xslo:with-param><xslo:with-param name="context-desc"><xslo:text>namesp. cut</xslo:text></xslo:with-param><xslo:with-param name="message"><xslo:text>stripped namespace before processing</xslo:text></xslo:with-param></xslo:call-template><xslo:apply-templates select="exslt:node-set($no.namespace)" mode="profile"/></xslo:when><xslo:otherwise><xslo:apply-templates select="/" mode="profile"/></xslo:otherwise></xslo:choose></xslo:variable><xslo:variable xmlns:xslo="http://www.w3.org/1999/XSL/Transform" name="profiled-nodes" select="exslt:node-set($profiled-content)"/><xsl:template match="/">
439   <!-- * Get a title for current doc so that we let the user -->
440   <!-- * know what document we are processing at this point. -->
441   <xsl:variable name="doc.title">
442     <xsl:call-template name="get.doc.title"/>
443   </xsl:variable>
444   <xsl:choose>
445     <xsl:when test="false()"/>
446     <!-- Can't process unless namespace fixed with exsl node-set()-->
447     <xsl:when test="false()"/>
448     <xsl:otherwise>
449       <xsl:choose>
450         <xsl:when test="$rootid != ''">
451           <xsl:choose>
452             <xsl:when test="count($profiled-nodes//*[@id=$rootid or @xml:id=$rootid]) = 0">
453               <xsl:message terminate="yes">
454                 <xsl:text>ID '</xsl:text>
455                 <xsl:value-of select="$rootid"/>
456                 <xsl:text>' not found in document.</xsl:text>
457               </xsl:message>
458             </xsl:when>
459             <xsl:otherwise>
460               <xsl:if test="$collect.xref.targets = 'yes' or                             $collect.xref.targets = 'only'">
461                 <xsl:apply-templates select="key('id', $rootid)" mode="collect.targets"/>
462               </xsl:if>
463               <xsl:if test="$collect.xref.targets != 'only'">
464                 <xsl:apply-templates select="$profiled-nodes//*[@id=$rootid or @xml:id=$rootid]" mode="process.root"/>
465                 <xsl:if test="$tex.math.in.alt != ''">
466                   <xsl:apply-templates select="$profiled-nodes//*[@id=$rootid or @xml:id=$rootid]" mode="collect.tex.math"/>
467                 </xsl:if>
468                 <xsl:if test="$generate.manifest != 0">
469                   <xsl:call-template name="generate.manifest">
470                     <xsl:with-param name="node" select="key('id',$rootid)"/>
471                   </xsl:call-template>
472                 </xsl:if>
473               </xsl:if>
474             </xsl:otherwise>
475           </xsl:choose>
476         </xsl:when>
477         <xsl:otherwise>
478           <xsl:if test="$collect.xref.targets = 'yes' or                         $collect.xref.targets = 'only'">
479             <xsl:apply-templates select="$profiled-nodes" mode="collect.targets"/>
480           </xsl:if>
481           <xsl:if test="$collect.xref.targets != 'only'">
482             <xsl:apply-templates select="$profiled-nodes" mode="process.root"/>
483             <xsl:if test="$tex.math.in.alt != ''">
484               <xsl:apply-templates select="$profiled-nodes" mode="collect.tex.math"/>
485             </xsl:if>
486             <xsl:if test="$generate.manifest != 0">
487               <xsl:call-template name="generate.manifest">
488                 <xsl:with-param name="node" select="$profiled-nodes"/>
489               </xsl:call-template>
490             </xsl:if>
491           </xsl:if>
492         </xsl:otherwise>
493       </xsl:choose>
494     </xsl:otherwise>
495   </xsl:choose>
496 </xsl:template>
497
498 <xsl:template match="*" mode="process.root">
499   <xsl:apply-templates select="."/>
500   <xsl:call-template name="generate.css.files"/>
501 </xsl:template>
502
503 <!-- ====================================================================== -->
504
505 <xsl:template match="set|book|part|preface|chapter|appendix                      |article                      |topic                      |reference|refentry                      |book/glossary|article/glossary|part/glossary                      |book/bibliography|article/bibliography|part/bibliography                      |colophon">
506   <xsl:choose>
507     <xsl:when test="$onechunk != 0 and parent::*">
508       <xsl:apply-imports/>
509     </xsl:when>
510     <xsl:otherwise>
511       <xsl:call-template name="process-chunk-element"/>
512     </xsl:otherwise>
513   </xsl:choose>
514 </xsl:template>
515
516 <xsl:template match="sect1|sect2|sect3|sect4|sect5|section">
517   <xsl:variable name="ischunk">
518     <xsl:call-template name="chunk"/>
519   </xsl:variable>
520
521   <xsl:choose>
522     <xsl:when test="not(parent::*)">
523       <xsl:call-template name="process-chunk-element"/>
524     </xsl:when>
525     <xsl:when test="$ischunk = 0">
526       <xsl:apply-imports/>
527     </xsl:when>
528     <xsl:otherwise>
529       <xsl:call-template name="process-chunk-element"/>
530     </xsl:otherwise>
531   </xsl:choose>
532 </xsl:template>
533
534 <xsl:template match="setindex                      |book/index                      |article/index                      |part/index">
535   <!-- some implementations use completely empty index tags to indicate -->
536   <!-- where an automatically generated index should be inserted. so -->
537   <!-- if the index is completely empty, skip it. -->
538   <xsl:if test="count(*)&gt;0 or $generate.index != '0'">
539     <xsl:call-template name="process-chunk-element"/>
540   </xsl:if>
541 </xsl:template>
542
543 <!-- Resolve xml:base attributes -->
544 <xsl:template match="@fileref">
545   <!-- need a check for absolute urls -->
546   <xsl:choose>
547     <xsl:when test="contains(., ':')">
548       <!-- it has a uri scheme so it is an absolute uri -->
549       <xsl:value-of select="."/>
550     </xsl:when>
551     <xsl:when test="$keep.relative.image.uris != 0">
552       <!-- leave it alone -->
553       <xsl:value-of select="."/>
554     </xsl:when>
555     <xsl:otherwise>
556       <!-- its a relative uri -->
557       <xsl:call-template name="relative-uri">
558         <xsl:with-param name="destdir">
559           <xsl:call-template name="dbhtml-dir">
560             <xsl:with-param name="context" select=".."/>
561           </xsl:call-template>
562         </xsl:with-param>
563       </xsl:call-template>
564     </xsl:otherwise>
565   </xsl:choose>
566 </xsl:template>
567
568 <!-- ==================================================================== -->
569 <xsl:template match="set|book|part|preface|chapter|appendix                      |article                      |topic                      |reference|refentry                      |sect1|sect2|sect3|sect4|sect5                      |section                      |book/glossary|article/glossary|part/glossary                      |book/bibliography|article/bibliography|part/bibliography                      |colophon" mode="enumerate-files">
570   <xsl:variable name="ischunk"><xsl:call-template name="chunk"/></xsl:variable>
571   <xsl:if test="$ischunk='1'">
572     <xsl:call-template name="make-relative-filename">
573       <xsl:with-param name="base.dir">
574         <xsl:if test="$manifest.in.base.dir = 0">
575           <xsl:value-of select="$chunk.base.dir"/>
576         </xsl:if>
577       </xsl:with-param>
578       <xsl:with-param name="base.name">
579         <xsl:apply-templates mode="chunk-filename" select="."/>
580       </xsl:with-param>
581     </xsl:call-template>
582     <xsl:text>
583 </xsl:text>
584   </xsl:if>
585   <xsl:apply-templates select="*" mode="enumerate-files"/>
586 </xsl:template>
587
588 <xsl:template match="book/index|article/index|part/index" mode="enumerate-files">
589   <xsl:if test="$htmlhelp.output != 1">
590     <xsl:variable name="ischunk"><xsl:call-template name="chunk"/></xsl:variable>
591     <xsl:if test="$ischunk='1'">
592       <xsl:call-template name="make-relative-filename">
593         <xsl:with-param name="base.dir">
594           <xsl:if test="$manifest.in.base.dir = 0">
595             <xsl:value-of select="$chunk.base.dir"/>
596           </xsl:if>
597         </xsl:with-param>
598         <xsl:with-param name="base.name">
599           <xsl:apply-templates mode="chunk-filename" select="."/>
600         </xsl:with-param>
601       </xsl:call-template>
602       <xsl:text>
603 </xsl:text>
604     </xsl:if>
605     <xsl:apply-templates select="*" mode="enumerate-files"/>
606   </xsl:if>
607 </xsl:template>
608
609 <xsl:template match="legalnotice" mode="enumerate-files">
610   <xsl:variable name="id"><xsl:call-template name="object.id"/></xsl:variable>
611   <xsl:if test="$generate.legalnotice.link != 0">
612     <xsl:call-template name="make-relative-filename">
613       <xsl:with-param name="base.dir">
614         <xsl:if test="$manifest.in.base.dir = 0">
615           <xsl:value-of select="$chunk.base.dir"/>
616         </xsl:if>
617       </xsl:with-param>
618       <xsl:with-param name="base.name">
619         <xsl:apply-templates mode="chunk-filename" select="."/>
620       </xsl:with-param>
621     </xsl:call-template>
622     <xsl:text>
623 </xsl:text>
624   </xsl:if>
625 </xsl:template>
626
627 <xsl:template match="revhistory" mode="enumerate-files">
628   <xsl:variable name="id"><xsl:call-template name="object.id"/></xsl:variable>
629   <xsl:if test="$generate.revhistory.link != 0">
630     <xsl:call-template name="make-relative-filename">
631       <xsl:with-param name="base.dir">
632         <xsl:if test="$manifest.in.base.dir = 0">
633           <xsl:value-of select="$chunk.base.dir"/>
634         </xsl:if>
635       </xsl:with-param>
636       <xsl:with-param name="base.name">
637         <xsl:call-template name="ln.or.rh.filename">
638           <xsl:with-param name="is.ln" select="false()"/>
639         </xsl:call-template>
640       </xsl:with-param>
641     </xsl:call-template>
642     <xsl:text>
643 </xsl:text>
644   </xsl:if>
645 </xsl:template>
646
647 <xsl:template match="mediaobject[imageobject] | inlinemediaobject[imageobject]" mode="enumerate-files">
648   <xsl:variable name="longdesc.uri">
649     <xsl:call-template name="longdesc.uri">
650       <xsl:with-param name="mediaobject" select="."/>
651     </xsl:call-template>
652   </xsl:variable>
653   <xsl:variable name="mediaobject" select="."/>
654
655   <xsl:if test="$html.longdesc != 0 and $mediaobject/textobject[not(phrase)]">
656     <xsl:call-template name="longdesc.uri">
657       <xsl:with-param name="mediaobject" select="$mediaobject"/>
658     </xsl:call-template>
659     <xsl:text>
660 </xsl:text>
661   </xsl:if>
662 </xsl:template>
663
664 <xsl:template match="text()" mode="enumerate-files">
665 </xsl:template>
666
667 </xsl:stylesheet>