File: style.xsl

package info (click to toggle)
libgroboutils-java 5-2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 8,496 kB
  • sloc: java: 59,880; xml: 12,762; sh: 377; perl: 104; makefile: 20
file content (432 lines) | stat: -rw-r--r-- 15,399 bytes parent folder | download | duplicates (3)
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
<?xml version="1.0" encoding="ISO-8859-1"?>

<!--
Site-wide style for each sub-project
version $Date: 2004/04/17 08:24:38 $


All documents in this category must be only one directory under the root
(base) GroboUtils document directory, since that's how the links are setup.
-->

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

    <xsl:output method="html" indent="no" />

    <xsl:param name="logoBGColor" select="'#000000'" />
    <xsl:param name="logo2BGColor" select="'#F0F0F0'" />
    <xsl:param name="projectdir" select="'.'" />
    <xsl:param name="projectname" select="'[unknown]'" />
    <xsl:param name="projectversion" select="'[unknown]'" />
    
    <!-- base document -->
    <xsl:template match="document">
<HTML>
<xsl:comment>
WARNING: DO NOT EDIT THIS FILE

This file was auto-generated.  Please look at the .xml version of this file
and edit that one instead.
</xsl:comment>
<HEAD>
    <LINK HREF="../favicon.ico" REL="SHORTCUT ICON" />
    <TITLE>
    GroboUtils - <xsl:value-of select="head/name/text()" />
    </TITLE>
    <LINK REL="stylesheet" TYPE="text/css" HREF="../stylesheet.css" TITLE="Style" />
    <LINK REL="start" HREF="../index.html" TITLE="GroboUtils Home" />
    <LINK REL="contents" HREF="index.html">
        <xsl:attribute name="TITLE"><xsl:value-of select="$projectname" /> Home</xsl:attribute>
    </LINK>
    <xsl:if test="head/name/@url != 'index.html'">
        <LINK REL="up" HREF="index.html" />
    </xsl:if>
    <LINK REL="index" HREF="index.html" />
    
    <LINK REL="bookmark" HREF="../license.html" TITLE="License" />
    <LINK REL="bookmark" HREF="../allprojects.html" TITLE="Project List" />
    <LINK REL="bookmark" HREF="../contacts.html" TITLE="Contacts" />
    <LINK REL="bookmark" HREF="https://sourceforge.net/projects/groboutils/" TITLE="Sourceforge Project" />
    <LINK REL="bookmark" HREF="https://sourceforge.net/forum/?group_id=22594" TITLE="Forums" />
    <LINK REL="bookmark" HREF="../downloads.html" TITLE="Downloads" />
    <LINK REL="bookmark" HREF="../documents.html" TITLE="JavaDoc" />
    <LINK REL="bookmark" HREF="../dependencies.html" TITLE="Dependencies" />
    <LINK REL="bookmark" HREF="../building.html" TITLE="Building" />
</HEAD>
<BODY>
<TABLE BORDER="0" WIDTH="100%">
<!--
    <TR><TD COLSPAN="2" ALIGN="LEFT" VALIGN="TOP">
        <xsl:attribute name="BGCOLOR"><xsl:value-of select="$logoBGColor" /></xsl:attribute>
    <IMG SRC="../images/logo.png" ALT="GroboUtils" HEIGHT="100" WIDTH="401" />
    </TD></TR>
-->
    
    <TR><TD WIDTH="20%" VALIGN="TOP" NOWRAP="TRUE">
<!-- start nav bar -->
<TABLE><TR><TD>
        <xsl:attribute name="BGCOLOR"><xsl:value-of select="$logo2BGColor" /></xsl:attribute>
<A HREF="../index.html">
<IMG SRC="../images/logo2.png" ALT="GroboUtils" HEIGHT="180" WIDTH="175" />
<!-- actual dimensions: HEIGHT="211" WIDTH="205" -->
</A>
</TD></TR></TABLE>
<!-- start nav bar -->

<P><STRONG>About GroboUtils</STRONG></P>
<UL><LI>
<xsl:call-template name="NavBarEl">
  <xsl:with-param name="Title" select="'Welcome'" />
  <xsl:with-param name="Url" select="'index.html'" />
</xsl:call-template>
</LI><LI>
<xsl:call-template name="NavBarEl">
  <xsl:with-param name="Title" select="'License'" />
  <xsl:with-param name="Url" select="'license.html'" />
