1 | <?xml version='1.0' encoding='ISO-8859-1'?>
|
---|
2 |
|
---|
3 | <!-- Version 0.8.0 - Manuel Canales Esparcia <macana@lfs-es.org> -->
|
---|
4 |
|
---|
5 | <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
---|
6 | xmlns="http://www.w3.org/1999/xhtml"
|
---|
7 | version="1.0">
|
---|
8 |
|
---|
9 |
|
---|
10 | <!--TOC stuff-->
|
---|
11 | <xsl:param name="generate.toc">
|
---|
12 | appendix toc
|
---|
13 | book toc,title,figure,table,example,equation
|
---|
14 | chapter nop
|
---|
15 | part toc
|
---|
16 | preface nop
|
---|
17 | qandadiv nop
|
---|
18 | qandaset nop
|
---|
19 | reference nop
|
---|
20 | sect1 nop
|
---|
21 | sect2 nop
|
---|
22 | sect3 nop
|
---|
23 | sect4 nop
|
---|
24 | sect5 nop
|
---|
25 | section nop
|
---|
26 | set nop
|
---|
27 | </xsl:param>
|
---|
28 |
|
---|
29 | <xsl:param name="toc.section.depth">1</xsl:param>
|
---|
30 |
|
---|
31 | <xsl:param name="toc.max.depth">3</xsl:param>
|
---|
32 |
|
---|
33 | <!-- Type of list-->
|
---|
34 | <xsl:param name="toc.list.type">ul</xsl:param>
|
---|
35 |
|
---|
36 | <!--Adding the h* tags and dropping redundats links-->
|
---|
37 | <xsl:template name="toc.line">
|
---|
38 | <xsl:param name="toc-context" select="."/>
|
---|
39 | <xsl:param name="depth" select="1"/>
|
---|
40 | <xsl:param name="depth.from.context" select="8"/>
|
---|
41 | <xsl:choose>
|
---|
42 | <xsl:when test="local-name(.) = 'sect1'">
|
---|
43 | <span>
|
---|
44 | <xsl:attribute name="class"><xsl:value-of select="local-name(.)"/></xsl:attribute>
|
---|
45 | <a>
|
---|
46 | <xsl:attribute name="href">
|
---|
47 | <xsl:call-template name="href.target">
|
---|
48 | <xsl:with-param name="context" select="$toc-context"/>
|
---|
49 | </xsl:call-template>
|
---|
50 | </xsl:attribute>
|
---|
51 | <xsl:apply-templates select="." mode="titleabbrev.markup"/>
|
---|
52 | </a>
|
---|
53 | </span>
|
---|
54 | </xsl:when>
|
---|
55 | <xsl:when test="local-name(.) = 'chapter' or local-name(.) = 'preface'">
|
---|
56 | <h4>
|
---|
57 | <span>
|
---|
58 | <xsl:attribute name="class"><xsl:value-of select="local-name(.)"/></xsl:attribute>
|
---|
59 | <xsl:variable name="label">
|
---|
60 | <xsl:apply-templates select="." mode="label.markup"/>
|
---|
61 | </xsl:variable>
|
---|
62 | <xsl:copy-of select="$label"/>
|
---|
63 | <xsl:if test="$label != ''">
|
---|
64 | <xsl:value-of select="$autotoc.label.separator"/>
|
---|
65 | </xsl:if>
|
---|
66 | <xsl:apply-templates select="." mode="titleabbrev.markup"/>
|
---|
67 | </span>
|
---|
68 | </h4>
|
---|
69 | </xsl:when>
|
---|
70 | <xsl:when test="local-name(.) = 'part'">
|
---|
71 | <h3>
|
---|
72 | <span>
|
---|
73 | <xsl:attribute name="class"><xsl:value-of select="local-name(.)"/></xsl:attribute>
|
---|
74 | <xsl:variable name="label">
|
---|
75 | <xsl:apply-templates select="." mode="label.markup"/>
|
---|
76 | </xsl:variable>
|
---|
77 | <xsl:copy-of select="$label"/>
|
---|
78 | <xsl:if test="$label != ''">
|
---|
79 | <xsl:value-of select="$autotoc.label.separator"/>
|
---|
80 | </xsl:if>
|
---|
81 | <xsl:apply-templates select="." mode="titleabbrev.markup"/>
|
---|
82 | </span>
|
---|
83 | </h3>
|
---|
84 | </xsl:when>
|
---|
85 | <xsl:otherwise>
|
---|
86 | <h3>
|
---|
87 | <span>
|
---|
88 | <xsl:attribute name="class"><xsl:value-of select="local-name(.)"/></xsl:attribute>
|
---|
89 | <a>
|
---|
90 | <xsl:attribute name="href">
|
---|
91 | <xsl:call-template name="href.target">
|
---|
92 | <xsl:with-param name="context" select="$toc-context"/>
|
---|
93 | </xsl:call-template>
|
---|
94 | </xsl:attribute>
|
---|
95 | <xsl:variable name="label">
|
---|
96 | <xsl:apply-templates select="." mode="label.markup"/>
|
---|
97 | </xsl:variable>
|
---|
98 | <xsl:copy-of select="$label"/>
|
---|
99 | <xsl:if test="$label != ''">
|
---|
100 | <xsl:value-of select="$autotoc.label.separator"/>
|
---|
101 | </xsl:if>
|
---|
102 | <xsl:apply-templates select="." mode="titleabbrev.markup"/>
|
---|
103 | </a>
|
---|
104 | </span>
|
---|
105 | </h3>
|
---|
106 | </xsl:otherwise>
|
---|
107 | </xsl:choose>
|
---|
108 | </xsl:template>
|
---|
109 |
|
---|
110 | </xsl:stylesheet>
|
---|