~ubuntu-branches/ubuntu/lucid/gnome-doc-utils/lucid

« back to all changes in this revision

Viewing changes to xslt/docbook/common/db-chunk.xsl

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Holbach
  • Date: 2005-12-19 08:34:21 UTC
  • mto: (2.1.1 etch) (1.1.18 upstream)
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20051219083421-k72rkh3n6vox1c0t
Tags: upstream-0.5.2
ImportĀ upstreamĀ versionĀ 0.5.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<?xml version='1.0' encoding='utf-8'?><!-- -*- indent-tabs-mode: nil -*- -->
 
1
<?xml version='1.0' encoding='UTF-8'?><!-- -*- indent-tabs-mode: nil -*- -->
 
2
<!--
 
3
This program is free software; you can redistribute it and/or modify it under
 
4
the terms of the GNU Lesser General Public License as published by the Free
 
5
Software Foundation; either version 2 of the License, or (at your option) any
 
6
later version.
 
7
 
 
8
This program is distributed in the hope that it will be useful, but WITHOUT
 
9
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 
10
FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 
11
details.
 
12
 
 
13
You should have received a copy of the GNU Lesser General Public License
 
14
along with this program; see the file COPYING.LGPL.  If not, write to the
 
15
Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 
16
02111-1307, USA.
 
17
-->
2
18
 
3
19
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
4
20
                xmlns:doc="http://www.gnome.org/~shaunm/xsldoc"
88
104
<xsl:param name="db.chunk.extension"/>
89
105
 
90
106
 
 
107
<!-- == db.chunk.info_chunk ================================================ -->
 
108
 
 
109
<parameter xmlns="http://www.gnome.org/~shaunm/xsldoc">
 
110
  <name>db.chunk.info_chunk</name>
 
111
  <purpose>
 
112
    Whether to create a chunk for the titlepage
 
113
  </purpose>
 
114
</parameter>
 
115
 
 
116
<xsl:param name="db.chunk.info_chunk"
 
117
           select="$db.chunk.max_depth != 0 and $db.chunk.info_basename != ''"/>
 
118
 
 
119
 
91
120
<!-- == db.chunk.info_basename ============================================= -->
92
121
 
93
122
<parameter xmlns="http://www.gnome.org/~shaunm/xsldoc">
161
190
      <xsl:with-param name="node" select="$node"/>
162
191
    </xsl:call-template>
163
192
  </xsl:param>
164
 
  <xsl:if test="string($template) = ''">
165
 
    <xsl:call-template name="db.chunk.children">
166
 
      <xsl:with-param name="node" select="$node"/>
167
 
      <xsl:with-param name="depth_of_chunk" select="$depth_of_chunk"/>
168
 
    </xsl:call-template>
169
 
  </xsl:if>
170
193
  <exsl:document href="{$href}">
171
194
    <xsl:call-template name="db.chunk.content">
172
195
      <xsl:with-param name="node" select="$node"/>
174
197
      <xsl:with-param name="depth_of_chunk" select="$depth_of_chunk"/>
175
198
    </xsl:call-template>
176
199
  </exsl:document>
 
200
  <xsl:if test="string($template) = ''">
 
201
    <xsl:call-template name="db.chunk.children">
 
202
      <xsl:with-param name="node" select="$node"/>
 
203
      <xsl:with-param name="depth_of_chunk" select="$depth_of_chunk"/>
 
204
    </xsl:call-template>
 
205
  </xsl:if>
177
206
</xsl:template>
178
207
 
179
208
 
268
297
    </xsl:call-template>
269
298
  </xsl:param>
270
299
  <xsl:if test="$depth_of_chunk &lt; $db.chunk.max_depth">
271
 
    <xsl:for-each select="$node/*[contains($db.chunk.chunks_,
272
 
                                    concat(' ', local-name(.), ' '))]">
 
300
    <xsl:for-each select="
 
301
                  $node/appendix   | $node/article    | $node/bibliography |
 
302
                  $node/book       | $node/chapter    | $node/colophon     |
 
303
                  $node/dedication | $node/glossary   | $node/glossdiv     |
 
304
                  $node/index      | $node/lot        | $node/part         |
 
305
                  $node/preface    | $node/refentry   | $node/reference    |
 
306
                  $node/sect1      | $node/sect2      | $node/sect3        |
 
307
                  $node/sect4      | $node/sect5      | $node/section      |
 
308
                  $node/setindex   | $node/simplesect | $node/toc          ">
273
309
      <xsl:call-template name="db.chunk">
274
310
        <xsl:with-param name="depth_of_chunk" select="$depth_of_chunk + 1"/>
275
311
      </xsl:call-template>
276
312
    </xsl:for-each>