</xsl:call-template>
</LI><LI>
<xsl:call-template name="NavBarEl">
  <xsl:with-param name="Title" select="'Project List'" />
  <xsl:with-param name="Url" select="'allprojects.html'" />
</xsl:call-template>
</LI><LI>
<xsl:call-template name="NavBarEl">
  <xsl:with-param name="Title" select="'Contacts'" />
  <xsl:with-param name="Url" select="'contacts.html'" />
</xsl:call-template>
</LI><LI>
<xsl:call-template name="NavBarEl">
  <xsl:with-param name="Title" select="'Articles'" />
  <xsl:with-param name="Url" select="'articles.html'" />
</xsl:call-template>
</LI></UL>
<P><STRONG><a href="https://sourceforge.net/projects/groboutils/">Sourceforge<BR
/>Project</a></STRONG></P>
<UL><LI>
<a href="https://sourceforge.net/forum/?group_id=22594">Forums</a>
</LI><LI>
<a href="https://sourceforge.net/tracker/?group_id=22594&amp;atid=375589">Bugs</a>
</LI><LI>
<a href="https://sourceforge.net/tracker/?atid=375592&amp;group_id=22594">Feature Requests</a>
</LI></UL>

<P><STRONG>For Developers</STRONG></P>
<UL><LI>
<xsl:call-template name="NavBarEl">
  <xsl:with-param name="Title" select="'Downloads'" />
  <xsl:with-param name="Url" select="'downloads.html'" />
</xsl:call-template>
</LI><LI>
<xsl:call-template name="NavBarEl">
  <xsl:with-param name="Title" select="'Javadoc'" />
  <xsl:with-param name="Url" select="'documents.html'" />
</xsl:call-template>
</LI><LI>
<xsl:call-template name="NavBarEl">
  <xsl:with-param name="Title" select="'Dependencies'" />
  <xsl:with-param name="Url" select="'dependencies.html'" />
</xsl:call-template>
</LI><LI>
<xsl:call-template name="NavBarEl">
  <xsl:with-param name="Title" select="'Building'" />
  <xsl:with-param name="Url" select="'building.html'" />
</xsl:call-template>
</LI></UL>
</TD>


<!-- end nav bar -->

<!-- start the current page -->
<TD WIDTH="80%" ALIGN="LEFT" VALIGN="TOP">
<P STYLE="font-size: smaller; text-align: right;"><i><a href="index.html">
<xsl:value-of select="$projectname" /> version
<xsl:value-of select="$projectversion" /></a></i></P>
<CENTER>
<H1><!-- <xsl:value-of select="$projectname"/>: -->
<xsl:value-of select="head/name/text()" /></H1>
</CENTER>
<xsl:if test="head/author"> <!-- if there is a second node,
    then use the plural form. -->
    <P STYLE="font-size: smaller; text-align: left;"><i>
    <xsl:choose><xsl:when test="head/author[2]">Authors:</xsl:when
    ><xsl:otherwise>Author:</xsl:otherwise></xsl:choose> <xsl:apply-templates
    select="head/author"  /></i></P></xsl:if>
<xsl:if test="head/doc-version"><xsl:comment>
version: <xsl:value-of select="head/doc-version/text()" />
</xsl:comment></xsl:if>

<xsl:apply-templates select="body" />

</TD></TR>
</TABLE>
<BR /><BR />
<TABLE WIDTH="100%">
<TR>
    <TD COLSPAN="2" WIDTH="100%">
        <HR />
    </TD>
</TR>
<TR>
    <TD ALIGN="LEFT" WIDTH="30%">
        <A href="https://sourceforge.net"><IMG
            src="https://sourceforge.net/sflogo.php?group_id=22594&amp;type=1"
            width="88" height="31" border="0" alt="SourceForge Logo" /></A>
        <BR />
        <I>This space graciously provided by the SourceForge project</I>
    </TD>
    <TD ALIGN="RIGHT" WIDTH="70%">
        <I><xsl:text disable-output-escaping="yes">Copyright &amp;copy;
2002-2004 GroboUtils Project.</xsl:text><BR />All rights reserved.</I>
    </TD>
