1 | <?xml version='1.0'?> |
---|
2 | <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" |
---|
3 | xmlns:fo="http://www.w3.org/1999/XSL/Format" |
---|
4 | xmlns:date="http://exslt.org/dates-and-times" |
---|
5 | exclude-result-prefixes="date" |
---|
6 | version='1.0'> |
---|
7 | |
---|
8 | <xsl:import href="../../../lib/docbook/docbook/xsl/html/chunk.xsl" /> |
---|
9 | |
---|
10 | <!-- (MM20040315) xsl parameters moved from ant-build-docbook.xml to here --> |
---|
11 | <xsl:param name="table.borders.with.css" select="1"/> |
---|
12 | <xsl:param name="html.stylesheet">css/docbook.css</xsl:param> |
---|
13 | <xsl:param name="html.stylesheet.type">text/css</xsl:param> |
---|
14 | <xsl:param name="section.label.includes.component.label" select="1" /> |
---|
15 | <xsl:param name="section.autolabel" select="1" /> |
---|
16 | <xsl:param name="section.autolabel.max.depth" select="2" /> |
---|
17 | <xsl:param name="chunk.first.sections" select="1" /> |
---|
18 | <xsl:param name="chunk.section.depth" select="2" /> |
---|
19 | <xsl:param name="chunk.fast" select="1" /> |
---|
20 | <xsl:param name="toc.max.depth" select="4"/> |
---|
21 | <xsl:param name="toc.section.depth" select="3" /> |
---|
22 | <xsl:param name="generate.section.toc.level" select="1" /> |
---|
23 | <xsl:param name="generate.toc"> |
---|
24 | appendix toc,title |
---|
25 | article/appendix nop |
---|
26 | article toc,title |
---|
27 | book toc,title |
---|
28 | chapter toc,title |
---|
29 | part toc,title |
---|
30 | preface toc,title |
---|
31 | qandadiv toc |
---|
32 | qandaset toc |
---|
33 | reference toc,title |
---|
34 | sect1 toc |
---|
35 | sect2 toc |
---|
36 | sect3 toc |
---|
37 | sect4 toc |
---|
38 | sect5 toc |
---|
39 | section toc |
---|
40 | set toc,title |
---|
41 | </xsl:param> |
---|
42 | <!-- Turn off image scaling when generating HTML output --> |
---|
43 | <xsl:param name="make.graphic.viewport" select="0"/> |
---|
44 | <xsl:param name="ignore.image.scaling" select="1"/> |
---|
45 | |
---|
46 | <xsl:param name="callout.graphics" select="1" /> |
---|
47 | <xsl:param name="callout.graphics.path">gfx/admonitions/callouts/</xsl:param> |
---|
48 | <xsl:param name="callout.graphics.extension">.gif</xsl:param> |
---|
49 | <xsl:param name="admon.graphics" select="1"/> |
---|
50 | <xsl:param name="admon.graphics.path">gfx/admonitions/</xsl:param> |
---|
51 | <xsl:param name="admon.graphics.extension">.gif</xsl:param> |
---|
52 | <xsl:param name="admon.style"></xsl:param> |
---|
53 | <xsl:param name="admonition.title.properties">text-align: left</xsl:param> |
---|
54 | |
---|
55 | <xsl:param name="keep.relative.image.uris" select="false"/> |
---|
56 | <xsl:param name="use.id.as.filename" select="1"/> |
---|
57 | |
---|
58 | <!-- path to javadoc root as seen from docbook root --> |
---|
59 | <xsl:param name="javadoc.root.path">../api/</xsl:param> |
---|
60 | |
---|
61 | <xsl:param name="chunker.output.encoding">utf-8</xsl:param> |
---|
62 | <xsl:param name="chunker.output.indent">yes</xsl:param> |
---|
63 | <xsl:param name="chunker.message.nofilename">1</xsl:param> |
---|
64 | |
---|
65 | <!-- (MM20040315) base.dir and root.filename are coming from the ant-build-docbook.xml --> |
---|
66 | <xsl:param name="base.dir">@base.dir@/</xsl:param> |
---|
67 | <xsl:param name="root.filename">@root.filename@</xsl:param> |
---|
68 | |
---|
69 | <!-- doc.revision and doc.last.modified --> |
---|
70 | <xsl:param name="doc.revision">@doc.revision@</xsl:param> |
---|
71 | <xsl:param name="doc.last.modified">@doc.last.modified@</xsl:param> |
---|
72 | <xsl:param name="base.version">@base.version@</xsl:param> |
---|
73 | |
---|
74 | <!-- convert url-only references to a format that is wrappable --> |
---|
75 | |
---|
76 | <xsl:template match="ulink" name="ulink"> |
---|
77 | <xsl:choose> |
---|
78 | <xsl:when test="count(child::node())=0"> |
---|
79 | <a> |
---|
80 | <xsl:if test="@id"> |
---|
81 | <xsl:attribute name="name"> |
---|
82 | <xsl:value-of select="@id"/> |
---|
83 | </xsl:attribute> |
---|
84 | </xsl:if> |
---|
85 | <xsl:attribute name="href"><xsl:value-of select="@url"/></xsl:attribute> |
---|
86 | <xsl:if test="$ulink.target != ''"> |
---|
87 | <xsl:attribute name="target"> |
---|
88 | <xsl:value-of select="$ulink.target"/> |
---|
89 | </xsl:attribute> |
---|
90 | </xsl:if> |
---|
91 | <xsl:if test="count(child::node())=0"> |
---|
92 | <xsl:call-template name="insertInvisibleBreaks"> |
---|
93 | <xsl:with-param name="url" select="@url" /> |
---|
94 | <xsl:with-param name="breakat" select="translate(@url, '/-_:', '____')" /> |
---|
95 | </xsl:call-template> |
---|
96 | </xsl:if> |
---|
97 | </a> |
---|
98 | </xsl:when> |
---|
99 | <xsl:otherwise> |
---|
100 | <xsl:apply-imports/> |
---|
101 | </xsl:otherwise> |
---|
102 | </xsl:choose> |
---|
103 | </xsl:template> |
---|
104 | |
---|
105 | <xsl:template name="insertInvisibleBreaks"> |
---|
106 | <xsl:param name="url" /> |
---|
107 | <xsl:param name="breakat" /> |
---|
108 | <!-- <xsl:message><xsl:value-of select="concat('param:', $url, $breakat)" /></xsl:message> --> |
---|
109 | <xsl:choose> |
---|
110 | <xsl:when test="contains($breakat, '_')"> |
---|
111 | <xsl:value-of select="substring($url, 1, string-length(substring-before($breakat, '_'))+1)" /><wbr/> |
---|
112 | <xsl:call-template name="insertInvisibleBreaks"> |
---|
113 | <xsl:with-param name="url" select="substring($url, string-length(substring-before($breakat, '_'))+2)"/> |
---|
114 | <xsl:with-param name="breakat" select="substring($breakat, string-length(substring-before($breakat, '_'))+2)"/> |
---|
115 | </xsl:call-template> |
---|
116 | </xsl:when> |
---|
117 | <xsl:otherwise> |
---|
118 | <xsl:value-of select="$url" /> |
---|
119 | </xsl:otherwise> |
---|
120 | </xsl:choose> |
---|
121 | </xsl:template> |
---|
122 | |
---|
123 | <!-- Base specific templates --> |
---|
124 | |
---|
125 | <xsl:template match="helptext"> |
---|
126 | <xsl:choose> |
---|
127 | <xsl:when test="@webonly = '0'"> |
---|
128 | <xsl:apply-templates /> |
---|
129 | </xsl:when> |
---|
130 | </xsl:choose> |
---|
131 | </xsl:template> |
---|
132 | |
---|
133 | <xsl:template match="seeother|other"> |
---|
134 | </xsl:template> |
---|
135 | |
---|
136 | <xsl:template match="nohelp"> |
---|
137 | <xsl:apply-templates /> |
---|
138 | </xsl:template> |
---|
139 | |
---|
140 | <xsl:template match="command"> |
---|
141 | <xsl:call-template name="inline.monoseq"/> |
---|
142 | </xsl:template> |
---|
143 | |
---|
144 | <xsl:template name="script"> |
---|
145 | <xsl:param name="src"></xsl:param> |
---|
146 | <script> |
---|
147 | <xsl:attribute name="language">JavaScript</xsl:attribute> |
---|
148 | <xsl:attribute name="type">text/javascript</xsl:attribute> |
---|
149 | <xsl:attribute name="src"><xsl:value-of select="$src" /></xsl:attribute> |
---|
150 | </script> |
---|
151 | </xsl:template> |
---|
152 | |
---|
153 | <xsl:template name="user.head.content"> |
---|
154 | <xsl:variable name="pathtorootdir"> |
---|
155 | <xsl:call-template name="pathtorootdir" /> |
---|
156 | </xsl:variable> |
---|
157 | <link rel="stylesheet" |
---|
158 | type="text/css" |
---|
159 | href="{concat($pathtorootdir, 'css/SyntaxHighlighter.css')}"> |
---|
160 | </link> |
---|
161 | <xsl:call-template name="script"> |
---|
162 | <xsl:with-param name="src" select="concat($pathtorootdir, 'script/shCore.js')" /> |
---|
163 | </xsl:call-template> |
---|
164 | <xsl:call-template name="script"> |
---|
165 | <xsl:with-param name="src" select="concat($pathtorootdir, 'script/shBrushJava.js')" /> |
---|
166 | </xsl:call-template> |
---|
167 | <xsl:call-template name="script"> |
---|
168 | <xsl:with-param name="src" select="concat($pathtorootdir, 'script/shBrushXml.js')" /> |
---|
169 | </xsl:call-template> |
---|
170 | <xsl:call-template name="script"> |
---|
171 | <xsl:with-param name="src" select="concat($pathtorootdir, 'script/shBrushSql.js')" /> |
---|
172 | </xsl:call-template> |
---|
173 | </xsl:template> |
---|
174 | |
---|
175 | <xsl:template name="body.attributes"> |
---|
176 | <xsl:attribute name="onLoad">dp.SyntaxHighlighter.HighlightAll('pre', 'programlisting', null, false);</xsl:attribute> |
---|
177 | </xsl:template> |
---|
178 | |
---|
179 | <xsl:template name="user.footer.navigation"> |
---|
180 | <table width="100%"> |
---|
181 | <tr valign="bottom"><td> |
---|
182 | <div |
---|
183 | class="navfooter" |
---|
184 | align="left"> |
---|
185 | <p> |
---|
186 | <i> |
---|
187 | <xsl:if test="$doc.revision" > |
---|
188 | Version: <xsl:value-of select="$base.version"/> (build #<xsl:value-of select="$doc.revision"/>)<br/> |
---|
189 | </xsl:if> |
---|
190 | <xsl:if test="$doc.last.modified" > |
---|
191 | Book last modified: <xsl:value-of select="$doc.last.modified" /> |
---|
192 | </xsl:if> |
---|
193 | </i></p> |
---|
194 | </div> |
---|
195 | </td> |
---|
196 | <td> |
---|
197 | <div class="navfooter" align="right"> |
---|
198 | <i> |
---|
199 | Syntax coloring provided by <a href="http://www.dreamprojections.com/syntaxhighlighter">dp.SyntaxHighlighter</a> |
---|
200 | </i> |
---|
201 | </div> |
---|
202 | </td> |
---|
203 | </tr> |
---|
204 | </table> |
---|
205 | </xsl:template> |
---|
206 | |
---|
207 | <xsl:template name="convertpath"> |
---|
208 | <xsl:param name="path" select="''" /> |
---|
209 | <xsl:choose> |
---|
210 | <xsl:when test="contains($path, '/')"> |
---|
211 | <xsl:text>../</xsl:text> |
---|
212 | <xsl:call-template name="convertpath"> |
---|
213 | <xsl:with-param name="path" select="substring-after($path, '/')" /> |
---|
214 | </xsl:call-template> |
---|
215 | </xsl:when> |
---|
216 | </xsl:choose> |
---|
217 | </xsl:template> |
---|
218 | |
---|
219 | <xsl:template name="pathtorootdir"> |
---|
220 | <xsl:variable name="dir"> |
---|
221 | <xsl:call-template name="dbhtml-dir"> |
---|
222 | <xsl:with-param name="context" select="." /> |
---|
223 | </xsl:call-template> |
---|
224 | </xsl:variable> |
---|
225 | <xsl:call-template name="convertpath"> |
---|
226 | <xsl:with-param name="path" select="$dir" /> |
---|
227 | </xsl:call-template> |
---|
228 | </xsl:template> |
---|
229 | |
---|
230 | <xsl:template name="output.html.stylesheets"> |
---|
231 | <xsl:param name="stylesheets" select="''" /> |
---|
232 | <xsl:variable name="pathtorootdir"> |
---|
233 | <xsl:call-template name="pathtorootdir" /> |
---|
234 | </xsl:variable> |
---|
235 | <xsl:choose> |
---|
236 | <xsl:when test="contains($stylesheets, ' ')"> |
---|
237 | <link rel="stylesheet" |
---|
238 | href="{substring-before(concat($pathtorootdir, $stylesheets), ' ')}"> |
---|
239 | <xsl:if test="$html.stylesheet.type != ''"> |
---|
240 | <xsl:attribute name="type"> |
---|
241 | <xsl:value-of select="$html.stylesheet.type" /> |
---|
242 | </xsl:attribute> |
---|
243 | </xsl:if> |
---|
244 | </link> |
---|
245 | <xsl:call-template name="output.html.stylesheets"> |
---|
246 | <xsl:with-param name="stylesheets" select="substring-after($stylesheets, ' ')" /> |
---|
247 | </xsl:call-template> |
---|
248 | </xsl:when> |
---|
249 | <xsl:when test="$stylesheets != ''"> |
---|
250 | <link rel="stylesheet" href="{concat($pathtorootdir,$stylesheets)}"> |
---|
251 | <xsl:if test="$html.stylesheet.type != ''"> |
---|
252 | <xsl:attribute name="type"> |
---|
253 | <xsl:value-of select="$html.stylesheet.type" /> |
---|
254 | </xsl:attribute> |
---|
255 | </xsl:if> |
---|
256 | </link> |
---|
257 | </xsl:when> |
---|
258 | </xsl:choose> |
---|
259 | </xsl:template> |
---|
260 | |
---|
261 | <xsl:template name="admon.graphic"> |
---|
262 | <xsl:param name="node" select="." /> |
---|
263 | <xsl:variable name="pathtorootdir"> |
---|
264 | <xsl:call-template name="pathtorootdir"/> |
---|
265 | </xsl:variable> |
---|
266 | <xsl:value-of select="concat($pathtorootdir, $admon.graphics.path)" /> |
---|
267 | <xsl:choose> |
---|
268 | <xsl:when test="local-name($node)='note'">note</xsl:when> |
---|
269 | <xsl:when test="local-name($node)='warning'">warning</xsl:when> |
---|
270 | <xsl:when test="local-name($node)='caution'">caution</xsl:when> |
---|
271 | <xsl:when test="local-name($node)='tip'">tip</xsl:when> |
---|
272 | <xsl:when test="local-name($node)='important'">important</xsl:when> |
---|
273 | <xsl:otherwise>note</xsl:otherwise> |
---|
274 | </xsl:choose> |
---|
275 | <xsl:value-of select="$admon.graphics.extension" /> |
---|
276 | </xsl:template> |
---|
277 | |
---|
278 | <xsl:template match="classname"> |
---|
279 | <xsl:call-template name="inline.monoseq"/> |
---|
280 | <xsl:if test = "@docapi != ''"> |
---|
281 | <xsl:variable name="packagePath"> |
---|
282 | <xsl:call-template name="replaceCharsInString"> |
---|
283 | <xsl:with-param name="stringIn" select="string(@docapi)"/> |
---|
284 | <xsl:with-param name="charsIn" select="'.'" /> |
---|
285 | <xsl:with-param name="charsOut" select="'/'" /> |
---|
286 | </xsl:call-template> |
---|
287 | </xsl:variable> |
---|
288 | |
---|
289 | <xsl:variable name="cleanClassName"> |
---|
290 | <xsl:choose> |
---|
291 | <xsl:when test="starts-with(., @docapi)"> |
---|
292 | <xsl:value-of select="substring-after(., concat(@docapi, '.'))" /> |
---|
293 | </xsl:when> |
---|
294 | <xsl:otherwise> |
---|
295 | <xsl:value-of select="." /> |
---|
296 | </xsl:otherwise> |
---|
297 | </xsl:choose> |
---|
298 | </xsl:variable> |
---|
299 | |
---|
300 | <xsl:variable name="pathtorootdir"> |
---|
301 | <xsl:call-template name="pathtorootdir" /> |
---|
302 | </xsl:variable> |
---|
303 | |
---|
304 | <a> |
---|
305 | <xsl:attribute name="href"> |
---|
306 | <xsl:value-of select="concat($pathtorootdir, $javadoc.root.path, $packagePath, '/', $cleanClassName, '.html')" /> |
---|
307 | </xsl:attribute> |
---|
308 | <xsl:attribute name="title">Javadoc for this class.</xsl:attribute> |
---|
309 | <image> |
---|
310 | <xsl:attribute name="src"> |
---|
311 | <xsl:value-of select="concat($pathtorootdir, $admon.graphics.path, 'docapi.gif')"/> |
---|
312 | </xsl:attribute> |
---|
313 | <xsl:attribute name="style">padding-left: 4px;</xsl:attribute> |
---|
314 | <xsl:attribute name="border">0</xsl:attribute> |
---|
315 | </image> |
---|
316 | </a> |
---|
317 | </xsl:if> |
---|
318 | </xsl:template> |
---|
319 | |
---|
320 | <xsl:template match="interfacename"> |
---|
321 | <xsl:call-template name="inline.monoseq"/> |
---|
322 | <xsl:if test = "@docapi != ''"> |
---|
323 | <xsl:variable name="packagePath"> |
---|
324 | <xsl:call-template name="replaceCharsInString"> |
---|
325 | <xsl:with-param name="stringIn" select="string(@docapi)"/> |
---|
326 | <xsl:with-param name="charsIn" select="'.'" /> |
---|
327 | <xsl:with-param name="charsOut" select="'/'" /> |
---|
328 | </xsl:call-template> |
---|
329 | </xsl:variable> |
---|
330 | |
---|
331 | <xsl:variable name="cleanClassName"> |
---|
332 | <xsl:choose> |
---|
333 | <xsl:when test="starts-with(., @docapi)"> |
---|
334 | <xsl:value-of select="substring-after(., concat(@docapi, '.'))" /> |
---|
335 | </xsl:when> |
---|
336 | <xsl:otherwise> |
---|
337 | <xsl:value-of select="." /> |
---|
338 | </xsl:otherwise> |
---|
339 | </xsl:choose> |
---|
340 | </xsl:variable> |
---|
341 | |
---|
342 | <xsl:variable name="pathtorootdir"> |
---|
343 | <xsl:call-template name="pathtorootdir" /> |
---|
344 | </xsl:variable> |
---|
345 | <a> |
---|
346 | <xsl:attribute name="href"> |
---|
347 | <xsl:value-of select="concat($pathtorootdir, $javadoc.root.path, $packagePath, '/', $cleanClassName, '.html')" /> |
---|
348 | </xsl:attribute> |
---|
349 | <xsl:attribute name="title">Javadoc for this interface.</xsl:attribute> |
---|
350 | |
---|
351 | <image> |
---|
352 | <xsl:attribute name="src"> |
---|
353 | <xsl:value-of select="concat($pathtorootdir, $admon.graphics.path, 'docapi.gif')"/> |
---|
354 | </xsl:attribute> |
---|
355 | <xsl:attribute name="border">0</xsl:attribute> |
---|
356 | <xsl:attribute name="style">padding-left: 4px;</xsl:attribute> |
---|
357 | </image> |
---|
358 | </a> |
---|
359 | </xsl:if> |
---|
360 | </xsl:template> |
---|
361 | |
---|
362 | <xsl:template name="replaceCharsInString"> |
---|
363 | <xsl:param name="stringIn"/> |
---|
364 | <xsl:param name="charsIn"/> |
---|
365 | <xsl:param name="charsOut"/> |
---|
366 | <xsl:choose> |
---|
367 | <xsl:when test="contains($stringIn,$charsIn)"> |
---|
368 | <xsl:value-of select="concat(substring-before($stringIn,$charsIn),$charsOut)"/> |
---|
369 | <xsl:call-template name="replaceCharsInString"> |
---|
370 | <xsl:with-param name="stringIn" select="substring-after($stringIn,$charsIn)"/> |
---|
371 | <xsl:with-param name="charsIn" select="$charsIn"/> |
---|
372 | <xsl:with-param name="charsOut" select="$charsOut"/> |
---|
373 | </xsl:call-template> |
---|
374 | </xsl:when> |
---|
375 | <xsl:otherwise> |
---|
376 | <xsl:value-of select="$stringIn"/> |
---|
377 | </xsl:otherwise> |
---|
378 | </xsl:choose> |
---|
379 | </xsl:template> |
---|
380 | |
---|
381 | <xsl:template match="baseversion"> |
---|
382 | <xsl:value-of select="$base.version"/> |
---|
383 | </xsl:template> |
---|
384 | |
---|
385 | </xsl:stylesheet> |
---|
386 | |
---|
387 | |
---|