277
313
  </xsl:if>
278
 
  <xsl:if test="$depth_of_chunk = 0">
 
314
  <xsl:if test="$db.chunk.info_chunk and $depth_of_chunk = 0">
279
315
    <xsl:call-template name="db.chunk">
280
316
      <xsl:with-param name="node" select="$node"/>
281
317
      <xsl:with-param name="template" select="'info'"/>
303
339
<xsl:template name="db.chunk.depth-in-chunk">
304
340
  <xsl:param name="node" select="."/>
305
341
  <xsl:variable name="divs"
 
342
                select="
 
343
count(                          $node/ancestor-or-self::appendix     ) + 
 
344
count(                          $node/ancestor-or-self::article      ) + 
 
345
count(                          $node/ancestor-or-self::bibliography ) + 
 
346
count(                          $node/ancestor-or-self::book         ) + 
 
347
count(                          $node/ancestor-or-self::chapter      ) + 
 
348
count(                          $node/ancestor-or-self::colophon     ) + 
 
349
count(                          $node/ancestor-or-self::dedication   ) + 
 
350
count(                          $node/ancestor-or-self::glossary     ) + 
 
351
count(                          $node/ancestor-or-self::glossdiv     ) + 
 
352
count(                          $node/ancestor-or-self::index        ) + 
 
353
count(                          $node/ancestor-or-self::lot          ) + 
 
354
count(                          $node/ancestor-or-self::part         ) + 
 
355
count(                          $node/ancestor-or-self::preface      ) + 
 
356
count(                          $node/ancestor-or-self::refentry     ) + 
 
357
count(                          $node/ancestor-or-self::reference    ) + 
 
358
count(                          $node/ancestor-or-self::sect1        ) + 
 
359
count(                          $node/ancestor-or-self::sect2        ) + 
 
360
count(                          $node/ancestor-or-self::sect3        ) + 
 
361
count(                          $node/ancestor-or-self::sect4        ) + 
 
362
count(                          $node/ancestor-or-self::sect5        ) + 
 
363
count(                          $node/ancestor-or-self::section      ) + 
 
364
count(                          $node/ancestor-or-self::setindex     ) + 
 
365
count(                          $node/ancestor-or-self::simplesect   ) + 
 
366
count(                          $node/ancestor-or-self::toc          )"/>
 
367
<!--
 
368
  <xsl:variable name="divs"
 
369
                select="count($node/ancestor-or-self::*[
 
370
                          self::appendix     or  self::article   or
 
371
                          self::bibliography or  self::book      or
 
372
                          self::chapter      or  self::colophon  or
 
373
                          self::dedication   or  self::glossary  or
 
374
                          self::glossdiv     or  self::index     or
 
375
                          self::lot          or  self::part      or
 
376
                          self::preface      or  self::refentry  or
 
377
                          self::reference    or  self::sect1     or
 
378
                          self::sect2        or  self::sect3     or
 
379
                          self::sect4        or  self::sect5     or
 
380
                          self::section      or  self::setindex  or
 
381
                          self::simplesect   or  self::toc       ])"/>
 
382
-->
 
383
<!--
 
384
  <xsl:variable name="divs"
306
385
                select="count($node/ancestor-or-self::*
307
386
                               [contains($db.chunk.chunks_,
308
387
                                  concat(' ', local-name(.), ' '))] )"/>
 
388
-->
309
389
  <xsl:choose>
310
390
    <xsl:when test="$divs &lt; ($db.chunk.max_depth + 1)">
311
391
      <xsl:value-of select="count($node/ancestor-or-self::*) - $divs"/>
338
418
                select="count($node/ancestor::*
339
419
                               [contains($db.chunk.chunks_,
340
420
                                  concat(' ', local-name(.), ' '))] )"/>
 
421
<!--
 
422
  <xsl:variable name="divs"
 
423
                select="count($node/ancestor::*[
 
424
                          self::appendix     or  self::article   or
 
425
                          self::bibliography or  self::book      or
 
426
                          self::chapter      or  self::colophon  or
 
427
                          self::dedication   or  self::glossary  or
 
428
                          self::glossdiv     or  self::index     or
 
429
                          self::lot          or  self::part      or
 
430
                          self::preface      or  self::refentry  or
 
431
                          self::reference    or  self::sect1     or
 
432
                          self::sect2        or  self::sect3     or
 
433
                          self::sect4        or  self::sect5     or
 
434
                          self::section      or  self::setindex  or
 
435
                          self::simplesect   or  self::toc       ])"/>
 
436
-->
341
437
  <xsl:choose>
342
438
    <xsl:when test="$divs &lt; $db.chunk.max_depth">
343
439
      <xsl:value-of select="$divs"/>