summaryrefslogtreecommitdiff
path: root/stylesheets/db2html-navbar.xsl
blob: ea273fb943e5ff35d66cc2f352d88d7ec343f31e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
<?xml version='1.0'?><!-- -*- Mode: fundamental; tab-width: 3 -*- -->

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                version="1.0">

<!-- == navbar.following.link ============================================== -->

<xsl:template name="navbar.following.link">
	<xsl:param name="node" select="."/>
	<xsl:apply-templates mode="navbar.following.link.mode" select="$node"/>
</xsl:template>

<xsl:template match="*" mode="navbar.following.link.mode">
<!--
	<xsl:variable name="depth" select="count(ancestor::*[&is-div;])"/>
	<xsl:choose>
		<xsl:when test="not(&is-div;)">
			<xsl:apply-templates mode="navbar.following.link.mode"
				 select="ancestor::*[&is-div;][1]"/>
		</xsl:when>
		<xsl:when test="following-sibling::*[&is-div;]">
			<xsl:variable name="foll"
				select="following-sibling::*[&is-div;][1]"/>
			<xsl:call-template name="xref">
				<xsl:with-param name="linkend" select="$foll/@id"/>
				<xsl:with-param name="target" select="$foll"/>
			</xsl:call-template>
		</xsl:when>
		<xsl:when test="$depth &gt; 0">
			<xsl:apply-templates select=".." mode="navbar.following.link.mode"/>
		</xsl:when>
	</xsl:choose>
-->
</xsl:template>

<xsl:template match="*" mode="navbar.last.link.mode">
<!--
	<xsl:variable name="depth" select="count(ancestor::*[&is-div;])"/>
	<xsl:choose>
		<xsl:when test="not(&is-div;)">
			<xsl:apply-templates mode="navbar.last.link.mode"
				 select="ancestor::*[&is-div;][1]"/>
		</xsl:when>
		<xsl:when test="$depth &gt; $chunk_depth">
			<xsl:apply-templates select="." mode="navbar.prev.link.mode"/>
		</xsl:when>
		<xsl:when test="$depth = $chunk_depth">
			<xsl:call-template name="xref">
				<xsl:with-param name="linkend" select="@id"/>
				<xsl:with-param name="target" select="."/>
			</xsl:call-template>
		</xsl:when>
		<xsl:when test="*[&is-div;]">
			<xsl:apply-templates mode="navbar.last.link.mode"
				select="*[&is-div;][last()]"/>
		</xsl:when>
		<xsl:otherwise>
			<xsl:call-template name="xref">
				<xsl:with-param name="linkend" select="@id"/>
				<xsl:with-param name="target" select="."/>
			</xsl:call-template>
		</xsl:otherwise>
	</xsl:choose>
-->
</xsl:template>

<xsl:template match="*" mode="navbar.prev.link.mode">
<!--
	<xsl:variable name="depth" select="count(ancestor::*[&is-div;])"/>
	<xsl:variable name="chunk_id">
		<xsl:apply-templates select="." mode="chunk.id.mode"/>
	</xsl:variable>
	<xsl:choose>
		<xsl:when test="string($chunk_id) != @id">
			<xsl:apply-templates select="id($chunk_id)" mode="navbar.prev.link.mode"/>
		</xsl:when>
		<xsl:when test="&is-div-info;"/>
		<xsl:when test="$depth &gt; $chunk_depth">
			<xsl:apply-templates select=".." mode="navbar.prev.link.mode"/>
		</xsl:when>
		<xsl:when test="
				($depth = $chunk_depth) and (preceding-sibling::*[&is-div;])">
			<xsl:variable name="prev" select="preceding-sibling::*[&is-div;][1]"/>
			<xsl:call-template name="xref">
				<xsl:with-param name="linkend" select="$prev/@id"/>
				<xsl:with-param name="target" select="$prev"/>
			</xsl:call-template>
		</xsl:when>
		<xsl:when test="preceding-sibling::*[&is-div;]">
			<xsl:apply-templates mode="navbar.last.link.mode"
				select="preceding-sibling::*[&is-div;][1]"/>
		</xsl:when>
		<xsl:when test="parent::*[&is-div;]">
			<xsl:call-template name="xref">
				<xsl:with-param name="linkend" select="../@id"/>
				<xsl:with-param name="target" select=".."/>
			</xsl:call-template>
		</xsl:when>
		<xsl:when test="$generate_titlepage and (. = /*) and *[&is-div-info;]">
			<xsl:variable name="prev" select="*[&is-div-info;][1]"/>
			<xsl:call-template name="xref">
				<xsl:with-param name="linkend" select="$prev/@id"/>
				<xsl:with-param name="target" select="$prev"/>
			</xsl:call-template>
		</xsl:when>
	</xsl:choose>
-->
</xsl:template>

<xsl:template match="*" mode="navbar.next.link.mode">
<!--
	<xsl:variable name="depth" select="count(ancestor::*[&is-div;])"/>
	<xsl:choose>
		<xsl:when test="&is-div-info;">
			<xsl:call-template name="xref">
				<xsl:with-param name="linkend" select="../@id"/>
				<xsl:with-param name="target" select=".."/>
			</xsl:call-template>
		</xsl:when>
		<xsl:when test="not(&is-div;)">
			<xsl:apply-templates mode="navbar.next.link.mode"
				 select="ancestor::*[&is-div;][1]"/>
		</xsl:when>
		<xsl:when test="$depth &gt; $chunk_depth">
			<xsl:apply-templates select="." mode="navbar.next.link.mode"/>
		</xsl:when>
		<xsl:when test="($depth &lt; $chunk_depth) and (*[&is-div;])">
			<xsl:variable name="next" select="*[&is-div;][1]"/>
			<xsl:call-template name="xref">
				<xsl:with-param name="linkend" select="$next/@id"/>
				<xsl:with-param name="target" select="$next"/>
			</xsl:call-template>
		</xsl:when>
		<xsl:otherwise>
			<xsl:apply-templates select="." mode="navbar.following.link.mode"/>
		</xsl:otherwise>
	</xsl:choose>
-->
</xsl:template>

</xsl:stylesheet>