</TR>
</TABLE>
</BODY>
</HTML>
    </xsl:template>

    <xsl:template name="NavBarEl">
        <xsl:param name="Title" select="unknown" />
        <xsl:param name="Url" select="unknown" />
        <!--
        <xsl:message terminate="no">
        Nav link for <xsl:value-of select="$Title" />.
        </xsl:message>
        -->
        <a href="../{$Url}"><xsl:value-of select="$Title" /></a>
    </xsl:template>

    <xsl:template match="author"><xsl:if
            test="preceding-sibling::author[position()=1]"
            >, </xsl:if><xsl:apply-templates select="text()|*" /></xsl:template>

    <!-- Copy all the text -->
    <xsl:template match="body">
        <xsl:apply-templates select="text()|*" />
    </xsl:template>
    
    <xsl:template match="description">
        <xsl:apply-templates select="text()|*" />
    </xsl:template>

    <xsl:template match="special-text">
        <xsl:apply-templates select="text()|*" />
    </xsl:template>
    
    <!-- easy way to make links -->
    <xsl:template match="ant-link">
        <tt><a><xsl:attribute
            name="href">http://ant.apache.org/manual/<xsl:value-of
            select="@href" /></xsl:attribute><xsl:value-of select="text()"
            /></a></tt>
    </xsl:template>
    
    <xsl:template match="link">
        <a href="{@name}.html"><xsl:value-of select="text()" /></a>
    </xsl:template>
    
    <xsl:template match="ref">
        <a href="#{@name}">[<xsl:value-of select="@name" />]</a>
    </xsl:template>
    
    <xsl:template match="subdir">
        <a href="{@name}/index.html"><xsl:value-of select="text()" /></a>
    </xsl:template>
    
    <xsl:template match="javabug">
        <a href="http://developer.java.sun.com/developer/bugParade/bugs/{@bugid}.html"><xsl:value-of select="@bugid" /></a>
    </xsl:template>
    
    <xsl:template match="source">
        <PRE>
