1 <?xml version="1.0" encoding="ASCII"?><!--This file was created automatically by html2xhtml--><!--from the HTML stylesheets.--><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:d="http://docbook.org/ns/docbook" xmlns:doc="http://nwalsh.com/xsl/documentation/1.0" xmlns="http://www.w3.org/1999/xhtml" version="1.0" exclude-result-prefixes="doc d">
3 <!-- ********************************************************************
5 This file is part of the XSL DocBook Stylesheet distribution.
6 See ../README or http://cdn.docbook.org/release/xsl/current/ for
7 copyright and other information.
9 ******************************************************************** -->
11 <!-- ==================================================================== -->
13 <xsl:import href="docbook-no-doctype.xsl"/>
14 <xsl:import href="chunk.xsl"/>
16 <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"/>
18 <xsl:param name="toc.list.type" select="'tocentry'"/>
20 <!-- refentry in autotoc.xsl does not use subtoc, so must
21 handle it explicitly here. -->
22 <xsl:template match="d:refentry" mode="toc">
23 <xsl:param name="toc-context" select="."/>
25 <xsl:call-template name="subtoc">
26 <xsl:with-param name="toc-context" select="$toc-context"/>
31 <xsl:template name="subtoc">
32 <xsl:param name="nodes" select="NOT-AN-ELEMENT"/>
33 <xsl:variable name="filename">
34 <xsl:apply-templates select="." mode="chunk-filename"/>
37 <xsl:variable name="chunk">
38 <xsl:call-template name="chunk"/>
41 <xsl:if test="$chunk != 0">
42 <xsl:call-template name="indent-spaces"/>
43 <xsl:variable name="id">
44 <xsl:call-template name="object.id"/>
46 <d:tocentry linkend="{$id}">
47 <xsl:processing-instruction name="dbhtml">
48 <xsl:text>filename="</xsl:text>
49 <xsl:value-of select="$filename"/>
50 <xsl:text>"</xsl:text>
51 </xsl:processing-instruction>
54 <xsl:apply-templates mode="toc" select="$nodes"/>
55 <xsl:call-template name="indent-spaces"/>
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::*"/>
72 <!-- ==================================================================== -->
74 <xsl:template match="/" priority="-1">
77 <toc role="chunk-toc">
80 <xsl:apply-templates select="/" mode="toc"/>