2009-06-11 Mark Doffman <mark.doffman@codethink.co.uk>
[platform/core/uifw/at-spi2-atk.git] / tools / doc-generator.xsl
1 <!-- Generate HTML documentation from the Telepathy specification.
2 The master copy of this stylesheet is in the Telepathy spec repository -
3 please make any changes there.
4
5 Copyright (C) 2006, 2007 Collabora Limited
6
7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Lesser General Public
9 License as published by the Free Software Foundation; either
10 version 2.1 of the License, or (at your option) any later version.
11
12 This library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15 Lesser General Public License for more details.
16
17 You should have received a copy of the GNU Lesser General Public
18 License along with this library; if not, write to the Free Software
19 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
20 -->
21
22 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
23   xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0"
24   exclude-result-prefixes="tp">
25   <!--Don't move the declaration of the HTML namespace up here - XMLNSs
26   don't work ideally in the presence of two things that want to use the
27   absence of a prefix, sadly. -->
28
29   <xsl:template match="*" mode="identity">
30     <xsl:copy>
31       <xsl:apply-templates mode="identity"/>
32     </xsl:copy>
33   </xsl:template>
34
35   <xsl:template match="tp:docstring">
36     <xsl:apply-templates select="node()" mode="identity"/>
37   </xsl:template>
38
39   <xsl:template match="tp:errors">
40     <h1 xmlns="http://www.w3.org/1999/xhtml">Errors</h1>
41     <xsl:apply-templates/>
42   </xsl:template>
43
44   <xsl:template match="tp:generic-types">
45     <h1 xmlns="http://www.w3.org/1999/xhtml">Generic types</h1>
46     <xsl:call-template name="do-types"/>
47   </xsl:template>
48
49   <xsl:template name="do-types">
50     <xsl:if test="tp:simple-type">
51       <h2 xmlns="http://www.w3.org/1999/xhtml">Simple types</h2>
52       <xsl:apply-templates select="tp:simple-type"/>
53     </xsl:if>
54
55     <xsl:if test="tp:enum">
56       <h2 xmlns="http://www.w3.org/1999/xhtml">Enumerated types:</h2>
57       <xsl:apply-templates select="tp:enum"/>
58     </xsl:if>
59
60     <xsl:if test="tp:flags">
61       <h2 xmlns="http://www.w3.org/1999/xhtml">Sets of flags:</h2>
62       <xsl:apply-templates select="tp:flags"/>
63     </xsl:if>
64
65     <xsl:if test="tp:struct">
66       <h2 xmlns="http://www.w3.org/1999/xhtml">Structure types</h2>
67       <xsl:apply-templates select="tp:struct"/>
68     </xsl:if>
69
70     <xsl:if test="tp:mapping">
71       <h2 xmlns="http://www.w3.org/1999/xhtml">Mapping types</h2>
72       <xsl:apply-templates select="tp:mapping"/>
73     </xsl:if>
74
75     <xsl:if test="tp:external-type">
76       <h2 xmlns="http://www.w3.org/1999/xhtml">Types defined elsewhere</h2>
77       <dl><xsl:apply-templates select="tp:external-type"/></dl>
78     </xsl:if>
79   </xsl:template>
80
81   <xsl:template match="tp:error">
82     <h2 xmlns="http://www.w3.org/1999/xhtml"><a name="{concat(../@namespace, '.', translate(@name, ' ', ''))}"></a><xsl:value-of select="concat(../@namespace, '.', translate(@name, ' ', ''))"/></h2>
83     <xsl:apply-templates select="tp:docstring"/>
84   </xsl:template>
85
86   <xsl:template match="/tp:spec/tp:copyright">
87     <div xmlns="http://www.w3.org/1999/xhtml">
88       <xsl:apply-templates/>
89     </div>
90   </xsl:template>
91   <xsl:template match="/tp:spec/tp:license">
92     <div xmlns="http://www.w3.org/1999/xhtml" class="license">
93       <xsl:apply-templates mode="identity"/>
94     </div>
95   </xsl:template>
96
97   <xsl:template match="tp:copyright"/>
98   <xsl:template match="tp:license"/>
99
100   <xsl:template match="interface">
101     <h1 xmlns="http://www.w3.org/1999/xhtml"><a name="{@name}"></a><xsl:value-of select="@name"/></h1>
102
103     <xsl:if test="@tp:causes-havoc">
104       <p xmlns="http://www.w3.org/1999/xhtml" class="causes-havoc">
105         This interface is <xsl:value-of select="@tp:causes-havoc"/>
106         and is likely to cause havoc to your API/ABI if bindings are generated.
107         Don't include it in libraries that care about compatibility.
108       </p>
109     </xsl:if>
110
111     <xsl:if test="tp:requires">
112       <p>Implementations of this interface must also implement:</p>
113       <ul xmlns="http://www.w3.org/1999/xhtml">
114         <xsl:for-each select="tp:requires">
115           <li><code><a href="#{@interface}"><xsl:value-of select="@interface"/></a></code></li>
116         </xsl:for-each>
117       </ul>
118     </xsl:if>
119
120     <xsl:apply-templates select="tp:docstring" />
121
122     <xsl:choose>
123       <xsl:when test="method">
124         <h2 xmlns="http://www.w3.org/1999/xhtml">Methods:</h2>
125         <xsl:apply-templates select="method"/>
126       </xsl:when>
127       <xsl:otherwise>
128         <p xmlns="http://www.w3.org/1999/xhtml">Interface has no methods.</p>
129       </xsl:otherwise>
130     </xsl:choose>
131
132     <xsl:choose>
133       <xsl:when test="signal">
134         <h2 xmlns="http://www.w3.org/1999/xhtml">Signals:</h2>
135         <xsl:apply-templates select="signal"/>
136       </xsl:when>
137       <xsl:otherwise>
138         <p xmlns="http://www.w3.org/1999/xhtml">Interface has no signals.</p>
139       </xsl:otherwise>
140     </xsl:choose>
141
142     <xsl:choose>
143       <xsl:when test="tp:property">
144         <h2 xmlns="http://www.w3.org/1999/xhtml">Properties:</h2>
145         <dl xmlns="http://www.w3.org/1999/xhtml">
146           <xsl:apply-templates select="tp:property"/>
147         </dl>
148       </xsl:when>
149       <xsl:otherwise>
150         <p xmlns="http://www.w3.org/1999/xhtml">Interface has no properties.</p>
151       </xsl:otherwise>
152     </xsl:choose>
153
154     <xsl:call-template name="do-types"/>
155
156   </xsl:template>
157
158   <xsl:template match="tp:flags">
159     <h3>
160       <a name="type-{@name}">
161         <xsl:value-of select="@name"/>
162       </a>
163     </h3>
164     <xsl:apply-templates select="tp:docstring" />
165     <dl xmlns="http://www.w3.org/1999/xhtml">
166         <xsl:variable name="value-prefix">
167           <xsl:choose>
168             <xsl:when test="@value-prefix">
169               <xsl:value-of select="@value-prefix"/>
170             </xsl:when>
171             <xsl:otherwise>
172               <xsl:value-of select="@name"/>
173             </xsl:otherwise>
174           </xsl:choose>
175         </xsl:variable>
176       <xsl:for-each select="tp:flag">
177         <dt xmlns="http://www.w3.org/1999/xhtml"><code><xsl:value-of select="concat($value-prefix, '_', @suffix)"/> = <xsl:value-of select="@value"/></code></dt>
178         <xsl:choose>
179           <xsl:when test="tp:docstring">
180             <dd xmlns="http://www.w3.org/1999/xhtml"><xsl:apply-templates select="tp:docstring" /></dd>
181           </xsl:when>
182           <xsl:otherwise>
183             <dd xmlns="http://www.w3.org/1999/xhtml">(Undocumented)</dd>
184           </xsl:otherwise>
185         </xsl:choose>
186       </xsl:for-each>
187     </dl>
188   </xsl:template>
189
190   <xsl:template match="tp:enum">
191     <h3 xmlns="http://www.w3.org/1999/xhtml">
192       <a name="type-{@name}">
193         <xsl:value-of select="@name"/>
194       </a>
195     </h3>
196     <xsl:apply-templates select="tp:docstring" />
197     <dl xmlns="http://www.w3.org/1999/xhtml">
198         <xsl:variable name="value-prefix">
199           <xsl:choose>
200             <xsl:when test="@value-prefix">
201               <xsl:value-of select="@value-prefix"/>
202             </xsl:when>
203             <xsl:otherwise>
204               <xsl:value-of select="@name"/>
205             </xsl:otherwise>
206           </xsl:choose>
207         </xsl:variable>
208       <xsl:for-each select="tp:enumvalue">
209         <dt xmlns="http://www.w3.org/1999/xhtml"><code><xsl:value-of select="concat($value-prefix, '_', @suffix)"/> = <xsl:value-of select="@value"/></code></dt>
210         <xsl:choose>
211           <xsl:when test="tp:docstring">
212             <dd xmlns="http://www.w3.org/1999/xhtml"><xsl:apply-templates select="tp:docstring" /></dd>
213           </xsl:when>
214           <xsl:otherwise>
215             <dd xmlns="http://www.w3.org/1999/xhtml">(Undocumented)</dd>
216           </xsl:otherwise>
217         </xsl:choose>
218       </xsl:for-each>
219     </dl>
220   </xsl:template>
221
222   <xsl:template match="tp:property">
223     <dt xmlns="http://www.w3.org/1999/xhtml">
224       <xsl:if test="@name">
225         <code><xsl:value-of select="@name"/></code> -
226       </xsl:if>
227       <code><xsl:value-of select="@type"/></code>
228     </dt>
229     <dd xmlns="http://www.w3.org/1999/xhtml">
230       <xsl:apply-templates select="tp:docstring"/>
231     </dd>
232   </xsl:template>
233
234   <xsl:template match="tp:mapping">
235     <div xmlns="http://www.w3.org/1999/xhtml" class="struct">
236       <h3>
237         <a name="type-{@name}">
238           <xsl:value-of select="@name"/>
239         </a> - a{
240         <xsl:for-each select="tp:member">
241           <xsl:value-of select="@type"/>
242           <xsl:text>: </xsl:text>
243           <xsl:value-of select="@name"/>
244           <xsl:if test="position() != last()"> &#x2192; </xsl:if>
245         </xsl:for-each>
246         }
247       </h3>
248       <div class="docstring">
249         <xsl:apply-templates select="tp:docstring"/>
250       </div>
251       <div>
252         <h4>Members</h4>
253         <dl>
254           <xsl:apply-templates select="tp:member" mode="members-in-docstring"/>
255         </dl>
256       </div>
257     </div>
258   </xsl:template>
259
260   <xsl:template match="tp:docstring" mode="in-index"/>
261
262   <xsl:template match="tp:simple-type | tp:enum | tp:flags | tp:external-type"
263     mode="in-index">
264     - <xsl:value-of select="@type"/>
265   </xsl:template>
266
267   <xsl:template match="tp:simple-type">
268     <div xmlns="http://www.w3.org/1999/xhtml" class="simple-type">
269       <h3>
270         <a name="type-{@name}">
271           <xsl:value-of select="@name"/>
272         </a> - <xsl:value-of select="@type"/>
273       </h3>
274       <div class="docstring">
275         <xsl:apply-templates select="tp:docstring"/>
276       </div>
277     </div>
278   </xsl:template>
279
280   <xsl:template match="tp:external-type">
281     <div xmlns="http://www.w3.org/1999/xhtml" class="external-type">
282       <dt>
283         <a name="type-{@name}">
284           <xsl:value-of select="@name"/>
285         </a> - <xsl:value-of select="@type"/>
286       </dt>
287       <dd>Defined by: <xsl:value-of select="@from"/></dd>
288     </div>
289   </xsl:template>
290
291   <xsl:template match="tp:struct" mode="in-index">
292     - ( <xsl:for-each select="tp:member">
293           <xsl:value-of select="@type"/>
294           <xsl:if test="position() != last()">, </xsl:if>
295         </xsl:for-each> )
296   </xsl:template>
297
298   <xsl:template match="tp:mapping" mode="in-index">
299     - a{ <xsl:for-each select="tp:member">
300           <xsl:value-of select="@type"/>
301           <xsl:if test="position() != last()"> &#x2192; </xsl:if>
302         </xsl:for-each> }
303   </xsl:template>
304
305   <xsl:template match="tp:struct">
306     <div xmlns="http://www.w3.org/1999/xhtml" class="struct">
307       <h3>
308         <a name="type-{@name}">
309           <xsl:value-of select="@name"/>
310         </a> - (
311         <xsl:for-each select="tp:member">
312           <xsl:value-of select="@type"/>
313           <xsl:text>: </xsl:text>
314           <xsl:value-of select="@name"/>
315           <xsl:if test="position() != last()">, </xsl:if>
316         </xsl:for-each>
317         )
318       </h3>
319       <div class="docstring">
320         <xsl:apply-templates select="tp:docstring"/>
321       </div>
322       <xsl:choose>
323         <xsl:when test="string(@array-name) != ''">
324           <p>In bindings that need a separate name, arrays of
325             <xsl:value-of select="@name"/> should be called
326             <xsl:value-of select="@array-name"/>.</p>
327         </xsl:when>
328         <xsl:otherwise>
329           <p>Arrays of <xsl:value-of select="@name"/> don't generally
330             make sense.</p>
331         </xsl:otherwise>
332       </xsl:choose>
333       <div>
334         <h4>Members</h4>
335         <dl>
336           <xsl:apply-templates select="tp:member" mode="members-in-docstring"/>
337         </dl>
338       </div>
339     </div>
340   </xsl:template>
341
342   <xsl:template match="method">
343     <div xmlns="http://www.w3.org/1999/xhtml" class="method">
344       <h3 xmlns="http://www.w3.org/1999/xhtml">
345         <a name="{concat(../@name, concat('.', @name))}">
346           <xsl:value-of select="@name"/>
347         </a> (
348         <xsl:for-each xmlns="" select="arg[@direction='in']">
349           <xsl:value-of select="@type"/>: <xsl:value-of select="@name"/>
350           <xsl:if test="position() != last()">, </xsl:if>
351         </xsl:for-each>
352         ) &#x2192;
353         <xsl:choose>
354           <xsl:when test="arg[@direction='out']">
355             <xsl:for-each xmlns="" select="arg[@direction='out']">
356               <xsl:value-of select="@type"/>
357               <xsl:if test="position() != last()">, </xsl:if>
358             </xsl:for-each>
359           </xsl:when>
360           <xsl:otherwise>nothing</xsl:otherwise>
361         </xsl:choose>
362       </h3>
363       <div xmlns="http://www.w3.org/1999/xhtml" class="docstring">
364         <xsl:apply-templates select="tp:docstring" />
365       </div>
366
367       <xsl:if test="arg[@direction='in']">
368         <div xmlns="http://www.w3.org/1999/xhtml">
369           <h4>Parameters</h4>
370           <dl xmlns="http://www.w3.org/1999/xhtml">
371             <xsl:apply-templates select="arg[@direction='in']"
372               mode="parameters-in-docstring"/>
373           </dl>
374         </div>
375       </xsl:if>
376
377       <xsl:if test="arg[@direction='out']">
378         <div xmlns="http://www.w3.org/1999/xhtml">
379           <h4>Returns</h4>
380           <dl xmlns="http://www.w3.org/1999/xhtml">
381             <xsl:apply-templates select="arg[@direction='out']"
382               mode="returns-in-docstring"/>
383           </dl>
384         </div>
385       </xsl:if>
386
387       <xsl:if test="tp:possible-errors">
388         <div xmlns="http://www.w3.org/1999/xhtml">
389           <h4>Possible errors</h4>
390           <dl xmlns="http://www.w3.org/1999/xhtml">
391             <xsl:apply-templates select="tp:possible-errors/tp:error"/>
392           </dl>
393         </div>
394       </xsl:if>
395
396     </div>
397   </xsl:template>
398
399   <xsl:template name="parenthesized-tp-type">
400     <xsl:if test="@tp:type">
401       <xsl:variable name="tp-type" select="@tp:type"/>
402       <xsl:variable name="single-type">
403         <xsl:choose>
404           <xsl:when test="contains($tp-type, '[]')">
405             <xsl:value-of select="substring-before($tp-type, '[]')"/>
406           </xsl:when>
407           <xsl:otherwise>
408             <xsl:value-of select="$tp-type"/>
409           </xsl:otherwise>
410         </xsl:choose>
411       </xsl:variable>
412       <xsl:choose>
413         <xsl:when test="//tp:simple-type[@name=$tp-type]" />
414         <xsl:when test="//tp:simple-type[concat(@name, '[]')=$tp-type]" />
415         <xsl:when test="//tp:struct[concat(@name, '[]')=$tp-type][string(@array-name) != '']" />
416         <xsl:when test="//tp:struct[@name=$tp-type]" />
417         <xsl:when test="//tp:enum[@name=$tp-type]" />
418         <xsl:when test="//tp:enum[concat(@name, '[]')=$tp-type]" />
419         <xsl:when test="//tp:flags[@name=$tp-type]" />
420         <xsl:when test="//tp:flags[concat(@name, '[]')=$tp-type]" />
421         <xsl:when test="//tp:mapping[@name=$tp-type]" />
422         <xsl:when test="//tp:external-type[concat(@name, '[]')=$tp-type]" />
423         <xsl:when test="//tp:external-type[@name=$tp-type]" />
424         <xsl:otherwise>
425           <xsl:message terminate="yes">
426             <xsl:text>ERR: Unable to find type '</xsl:text>
427             <xsl:value-of select="$tp-type"/>
428             <xsl:text>'&#10;</xsl:text>
429           </xsl:message>
430         </xsl:otherwise>
431       </xsl:choose>
432       (<a href="#type-{$single-type}"><xsl:value-of select="$tp-type"/></a>)
433     </xsl:if>
434   </xsl:template>
435
436   <xsl:template match="tp:member" mode="members-in-docstring">
437     <dt xmlns="http://www.w3.org/1999/xhtml">
438       <code><xsl:value-of select="@name"/></code> -
439       <code><xsl:value-of select="@type"/></code>
440       <xsl:call-template name="parenthesized-tp-type"/>
441     </dt>
442     <dd xmlns="http://www.w3.org/1999/xhtml">
443       <xsl:choose>
444         <xsl:when test="tp:docstring">
445           <xsl:apply-templates select="tp:docstring" />
446         </xsl:when>
447         <xsl:otherwise>
448           <em>(undocumented)</em>
449         </xsl:otherwise>
450       </xsl:choose>
451     </dd>
452   </xsl:template>
453
454   <xsl:template match="arg" mode="parameters-in-docstring">
455     <dt xmlns="http://www.w3.org/1999/xhtml">
456       <code><xsl:value-of select="@name"/></code> -
457       <code><xsl:value-of select="@type"/></code>
458       <xsl:call-template name="parenthesized-tp-type"/>
459     </dt>
460     <dd xmlns="http://www.w3.org/1999/xhtml">
461       <xsl:apply-templates select="tp:docstring" />
462     </dd>
463   </xsl:template>
464
465   <xsl:template match="arg" mode="returns-in-docstring">
466     <dt xmlns="http://www.w3.org/1999/xhtml">
467       <xsl:if test="@name">
468         <code><xsl:value-of select="@name"/></code> -
469       </xsl:if>
470       <code><xsl:value-of select="@type"/></code>
471       <xsl:call-template name="parenthesized-tp-type"/>
472     </dt>
473     <dd xmlns="http://www.w3.org/1999/xhtml">
474       <xsl:apply-templates select="tp:docstring"/>
475     </dd>
476   </xsl:template>
477
478   <xsl:template match="tp:possible-errors/tp:error">
479     <dt xmlns="http://www.w3.org/1999/xhtml">
480       <code><xsl:value-of select="@name"/></code>
481     </dt>
482     <dd xmlns="http://www.w3.org/1999/xhtml">
483         <xsl:variable name="name" select="@name"/>
484         <xsl:choose>
485           <xsl:when test="tp:docstring">
486             <xsl:apply-templates select="tp:docstring"/>
487           </xsl:when>
488           <xsl:when test="//tp:errors/tp:error[concat(../@namespace, '.', translate(@name, ' ', ''))=$name]/tp:docstring">
489             <xsl:apply-templates select="//tp:errors/tp:error[concat(../@namespace, '.', translate(@name, ' ', ''))=$name]/tp:docstring"/> <em xmlns="http://www.w3.org/1999/xhtml">(generic description)</em>
490           </xsl:when>
491           <xsl:otherwise>
492             (Undocumented.)
493           </xsl:otherwise>
494         </xsl:choose>
495     </dd>
496   </xsl:template>
497
498   <xsl:template match="signal">
499     <div xmlns="http://www.w3.org/1999/xhtml" class="signal">
500       <h3 xmlns="http://www.w3.org/1999/xhtml">
501         <a name="{concat(../@name, concat('.', @name))}">
502           <xsl:value-of select="@name"/>
503         </a> (
504         <xsl:for-each xmlns="" select="arg">
505           <xsl:value-of select="@type"/>: <xsl:value-of select="@name"/>
506           <xsl:if test="position() != last()">, </xsl:if>
507         </xsl:for-each>
508         )</h3>
509       <div xmlns="http://www.w3.org/1999/xhtml" class="docstring">
510         <xsl:apply-templates select="tp:docstring"/>
511       </div>
512
513       <xsl:if test="arg">
514         <div xmlns="http://www.w3.org/1999/xhtml">
515           <h4>Parameters</h4>
516           <dl xmlns="http://www.w3.org/1999/xhtml">
517             <xsl:apply-templates select="arg" mode="parameters-in-docstring"/>
518           </dl>
519         </div>
520       </xsl:if>
521     </div>
522   </xsl:template>
523
524   <xsl:output method="xml" indent="no" encoding="ascii"
525     omit-xml-declaration="yes"
526     doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
527     doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" />
528
529   <xsl:template match="/tp:spec">
530     <html xmlns="http://www.w3.org/1999/xhtml">
531       <head>
532         <title>
533           <xsl:value-of select="tp:title"/>
534           <xsl:if test="tp:version">
535             <xsl:text> version </xsl:text>
536             <xsl:value-of select="tp:version"/>
537           </xsl:if>
538         </title>
539         <style type="text/css">
540
541           body {
542             font-family: sans-serif;
543             margin: 2em;
544             height: 100%;
545             font-size: 1.2em;
546           }
547           h1 {
548             padding-top: 5px;
549             padding-bottom: 5px;
550             font-size: 1.6em;
551             background: #dadae2;
552           }
553           h2 {
554             font-size: 1.3em;
555           }
556           h3 {
557             font-size: 1.2em;
558           }
559           a:link, a:visited, a:link:hover, a:visited:hover {
560             font-weight: bold;
561           }
562           .topbox {
563             padding-top: 10px;
564             padding-left: 10px;
565             border-bottom: black solid 1px;
566             padding-bottom: 10px;
567             background: #dadae2;
568             font-size: 2em;
569             font-weight: bold;
570             color: #5c5c5c;
571           }
572           .topnavbox {
573             padding-left: 10px;
574             padding-top: 5px;
575             padding-bottom: 5px;
576             background: #abacba;
577             border-bottom: black solid 1px;
578             font-size: 1.2em;
579           }
580           .topnavbox a{
581             color: black;
582             font-weight: normal;
583           }
584           .sidebar {
585             float: left;
586             /* width:9em;
587             border-right:#abacba solid 1px;
588             border-left: #abacba solid 1px;
589             height:100%; */
590             border: #abacba solid 1px;
591             padding-left: 10px;
592             margin-left: 10px;
593             padding-right: 10px;
594             margin-right: 10px;
595             color: #5d5d5d;
596             background: #dadae2;
597           }
598           .sidebar a {
599             text-decoration: none;
600             border-bottom: #e29625 dotted 1px;
601             color: #e29625;
602             font-weight: normal;
603           }
604           .sidebar h1 {
605             font-size: 1.2em;
606             color: black;
607           }
608           .sidebar ul {
609             padding-left: 25px;
610             padding-bottom: 10px;
611             border-bottom: #abacba solid 1px;
612           }
613           .sidebar li {
614             padding-top: 2px;
615             padding-bottom: 2px;
616           }
617           .sidebar h2 {
618             font-style:italic;
619             font-size: 0.81em;
620             padding-left: 5px;
621             padding-right: 5px;
622             font-weight: normal;
623           }
624           .date {
625             font-size: 0.6em;
626             float: right;
627             font-style: italic;
628           }
629           .method {
630             margin-left: 1em;
631             margin-right: 4em;
632           }
633           .signal {
634             margin-left: 1em;
635             margin-right: 4em;
636           }
637
638         </style>
639       </head>
640       <body>
641         <h1 class="topbox">
642           <xsl:value-of select="tp:title" />
643         </h1>
644         <xsl:if test="tp:version">
645           <h2>Version <xsl:apply-templates select="tp:version"/></h2>
646         </xsl:if>
647         <xsl:apply-templates select="tp:copyright"/>
648         <xsl:apply-templates select="tp:license"/>
649         <xsl:apply-templates select="tp:docstring"/>
650
651         <h2>Interfaces</h2>
652         <ul>
653         <xsl:for-each select="node/interface">
654             <li><code><a href="#{@name}"><xsl:value-of select="@name"/></a></code></li>
655           </xsl:for-each>
656         </ul>
657
658         <xsl:apply-templates select="node"/>
659         <xsl:apply-templates select="tp:generic-types"/>
660         <xsl:apply-templates select="tp:errors"/>
661
662         <h1>Index</h1>
663         <h2>Index of interfaces</h2>
664         <ul>
665         <xsl:for-each select="node/interface">
666             <li><code><a href="#{@name}"><xsl:value-of select="@name"/></a></code></li>
667           </xsl:for-each>
668         </ul>
669         <h2>Index of types</h2>
670         <ul>
671           <xsl:for-each select="//tp:simple-type | //tp:enum | //tp:flags | //tp:mapping | //tp:struct | //tp:external-type">
672             <xsl:sort select="@name"/>
673             <li>
674               <code>
675                 <a href="#type-{@name}">
676                   <xsl:value-of select="@name"/>
677                 </a>
678               </code>
679               <xsl:apply-templates mode="in-index" select="."/>
680             </li>
681           </xsl:for-each>
682         </ul>
683       </body>
684     </html>
685   </xsl:template>
686
687 </xsl:stylesheet>
688
689 <!-- vim:set sw=2 sts=2 et: -->