source: trunk/Distribution/XSL/xhtml/maketoc.xsl@ 2

Last change on this file since 2 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.8 KB
Line 
1<?xml version="1.0" encoding="US-ASCII"?>
2<!--This file was created automatically by html2xhtml-->
3<!--from the HTML stylesheets. Do not edit this file.-->
4<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:doc="http://nwalsh.com/xsl/documentation/1.0" xmlns="http://www.w3.org/1999/xhtml" version="1.0" 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" doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/>
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>
55</xsl:text>
56 <xsl:apply-templates mode="toc" select="$nodes"/>
57 <xsl:call-template name="indent-spaces"/>
58 </tocentry>
59 <xsl:text>
60</xsl:text>
61 </xsl:if>
62</xsl:template>
63
64<xsl:template name="indent-spaces">
65 <xsl:param name="node" select="."/>
66 <xsl:text> </xsl:text>
67 <xsl:if test="$node/parent::*">
68 <xsl:call-template name="indent-spaces">
69 <xsl:with-param name="node" select="$node/parent::*"/>
70 </xsl:call-template>
71 </xsl:if>
72</xsl:template>
73
74<!-- ==================================================================== -->
75
76<xsl:template match="/" priority="-1">
77 <xsl:text>
78</xsl:text>
79 <toc role="chunk-toc">
80 <xsl:text>
81</xsl:text>
82 <xsl:apply-templates select="/" mode="toc"/>
83 </toc>
84 <xsl:text>
85</xsl:text>
86</xsl:template>
87
88</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.