1 <?xml version="1.0" encoding="UTF-8"?>
3 Licensed to the Apache Software Foundation (ASF) under one or more
4 contributor license agreements. See the NOTICE file distributed with
5 this work for additional information regarding copyright ownership.
6 The ASF licenses this file to You under the Apache License, Version 2.0
7 (the "License"); you may not use this file except in compliance with
8 the License. You may obtain a copy of the License at
10 http://www.apache.org/licenses/LICENSE-2.0
12 Unless required by applicable law or agreed to in writing, software
13 distributed under the License is distributed on an "AS IS" BASIS,
14 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 See the License for the specific language governing permissions and
16 limitations under the License.
19 Stylesheet that generates "package.html" for Javadoc tool
20 from jdbc-pool.xml documentation file.
21 It is based on "tomcat-docs" stylesheet, but it needs to avoid
22 generating complicated headers and footers, as those cannot be
23 digested by Javadoc tool and break layout of javadoc pages.
25 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
29 <!-- Output method -->
30 <xsl:output method="html"
35 <!-- Defined parameters (overrideable) -->
36 <xsl:param name="relative-path" select="'.'"/>
37 <xsl:param name="void-image" select="'/images/void.gif'"/>
38 <xsl:param name="standalone" select="''"/>
39 <xsl:param name="buglink" select="'http://bz.apache.org/bugzilla/show_bug.cgi?id='"/>
40 <xsl:param name="revlink" select="'http://svn.apache.org/viewvc?view=rev&rev='"/>
42 <!-- Defined variables (non-overrideable) -->
43 <xsl:variable name="body-bg" select="'#ffffff'"/>
44 <xsl:variable name="body-fg" select="'#000000'"/>
45 <xsl:variable name="body-link" select="'#525D76'"/>
46 <xsl:variable name="banner-bg" select="'#525D76'"/>
47 <xsl:variable name="banner-fg" select="'#ffffff'"/>
48 <xsl:variable name="sub-banner-bg" select="'#828DA6'"/>
49 <xsl:variable name="sub-banner-fg" select="'#ffffff'"/>
50 <xsl:variable name="source-color" select="'#023264'"/>
51 <xsl:variable name="attributes-color" select="'#023264'"/>
52 <xsl:variable name="table-th-bg" select="'#039acc'"/>
53 <xsl:variable name="table-td-bg" select="'#a0ddf0'"/>
55 <!-- Process an entire document into an HTML page -->
56 <xsl:template match="document">
57 <xsl:variable name="project"
58 select="document('project.xml')/project"/>
61 <title><xsl:value-of select="project/title"/> - <xsl:value-of select="properties/title"/></title>
64 <body bgcolor="{$body-bg}" text="{$body-fg}" link="{$body-link}"
65 alink="{$body-link}" vlink="{$body-link}">
67 <h2><xsl:value-of select="properties/title"/>.</h2>
68 <xsl:apply-templates select="body/section"/>
75 <!-- Process a documentation section -->
76 <xsl:template match="section">
77 <xsl:variable name="name">
78 <xsl:value-of select="@name"/>
80 <table border="0" cellspacing="0" cellpadding="2">
81 <!-- Section heading -->
82 <tr><td bgcolor="{$banner-bg}">
83 <font color="{$banner-fg}" face="arial,helvetica.sanserif">
85 <strong><xsl:value-of select="@name"/></strong></a></font>
89 <xsl:apply-templates/>
90 </blockquote></td></tr>
95 <!-- Process a documentation subsection -->
96 <xsl:template match="subsection">
97 <xsl:variable name="name">
98 <xsl:value-of select="@name"/>
100 <table border="0" cellspacing="0" cellpadding="2">
101 <!-- Subsection heading -->
102 <tr><td bgcolor="{$sub-banner-bg}">
103 <font color="{$sub-banner-fg}" face="arial,helvetica.sanserif">
105 <strong><xsl:value-of select="@name"/></strong></a></font>
107 <!-- Subsection body -->
109 <xsl:apply-templates/>
110 </blockquote></td></tr>
115 <!-- Process a source code example -->
116 <xsl:template match="source">
117 <xsl:variable name="void">
118 <xsl:value-of select="$relative-path"/><xsl:value-of select="$void-image"/>
121 <table cellspacing="4" cellpadding="0" border="0">
123 <td bgcolor="{$source-color}" width="1" height="1">
124 <img src="{$void}" width="1" height="1" vspace="0" hspace="0" border="0"/>
126 <td bgcolor="{$source-color}" height="1">
127 <img src="{$void}" width="1" height="1" vspace="0" hspace="0" border="0"/>
129 <td bgcolor="{$source-color}" width="1" height="1">
130 <img src="{$void}" width="1" height="1" vspace="0" hspace="0" border="0"/>
134 <td bgcolor="{$source-color}" width="1">
135 <img src="{$void}" width="1" height="1" vspace="0" hspace="0" border="0"/>
137 <td bgcolor="#ffffff" height="1"><pre>
138 <xsl:value-of select="."/>
140 <td bgcolor="{$source-color}" width="1">
141 <img src="{$void}" width="1" height="1" vspace="0" hspace="0" border="0"/>
145 <td bgcolor="{$source-color}" width="1" height="1">
146 <img src="{$void}" width="1" height="1" vspace="0" hspace="0" border="0"/>
148 <td bgcolor="{$source-color}" height="1">
149 <img src="{$void}" width="1" height="1" vspace="0" hspace="0" border="0"/>
151 <td bgcolor="{$source-color}" width="1" height="1">
152 <img src="{$void}" width="1" height="1" vspace="0" hspace="0" border="0"/>
160 <!-- Process an attributes list with nested attribute elements -->
161 <xsl:template match="attributes">
162 <table border="1" cellpadding="5">
164 <th width="15%" bgcolor="{$attributes-color}">
165 <font color="#ffffff">Attribute</font>
167 <th width="85%" bgcolor="{$attributes-color}">
168 <font color="#ffffff">Description</font>
171 <xsl:for-each select="attribute">
173 <td align="left" valign="center">
174 <xsl:if test="@required = 'true'">
175 <strong><code><xsl:value-of select="@name"/></code></strong>
177 <xsl:if test="@required != 'true'">
178 <code><xsl:value-of select="@name"/></code>
181 <td align="left" valign="center">
182 <xsl:apply-templates/>
189 <!-- Process a properties list with nested property elements -->
190 <xsl:template match="properties">
191 <table border="1" cellpadding="5">
193 <th width="15%" bgcolor="{$attributes-color}">
194 <font color="#ffffff">Property</font>
196 <th width="85%" bgcolor="{$attributes-color}">
197 <font color="#ffffff">Description</font>
200 <xsl:for-each select="property">
202 <td align="left" valign="center">
203 <code><xsl:value-of select="@name"/></code>
205 <td align="left" valign="center">
206 <xsl:apply-templates/>
213 <!-- Fix relative links in printer friendly versions of the docs -->
214 <xsl:template match="a">
215 <xsl:variable name="href" select="@href"/>
217 <xsl:when test="$standalone = 'standalone'">
218 <xsl:apply-templates/>
220 <xsl:when test="$href != ''">
221 <a href="{$href}"><xsl:apply-templates/></a>
224 <xsl:variable name="name" select="@name"/>
225 <a name="{$name}"><xsl:apply-templates/></a>
230 <!-- Link to a bug report -->
231 <xsl:template match="bug">
232 <xsl:variable name="link"><xsl:value-of select="$buglink"/><xsl:value-of select="text()"/></xsl:variable>
233 <a href="{$link}"><xsl:apply-templates/></a>
236 <!-- Link to a SVN revision report -->
237 <xsl:template match="rev">
238 <xsl:variable name="link"><xsl:value-of select="$revlink"/><xsl:value-of select="text()"/></xsl:variable>
239 <a href="{$link}"><xsl:apply-templates/></a>
242 <!-- Process everything else by just passing it through -->
243 <xsl:template match="*|@*">
245 <xsl:apply-templates select="@*|*|text()"/>