<xsl:apply-templates select="text()|*" />
<!--
<xsl:call-template name="CopyWithTemplates" />
<xsl:value-of select="text()" />
-->
        </PRE>
    </xsl:template>
    
    <xsl:template match="section">
        <xsl:if test="@name">
            <A><xsl:attribute
            name="NAME"><xsl:value-of select="@name" /></xsl:attribute></A>
        </xsl:if>
        <xsl:choose>
            <xsl:when test="@level">
                <xsl:element name="concat('H',@level+1)">
                    <xsl:apply-templates select="text()|*" />
                </xsl:element>
            </xsl:when>
            <xsl:otherwise>
                <H3><xsl:apply-templates select="text()|*" /></H3>
            </xsl:otherwise>
        </xsl:choose>
    </xsl:template>
    
    <xsl:template match="toc">
        <H2><xsl:choose
        ><xsl:when test="string-length(normalize-space(text())) &lt;= 0"
        >Table Of Contents</xsl:when><xsl:otherwise
        ><xsl:value-of select="text()" /></xsl:otherwise></xsl:choose></H2>
        <OL>
            <xsl:apply-templates select="*" />
        </OL>
    </xsl:template>
    
    <xsl:template match="li-toc">
        <LI><xsl:value-of select="text()" />
            <OL>
                <xsl:apply-templates select="*" />
            </OL>
        </LI>
    </xsl:template>
    
    <xsl:template match="definition">
        <LI>
        <B><xsl:value-of select="@term" />:</B>
        <xsl:apply-templates select="text()|*" />
        </LI>
    </xsl:template>
    
    <xsl:template match="definition-link">
        <LI>
        <B><a href="{@href}"><xsl:value-of select="@term" /></a>:</B>
        <xsl:apply-templates select="text()" />
        </LI>
    </xsl:template>
    
    <xsl:template match="reflist">
        <H3><a name="references">References</a></H3>
        <TABLE BORDER="0" WIDTH="100%">
            <xsl:apply-templates />
        </TABLE>
    </xsl:template>
    
    <xsl:template match="refitem">
            <TR><TD VALIGN="TOP" ALIGN="LEFT" WIDTH="20%"><a>
                <xsl:attribute name="name"><xsl:value-of select="@id"
                /></xsl:attribute>[<xsl:value-of select="@id" />]</a></TD>
            <TD VALIGN="TOP" ALIGN="LEFT" WIDTH="80%">
            <xsl:apply-templates select="text()|*" />
            </TD>
            </TR>
    </xsl:template>
    
    <!--
      Ant Tasks
      -->
    <xsl:template match="anttask">
        <H2><a><xsl:attribute name="name"><xsl:value-of select='@name' /></xsl:attribute><xsl:value-of select='@name' /></a></H2>
        <xsl:if test="description" >
        <H3>Description</H3>
            <xsl:apply-templates select="description" />
        <BR />
        </xsl:if>
        <xsl:call-template name="ant-nested-element-table" />
        <xsl:call-template name="ant-param-table" />
        <xsl:if test="ant-example">
        <H3>Examples</H3>
            <xsl:apply-templates select="ant-example" />
            <BR />
        </xsl:if>
    </xsl:template>
    
    <xsl:template name="ant-nested-element-table">
        <xsl:if test="ant-nested-element">
        <H3>Nested Elements</H3>
            <xsl:apply-templates select="ant-nested-element" >
                    <!-- <xsl:sort select="@name" /> -->
            </xsl:apply-templates>
        </xsl:if>
    </xsl:template>
    
    <xsl:template match="ant-nested-element">
        <table border="1"><tr><td>
        <H4><xsl:value-of select="@name" /></H4>
        <xsl:if test="description">
            <xsl:apply-templates select="description" />
            <BR />
        </xsl:if>
        <xsl:call-template name="ant-param-table" />
        <xsl:call-template name="ant-nested-element-table" />
        </td></tr></table>
        <BR />
    </xsl:template>
    
    <xsl:template name="ant-param-table">
        <xsl:if test="ant-parameter" >
    <H3>Parameters</H3>
    <TABLE BORDER="1" CELLPADDING="1" CELLSPACING="0">
        <TR>
            <TD VALIGN="top"><B>Attribute</B></TD>
            <TD VALIGN="top"><B>Description</B></TD>
            <TD ALIGN="center" VALIGN="top"><B>Required</B></TD>
        </TR>
        <xsl:apply-templates select="ant-parameter">
            <!-- <xsl:sort select="attribute/text()" /> -->
        </xsl:apply-templates>
    </TABLE>
        </xsl:if>
    </xsl:template>
    
    <xsl:template match="ant-parameter">
        <TR>
            <TD VALIGN="top"><CODE><xsl:value-of select="attribute/text()" /></CODE></TD>
            <TD VALIGN="top"><xsl:apply-templates select="description" /></TD>
            <TD VALIGN="top" ALIGN="center"><xsl:apply-templates select="required" /></TD>
        </TR>
    </xsl:template>
    
    <xsl:template match="ant-example">
        <xsl:apply-templates select="source" />
        <xsl:apply-templates select="description" />
        <xsl:if test="position()!=last()">
        <HR WIDTH="50%" />
        </xsl:if>
    </xsl:template>
    
    
    
    
    <!--
    this is for including the summary XML file inside the current
    page
            select="$summary//list/category[position()=1]/project[position()=1]">
    -->
    <xsl:template match="summary">
        <xsl:variable name="summary" select="document(concat($projectdir,'/xdocs/summary.xml'))"/>
        <H3>Project Summary:</H3>
        <xsl:for-each
                select="$summary//list/category/project">
            <xsl:message terminate="no">
            Found project in summary '<xsl:value-of select="name/text()"/>'.
            </xsl:message>
            <P><B>Section:</B><xsl:text
                disable-output-escaping="yes">&amp;nbsp;&amp;nbsp;</xsl:text
                ><SPAN STYLE="color: blue;"><xsl:value-of select="name/text()" />
                (<xsl:value-of select="package/text()" />)</SPAN><BR />
            <xsl:if test="description">
                <xsl:apply-templates select="description" />
                <BR />
            </xsl:if>
            <B>Status:</B> <xsl:apply-templates select="status/text()|status/*" />
            </P>
        </xsl:for-each>
    </xsl:template>
    
    
    <xsl:template match="project"><xsl:value-of
        select="$projectname" /></xsl:template>
    <xsl:template match="version"><xsl:value-of
        select="$projectversion" /></xsl:template>
    
    
    
    <!-- The copy stuff -->
    <xsl:template match="@*|node()" name="CopyWithTemplates">
        <xsl:copy>
            <xsl:apply-templates select="@*|node()" />
        </xsl:copy>
    </xsl:template>
</xsl:stylesheet>