source: trunk/Distribution/XSL/html/maketoc.xsl@ 3

Last change on this file since 3 was 2, checked in by jkacer, 18 years ago

Added all DocBook Framework stuff:

  • DocBook DTD
  • Transformation software FOP 0.20.5 and Saxon 6
  • XSL styles
  • Rexx scripts

Also added some WarpIN-related stuff for creation of WarpIN installation packages.
This state corresponds to version 1.0.0 from November 2005, just slightly modified to carry versioning information (Rexx scripts).

File size: 2.6 KB
Line 
1<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
2 xmlns:doc="http://nwalsh.com/xsl/documentation/1.0"
3 version="1.0"
4 exclude-result-prefixes="doc">
5
6<!-- ********************************************************************
7 $Id: maketoc.xsl,v 1.5 2003/11/30 19:42:23 bobstayton Exp $
8 ********************************************************************
9
10 This file is part of the XSL DocBook Stylesheet distribution.
11 See ../README or http://nwalsh.com/docbook/xsl/ for copyright
12 and other information.
13
14 ******************************************************************** -->
15
16<!-- ==================================================================== -->
17
18<xsl:import href="docbook.xsl"/>
19<xsl:import href="chunk.xsl"/>
20
21<xsl:output method="xml" indent="no" encoding='utf-8'/>
22
23<xsl:param name="toc.list.type" select="'tocentry'"/>
24
25<!-- refentry in autotoc.xsl does not use subtoc, so must
26 handle it explicitly here. -->
27<xsl:template match="refentry" mode="toc">
28 <xsl:param name="toc-context" select="."/>
29
30 <xsl:call-template name="subtoc">
31 <xsl:with-param name="toc-context" select="$toc-context"/>
32 </xsl:call-template>
33</xsl:template>
34
35
36<xsl:template name="subtoc">
37 <xsl:param name="nodes" select="NOT-AN-ELEMENT"/>
38 <xsl:variable name="filename">
39 <xsl:apply-templates select="." mode="chunk-filename"/>
40 </xsl:variable>
41
42 <xsl:variable name="chunk">
43 <xsl:call-template name="chunk"/>
44 </xsl:variable>
45
46 <xsl:if test="$chunk != 0">
47 <xsl:call-template name="indent-spaces"/>
48 <tocentry linkend="{@id}">
49 <xsl:processing-instruction name="dbhtml">
50 <xsl:text>filename="</xsl:text>
51 <xsl:value-of select="$filename"/>
52 <xsl:text>"</xsl:text>
53 </xsl:processing-instruction>
54 <xsl:text>&#xA;</xsl:text>
55 <xsl:apply-templates mode="toc" select="$nodes"/>
56 <xsl:call-template name="indent-spaces"/>
57 </tocentry>
58 <xsl:text>&#xA;</xsl:text>
59 </xsl:if>
60</xsl:template>
61
62<xsl:template name="indent-spaces">
63 <xsl:param name="node" select="."/>
64 <xsl:text> </xsl:text>
65 <xsl:if test="$node/parent::*">
66 <xsl:call-template name="indent-spaces">
67 <xsl:with-param name="node" select="$node/parent::*"/>
68 </xsl:call-template>
69 </xsl:if>
70</xsl:template>
71
72<!-- ==================================================================== -->
73
74<xsl:template match="/" priority="-1">
75 <xsl:text>&#xA;</xsl:text>
76 <toc role="chunk-toc">
77 <xsl:text>&#xA;</xsl:text>
78 <xsl:apply-templates select="/" mode="toc"/>
79 </toc>
80 <xsl:text>&#xA;</xsl:text>
81</xsl:template>
82
83</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.