source: trunk/Distribution/XSL/html/refentry.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: 8.1 KB
Line 
1<?xml version='1.0'?>
2<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
3 version='1.0'>
4
5<!-- ********************************************************************
6 $Id: refentry.xsl,v 1.20 2005/06/24 01:56:51 xmldoc Exp $
7 ********************************************************************
8
9 This file is part of the XSL DocBook Stylesheet distribution.
10 See ../README or http://nwalsh.com/docbook/xsl/ for copyright
11 and other information.
12
13 ******************************************************************** -->
14
15<!-- ==================================================================== -->
16
17<xsl:template match="reference">
18 <div class="{name(.)}">
19 <xsl:call-template name="language.attribute"/>
20 <xsl:if test="$generate.id.attributes != 0">
21 <xsl:attribute name="id">
22 <xsl:call-template name="object.id"/>
23 </xsl:attribute>
24 </xsl:if>
25
26 <xsl:call-template name="reference.titlepage"/>
27
28 <xsl:variable name="toc.params">
29 <xsl:call-template name="find.path.params">
30 <xsl:with-param name="table" select="normalize-space($generate.toc)"/>
31 </xsl:call-template>
32 </xsl:variable>
33
34 <xsl:if test="not(partintro) and contains($toc.params, 'toc')">
35 <xsl:call-template name="division.toc"/>
36 </xsl:if>
37 <xsl:apply-templates/>
38 </div>
39</xsl:template>
40
41<xsl:template match="reference" mode="division.number">
42 <xsl:number from="book" count="reference" format="I."/>
43</xsl:template>
44
45<xsl:template match="reference/docinfo"></xsl:template>
46<xsl:template match="reference/referenceinfo"></xsl:template>
47<xsl:template match="reference/title"></xsl:template>
48<xsl:template match="reference/subtitle"></xsl:template>
49<xsl:template match="reference/titleabbrev"></xsl:template>
50
51<!-- ==================================================================== -->
52
53<xsl:template name="refentry.title">
54 <xsl:param name="node" select="."/>
55 <xsl:variable name="refmeta" select="$node//refmeta"/>
56 <xsl:variable name="refentrytitle" select="$refmeta//refentrytitle"/>
57 <xsl:variable name="refnamediv" select="$node//refnamediv"/>
58 <xsl:variable name="refname" select="$refnamediv//refname"/>
59 <xsl:variable name="refdesc" select="$refnamediv//refdescriptor"/>
60 <xsl:variable name="title">
61 <xsl:choose>
62 <xsl:when test="$refentrytitle">
63 <xsl:apply-templates select="$refentrytitle[1]" mode="title"/>
64 </xsl:when>
65 <xsl:when test="$refdesc">
66 <xsl:apply-templates select="$refdesc[1]" mode="title"/>
67 </xsl:when>
68 <xsl:when test="$refname">
69 <xsl:apply-templates select="$refname[1]" mode="title"/>
70 </xsl:when>
71 <xsl:otherwise></xsl:otherwise>
72 </xsl:choose>
73 </xsl:variable>
74
75 <h1 class="title">
76 <xsl:copy-of select="$title"/>
77 </h1>
78</xsl:template>
79
80<xsl:template match="refentry">
81 <div class="{name(.)}">
82 <xsl:call-template name="language.attribute"/>
83 <xsl:if test="$refentry.separator != 0 and preceding-sibling::refentry">
84 <div class="refentry.separator">
85 <hr/>
86 </div>
87 </xsl:if>
88 <xsl:call-template name="anchor">
89 <xsl:with-param name="conditional" select="0"/>
90 </xsl:call-template>
91 <xsl:call-template name="refentry.titlepage"/>
92 <xsl:apply-templates/>
93 <xsl:call-template name="process.footnotes"/>
94 </div>
95</xsl:template>
96
97<xsl:template match="refentry/docinfo|refentry/refentryinfo"></xsl:template>
98
99<xsl:template match="refentrytitle|refname|refdescriptor" mode="title">
100 <xsl:apply-templates/>
101</xsl:template>
102
103<xsl:template match="refmeta">
104</xsl:template>
105
106<xsl:template match="manvolnum">
107 <xsl:if test="$refentry.xref.manvolnum != 0">
108 <xsl:text>(</xsl:text>
109 <xsl:apply-templates/>
110 <xsl:text>)</xsl:text>
111 </xsl:if>
112</xsl:template>
113
114<xsl:template match="refmiscinfo">
115</xsl:template>
116
117<xsl:template match="refentrytitle">
118 <xsl:call-template name="inline.charseq"/>
119</xsl:template>
120
121<xsl:template match="refnamediv">
122 <div class="{name(.)}">
123 <xsl:call-template name="anchor"/>
124
125 <xsl:choose>
126 <xsl:when test="preceding-sibling::refnamediv">
127 <!-- no title on secondary refnamedivs! -->
128 </xsl:when>
129 <xsl:when test="$refentry.generate.name != 0">
130 <h2>
131 <xsl:call-template name="gentext">
132 <xsl:with-param name="key" select="'RefName'"/>
133 </xsl:call-template>
134 </h2>
135 </xsl:when>
136 <xsl:when test="$refentry.generate.title != 0">
137 <h2>
138 <xsl:choose>
139 <xsl:when test="../refmeta/refentrytitle">
140 <xsl:apply-templates select="../refmeta/refentrytitle"/>
141 </xsl:when>
142 <xsl:otherwise>
143 <xsl:apply-templates select="refname[1]"/>
144 </xsl:otherwise>
145 </xsl:choose>
146 </h2>
147 </xsl:when>
148 </xsl:choose>
149
150 <p>
151 <xsl:apply-templates/>
152 </p>
153 </div>
154</xsl:template>
155
156<xsl:template match="refname">
157 <xsl:if test="not(preceding-sibling::refdescriptor)">
158 <xsl:apply-templates/>
159 <xsl:if test="following-sibling::refname">
160 <xsl:text>, </xsl:text>
161 </xsl:if>
162 </xsl:if>
163</xsl:template>
164
165<xsl:template match="refpurpose">
166 <xsl:text> </xsl:text>
167 <xsl:call-template name="dingbat">
168 <xsl:with-param name="dingbat">em-dash</xsl:with-param>
169 </xsl:call-template>
170 <xsl:text> </xsl:text>
171 <xsl:apply-templates/>
172</xsl:template>
173
174<xsl:template match="refdescriptor">
175 <xsl:apply-templates/>
176</xsl:template>
177
178<xsl:template match="refclass">
179 <p>
180 <b>
181 <xsl:if test="@role">
182 <xsl:value-of select="@role"/>
183 <xsl:text>: </xsl:text>
184 </xsl:if>
185 <xsl:apply-templates/>
186 </b>
187 </p>
188</xsl:template>
189
190<xsl:template match="refsynopsisdiv">
191 <div class="{name(.)}">
192 <xsl:call-template name="anchor"/>
193 <h2>
194 <xsl:choose>
195 <xsl:when test="refsynopsisdiv/title|title">
196 <xsl:apply-templates select="(refsynopsisdiv/title|title)[1]"
197 mode="titlepage.mode"/>
198 </xsl:when>
199 <xsl:otherwise>
200 <xsl:call-template name="gentext">
201 <xsl:with-param name="key" select="'RefSynopsisDiv'"/>
202 </xsl:call-template>
203 </xsl:otherwise>
204 </xsl:choose>
205 </h2>
206 <xsl:apply-templates/>
207 </div>
208</xsl:template>
209
210<xsl:template match="refsynopsisdivinfo"></xsl:template>
211
212<xsl:template match="refsynopsisdiv/title">
213</xsl:template>
214
215<xsl:template match="refsynopsisdiv/title" mode="titlepage.mode">
216 <xsl:apply-templates/>
217</xsl:template>
218
219<xsl:template match="refsection|refsect1|refsect2|refsect3">
220 <div class="{name(.)}">
221 <xsl:call-template name="language.attribute"/>
222 <xsl:call-template name="anchor">
223 <xsl:with-param name="conditional" select="0"/>
224 </xsl:call-template>
225 <xsl:apply-templates/>
226 </div>
227</xsl:template>
228
229<xsl:template match="refsection/title">
230 <!-- the ID is output in the block.object call for refsect1 -->
231 <xsl:variable name="level" select="count(ancestor-or-self::refsection)"/>
232 <xsl:variable name="refsynopsisdiv">
233 <xsl:text>0</xsl:text>
234 <xsl:if test="ancestor::refsynopsisdiv">1</xsl:if>
235 </xsl:variable>
236 <xsl:variable name="hlevel">
237 <xsl:choose>
238 <xsl:when test="$level+$refsynopsisdiv &gt; 5">6</xsl:when>
239 <xsl:otherwise>
240 <xsl:value-of select="$level+1+$refsynopsisdiv"/>
241 </xsl:otherwise>
242 </xsl:choose>
243 </xsl:variable>
244 <xsl:element name="h{$hlevel}">
245 <xsl:apply-templates/>
246 </xsl:element>
247</xsl:template>
248
249<xsl:template match="refsect1/title">
250 <!-- the ID is output in the block.object call for refsect1 -->
251 <h2>
252 <xsl:apply-templates/>
253 </h2>
254</xsl:template>
255
256<xsl:template match="refsect2/title">
257 <!-- the ID is output in the block.object call for refsect2 -->
258 <h3>
259 <xsl:apply-templates/>
260 </h3>
261</xsl:template>
262
263<xsl:template match="refsect3/title">
264 <!-- the ID is output in the block.object call for refsect3 -->
265 <h4>
266 <xsl:apply-templates/>
267 </h4>
268</xsl:template>
269
270<xsl:template match="refsect1info"></xsl:template>
271<xsl:template match="refsect2info"></xsl:template>
272<xsl:template match="refsect3info"></xsl:template>
273
274<!-- ==================================================================== -->
275
276</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.