File: style.xsl

package info (click to toggle)
libcolt-free-java 1.2.0%2Bdfsg-8
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 20,832 kB
  • sloc: java: 30,337; xml: 893; makefile: 26; sh: 3
file content (527 lines) | stat: -rw-r--r-- 15,670 bytes parent folder | download | duplicates (6)
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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
<?xml version="1.0"?>

<!-- ================================================================= -->
<!-- Content Stylesheet derived from the documentation system of       -->
<!-- http://jakarta.apache.org/site/jakarta-site2.html                 -->
<!-- Customized and extended by whoschek@lbl.gov                       -->
<!-- $Id: style.xsl,v 1.2 2004/02/25 23:48:17 hoschek3 Exp $          -->
<!-- ================================================================= -->

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
	<!-- Output method -->
	<xsl:output method="html" encoding="iso-8859-1" indent="no"/>
	
	<!-- Defined parameters (overrideable) -->
	<xsl:param name="relative-path" select="'.'"/>
	
	<!-- Defined variables (non-overrideable) -->
	<xsl:variable name="header-bg" select="'#ffffff'"/>	<!-- #ffff99 -->
	<xsl:variable name="body-bg" select="'#ffffff'"/>
	<xsl:variable name="body-fg" select="'#000000'"/>
	<xsl:variable name="body-link" select="'#525D76'"/>
	<xsl:variable name="banner-bg" select="'#525D76'"/>
	<xsl:variable name="banner-fg" select="'#ffffff'"/>
	<xsl:variable name="sub-banner-bg" select="'#828DA6'"/>
	<xsl:variable name="sub-banner-fg" select="'#ffffff'"/>
	<xsl:variable name="table-th-bg" select="'#039acc'"/>
	<xsl:variable name="table-td-bg" select="'#a0ddf0'"/>
	<xsl:variable name="source-color" select="'#ffff99'"/> <!-- #023264 -->
	<xsl:variable name="toplinkitem-color" select="'#3366ff'"/> <!--"'#3366ff'" --> <!-- #3300ff -->
		
	<!-- Process an entire document into an HTML page -->
	<xsl:template match="document">
		<xsl:comment>Do not edit this autogenerated HTML file; edit src/xdocs files instead. </xsl:comment>
		<xsl:variable name="project" select="document('navigation.xml')/project"/>
		<html>
			<head>
				<xsl:if test="$project/@css">
					<style type="text/css"> @import url("<xsl:value-of select="$project/@css"/>"); </style>
				</xsl:if>
				<xsl:apply-templates select="meta"/>
				<title>
					<xsl:value-of select="$project/title"/> - <xsl:value-of select="properties/title"/>
				</title>
				<xsl:for-each select="properties/author">
					<xsl:variable name="name">
						<xsl:value-of select="."/>
					</xsl:variable>
					<xsl:variable name="email">
						<xsl:value-of select="@email"/>
					</xsl:variable>
					<meta name="author" content="{$name}"/>
					<meta name="email" content="{$email}"/>
				</xsl:for-each>
			</head>
			<body bgcolor="{$body-bg}" text="{$body-fg}" link="{$body-link}" alink="{$body-link}" vlink="{$body-link}">
				<xsl:comment>HEADER</xsl:comment>
				<table border="0" width="100%" cellspacing="0" bgcolor="{$header-bg}">
					<tr>
							<td width="33%" align="left">
								<xsl:apply-templates select="$project/header/left/*|$project/header/left/text()"/>
							</td>
							<td width="33%" align="center">
								<xsl:apply-templates select="$project/header/center/*|$project/header/center/text()"/>
							</td>
							<td width="33%" align="right">
								<xsl:apply-templates select="$project/header/right/*|$project/header/right/text()"/>
							</td>
					</tr>
				</table>
				
				<!--  
				<hr noshade="noshade" size="1"/>
				-->
					
				<xsl:comment>TOP LINK MENU NAVIGATION</xsl:comment>
				<xsl:apply-templates select="$project/body/links"/>
				
				<table border="0" width="100%" cellspacing="4">
					<tr>
						<xsl:comment>LEFT SIDE NAVIGATION</xsl:comment>
						<td valign="top" align="left" nowrap="nowrap" class="leftcol">
							<xsl:apply-templates select="$project/body/menu|$project/body/menuSeparator"/>
						</td>
						<xsl:comment>LEFT SIDE SUBNAVIGATION</xsl:comment>

						<xsl:if test="body/menu">
							<td align="left" valign="top" nowrap="nowrap" class="leftcol">
									<xsl:apply-templates select="body/menu|body/menuSeparator"/>
							</td>
						</xsl:if>
						
						<xsl:comment>RIGHT SIDE MAIN BODY</xsl:comment>
						<td align="left" valign="top">
							<xsl:apply-templates select="body/section"/>
						</td>
						<xsl:comment>RIGHT SIDE NAVIGATION</xsl:comment>
						<xsl:if test="$project/rightbody/menu">
							<td valign="top" nowrap="nowrap">
								<xsl:apply-templates select="$project/rightbody/menu|$project/rightbody/menuSeparator"/>
							</td>
						</xsl:if>
					</tr>
				</table>
				
				<xsl:comment>FOOTER SEPARATOR</xsl:comment>
				<hr noshade="noshade" size="1"/>

				<xsl:comment>FOOTER</xsl:comment>
				<table border="0" width="100%" cellspacing="0" bgcolor="{$header-bg}">
					<tr>
						<td width="33%" align="left">
							<xsl:apply-templates select="$project/footer/left/*|$project/footer/left/text()"/>
						</td>
						<td width="33%" align="center">
							<xsl:apply-templates select="$project/footer/center/*|$project/footer/center/text()"/>
						</td>
						<td width="33%" align="right">
							<xsl:apply-templates select="$project/footer/right/*|$project/footer/right/text()"/>
						</td>
					</tr>
				</table>
			</body>
		</html>
	</xsl:template>
	
	<!-- Process a menu for the navigation bar -->
	<xsl:template match="menu">
		<div class="frame item">
			<div class="name">
				<xsl:value-of select="@name"/>
			</div>
			<div class="content">
				<xsl:apply-templates select="item"/>
			</div>
		</div>
	</xsl:template>
	
	<!-- Process a menuSeparator for the navigation bar -->
	<xsl:template match="menuSeparator">
		<p></p>
	</xsl:template>
	
	<!-- Process a menu item for the navigation bar -->
	<xsl:template match="item">
		<xsl:choose>
			<xsl:when test="@name = 'GoogleSearch'">
				<form action="http://www.google.com/search" method="get">
					<!-- <input type="submit" value="Search"/> -->
					<input type="hidden" name="as_sitesearch">
						<xsl:attribute name="value">
							<xsl:value-of select="@href"/>
						</xsl:attribute>
					</input>
					<input type="text" value="" size="13" maxLength="256" name="as_q"/>
				</form>
			</xsl:when>
			<xsl:when test="@name = 'hr'">
				<hr noshade="noshade" size="1"/>
			</xsl:when>
			<xsl:when test="@href">
				<xsl:variable name="href">
					<xsl:choose>
						<xsl:when test="starts-with(@href, 'http://')">
							<xsl:value-of select="@href"/>
						</xsl:when>
						<xsl:when test="starts-with(@href, 'https://')">
							<xsl:value-of select="@href"/>
						</xsl:when>
						<xsl:when test="starts-with(@href, '/site')">
							<xsl:text>http://jakarta.apache.org</xsl:text>
							<xsl:value-of select="@href"/>
						</xsl:when>
						<xsl:when test="starts-with(@href, '#')">
							<xsl:value-of select="@href"/>
						</xsl:when>
						<xsl:otherwise>
							<xsl:value-of select="$relative-path"/>
							<xsl:value-of select="@href"/>
						</xsl:otherwise>
					</xsl:choose>
				</xsl:variable>
				<a href="{$href}">
					<xsl:value-of select="@name"/>
				</a>
				<!-- 
				<br/>
				-->
			</xsl:when>
			<xsl:otherwise>
				<div>
					<xsl:value-of select="@name"/>
				</div>
			</xsl:otherwise>
		</xsl:choose>
		<xsl:apply-templates select="subitem"/>
	</xsl:template>
	
	<!-- Process a menu item for the navigation bar -->
	<xsl:template match="subitem">
		<xsl:choose>
			<xsl:when test="@name = 'hr'">
				<hr noshade="noshade" size="1"/>
			</xsl:when>
			<xsl:when test="@href">
				<xsl:variable name="href">
					<xsl:choose>
						<xsl:when test="starts-with(@href, 'http://')">
							<xsl:value-of select="@href"/>
						</xsl:when>
						<xsl:when test="starts-with(@href, 'https://')">
							<xsl:value-of select="@href"/>
						</xsl:when>
						<xsl:when test="starts-with(@href, '/site')">
							<xsl:text>http://jakarta.apache.org</xsl:text>
							<xsl:value-of select="@href"/>
						</xsl:when>
						<xsl:when test="starts-with(@href, '#')">
							<xsl:value-of select="@href"/>
						</xsl:when>
						<xsl:otherwise>
							<xsl:value-of select="$relative-path"/>
							<xsl:value-of select="@href"/>
						</xsl:otherwise>
					</xsl:choose>
				</xsl:variable>
				<!-- 
				<br/>
				-->
				<a href="{$href}">
				&#160;&#160;&#160;&#160;-
					<xsl:value-of select="@name"/>
				</a>
			</xsl:when>
			<xsl:otherwise>
				<div>
				&#160;&#160;&#160;&#160;-
				<xsl:value-of select="@name"/>
				</div>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>
	
	<!-- Process top link menu navigation bar -->
	<xsl:template match="links">
		<div class="link">
			<table border="0" width="100%" cellpadding="0" cellspacing="0">
				<tr valign="baseline" >
					<td align="left">
						<xsl:for-each select="item">
							<xsl:call-template name="linkitem"/>
						</xsl:for-each>
					</td>
					<td align="right">
						<xsl:if test="@currentVersion"> Version <xsl:value-of
							select="@currentVersion"/> - </xsl:if>
						<xsl:if test="@lastPublished"> Last published <xsl:value-of select="@lastPublished"/>
						</xsl:if>
					</td>
				</tr>
			</table>
		</div>
	</xsl:template>
	
	<!-- Process a topmenu item for the top navigation bar -->
	<xsl:template name="linkitem">
		<xsl:variable name="href">
			<xsl:choose>
				<xsl:when test="starts-with(@href, 'http://')">
					<xsl:value-of select="@href"/>
				</xsl:when>
				<xsl:when test="starts-with(@href, '/site')">
					<xsl:text>http://jakarta.apache.org</xsl:text>
					<xsl:value-of select="@href"/>
				</xsl:when>
				<xsl:otherwise>
					<xsl:value-of select="$relative-path"/>
					<xsl:value-of select="@href"/>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:variable>
		<a href="{$href}">
			<xsl:attribute name="title">Click to jump to <xsl:value-of select="@name"/>
			</xsl:attribute>
			<font color="{$toplinkitem-color}">
				<xsl:value-of select="@name"/>
			</font>
		</a> 
	</xsl:template>
		
	<!-- Process a documentation section -->
	<xsl:template match="section">
		<xsl:variable name="name">
			<xsl:value-of select="@name"/>
		</xsl:variable>
		<table border="0" cellspacing="0" cellpadding="2" width="100%">
			<!-- Section heading -->
			<tr>
				<td bgcolor="{$banner-bg}">
					<font color="{$banner-fg}" face="arial,helvetica.sanserif">
						<a name="{$name}">
							<strong>
								<xsl:value-of select="@name"/>
							</strong>
						</a>
					</font>
				</td>
			</tr>
			<!-- Section body -->
			<tr>
				<td>
					<blockquote>
						<xsl:apply-templates/>
					</blockquote>
				</td>
			</tr>
		</table>
	</xsl:template>
	
	<!-- Process a documentation subsection -->
	<xsl:template match="subsection">
		<xsl:variable name="name">
			<xsl:value-of select="@name"/>
		</xsl:variable>
		<table border="0" cellspacing="0" cellpadding="2" width="100%">
			<!-- Subsection heading -->
			<tr>
				<td bgcolor="{$sub-banner-bg}">
					<font color="{$sub-banner-fg}" face="arial,helvetica.sanserif">
						<a name="{$name}">
							<strong>
								<xsl:value-of select="@name"/>
							</strong>
						</a>
					</font>
				</td>
			</tr>
			<!-- Subsection body -->
			<tr>
				<td>
					<blockquote>
						<xsl:apply-templates/>
					</blockquote>
				</td>
			</tr>
		</table>
	</xsl:template>
	
	<!-- process a note element -->
	<xsl:template match="note">
		<xsl:variable name="name">
			<xsl:value-of select="@name"/>
		</xsl:variable>
		<div class="frame note">
			<div class="name">
				<a name="{$name}">
					<xsl:value-of select="@name"/>
				</a>
			</div>
			<div class="content">
				<xsl:apply-templates/>
			</div>
		</div>
	</xsl:template>
	
	<!-- process a warning element -->
	<xsl:template match="warning">
		<div class="frame warning">
			<div class="name">
				<xsl:value-of select="@name"/>
			</div>
			<div class="content">
				<xsl:apply-templates/>
			</div>
		</div>
	</xsl:template>
	
	<!-- process a fixme element -->
	<xsl:template match="fixme">
		<div class="frame fixme">
			<div class="name">
				<xsl:value-of select="@name"/>
			</div>
			<div class="content">
				<xsl:apply-templates/>
			</div>
		</div>
	</xsl:template>
	
	<!-- process a listing element -->
	<xsl:template match="listing">
		<xsl:variable name="name">
			<xsl:value-of select="@name"/>
		</xsl:variable>
		<div class="frame listing">
			<div class="name">
				<a name="{$name}">
					<xsl:value-of select="@name"/>
				</a>
			</div>
			<div class="listingcontent">
				<xsl:apply-templates/>
			</div>
		</div>
	</xsl:template>
	
	<!-- different color for even and odd table rows trx -->
	<xsl:template match="xtbody">
		<xsl:for-each select="tr">
			<tr valign="top">
				  <xsl:attribute name="class">
					 <xsl:choose>
					  <xsl:when test="position() mod 2 = 1">table rowodd</xsl:when>
					  <xsl:otherwise>table roweven</xsl:otherwise>
					</xsl:choose>
				  </xsl:attribute>
				  <xsl:apply-templates />
			</tr>
		</xsl:for-each>
	</xsl:template>

	<!-- handle th ala site.vsl -->
	<xsl:template match="xth">
		<td class="table header" valign="top">
			<xsl:if test="@colspan">
				<xsl:attribute name="colspan">
					<xsl:value-of select="@colspan"/>
				</xsl:attribute>
			</xsl:if>
			<xsl:if test="@rowspan">
				<xsl:attribute name="rowspan">
					<xsl:value-of select="@rowspan"/>
				</xsl:attribute>
			</xsl:if>
			<xsl:apply-templates/>
		</td>
	</xsl:template>
	
	<!-- handle td ala site.vsl -->
	<xsl:template match="td">
		<td class="table row" valign="top">
			<xsl:if test="@colspan">
				<xsl:attribute name="colspan">
					<xsl:value-of select="@colspan"/>
				</xsl:attribute>
			</xsl:if>
			<xsl:if test="@rowspan">
				<xsl:attribute name="rowspan">
					<xsl:value-of select="@rowspan"/>
				</xsl:attribute>
			</xsl:if>
			<xsl:apply-templates/>
		</td>
	</xsl:template>
	

	<!-- Process everything else by just passing it through -->
	<xsl:template match="*|@*">
		<xsl:copy>
			<xsl:apply-templates select="@*|*|text()"/>
		</xsl:copy>
	</xsl:template>
	

	<!-- process a xsource element -->
	<!--
		<xsl:template match="xsource">
			<div class="frame xsource">
				<xsl:if test="@name">
					<div class="name">
						<xsl:value-of select="@name"/>
					</div>
				</xsl:if>
				<div class="content">
					<pre>
						<xsl:apply-templates/>
					</pre>
				</div>
			</div>
		</xsl:template>
	-->
	

	<!-- Process a source code example -->
	<!--
		<xsl:template match="source">
			<div align="left">
				<table cellspacing="4" cellpadding="0" border="0">
					<tr>
						<td bgcolor="{$source-color}" width="1" height="1">
							<img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/>
						</td>
						<td bgcolor="{$source-color}" height="1">
							<img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/>
						</td>
						<td bgcolor="{$source-color}" width="1" height="1">
							<img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/>
						</td>
					</tr>
					<tr>
						<td bgcolor="{$source-color}" width="1">
							<img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/>
						</td>
						<td bgcolor="#ffffff" height="1">
							<pre>
								<xsl:value-of select="."/>
							</pre>
						</td>
						<td bgcolor="{$source-color}" width="1">
							<img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/>
						</td>
					</tr>
					<tr>
						<td bgcolor="{$source-color}" width="1" height="1">
							<img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/>
						</td>
						<td bgcolor="{$source-color}" height="1">
							<img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/>
						</td>
						<td bgcolor="{$source-color}" width="1" height="1">
							<img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/>
						</td>
					</tr>
				</table>
			</div>
		</xsl:template>
	-->	
</xsl:stylesheet>