added Info.plist
[TestXSLT.git] / libxml2 / doc / api.xsl
1 <?xml version="1.0"?>
2 <xsl:stylesheet version="1.0"
3   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
4   xmlns:exsl="http://exslt.org/common"
5   extension-element-prefixes="exsl"
6   exclude-result-prefixes="exsl">
7
8   <!-- Import the resto of the site stylesheets -->
9   <xsl:import href="site.xsl"/>
10
11   <xsl:variable name="apirefs" select="document('libxml2-refs.xml')"/>
12   <xsl:variable name="module" select="$apirefs/apirefs/@name"/>
13   <xsl:key name="refhref" match="reference" use="@name"/>
14
15   <xsl:template match="ref" mode="anchor">
16     <xsl:variable name="name" select="@name"/>
17     <xsl:for-each select="document('libxml2-refs.xml')">
18         <a href="{key('refhref', $name)/@href}"><xsl:value-of select="$name"/></a>
19     </xsl:for-each>
20   </xsl:template>
21   <xsl:template match="type" mode="reflist">
22     <h2>Type <xsl:value-of select="@name"/>:</h2>
23     <p>
24       <xsl:for-each select="ref">
25         <xsl:apply-templates mode="anchor" select="."/>
26         <xsl:text>
27 </xsl:text>
28       </xsl:for-each>
29     </p>
30   </xsl:template>
31   <xsl:template match="letter" mode="reflist">
32     <h2>Letter <xsl:value-of select="@name"/>:</h2>
33     <p>
34       <xsl:for-each select="ref">
35         <xsl:apply-templates mode="anchor" select="."/>
36         <xsl:text>
37 </xsl:text>
38       </xsl:for-each>
39     </p>
40   </xsl:template>
41   <xsl:template match="file" mode="reflist">
42     <h2><a name="{@name}">Module <xsl:value-of select="@name"/></a>:</h2>
43     <p>
44       <xsl:for-each select="ref">
45         <xsl:apply-templates mode="anchor" select="."/>
46         <xsl:text>
47 </xsl:text>
48       </xsl:for-each>
49     </p>
50   </xsl:template>
51   <xsl:template match="letter" mode="wordlist">
52     <h2>Letter <xsl:value-of select="@name"/>:</h2>
53     <dl>
54       <xsl:for-each select="word">
55         <dt><xsl:value-of select="@name"/></dt>
56         <dd>
57         <xsl:for-each select="ref">
58           <xsl:apply-templates mode="anchor" select="."/>
59           <xsl:text>
60 </xsl:text>
61         </xsl:for-each>
62         </dd>
63       </xsl:for-each>
64     </dl>
65   </xsl:template>
66
67   <xsl:template match="constructors">
68     <xsl:message>Generating API Constructors</xsl:message>
69     <xsl:variable name="title">List of constructors for <xsl:value-of select="$module"/></xsl:variable>
70     <xsl:document href="APIconstructors.html" method="html" version="4.01" encoding="ISO-8859-1">
71       <html>
72         <head>
73         <xsl:call-template name="style"/>
74         <xsl:element name="title">
75           <xsl:value-of select="$title"/>
76         </xsl:element>
77         </head>
78         <body bgcolor="#8b7765" text="#000000" link="#000000" vlink="#000000">
79           <xsl:call-template name="titlebox">
80             <xsl:with-param name="title" select="$title"/>
81           </xsl:call-template>
82           <table border="0" cellpadding="4" cellspacing="0" width="100%" align="center">
83             <tr>
84               <td bgcolor="#8b7765">
85                 <table border="0" cellspacing="0" cellpadding="2" width="100%">
86                   <tr>
87                     <td valign="top" width="200" bgcolor="#8b7765">
88                       <xsl:call-template name="toc"/>
89                     </td>
90                     <td valign="top" bgcolor="#8b7765">
91                       <table border="0" cellspacing="0" cellpadding="1" width="100%">
92                         <tr>
93                           <td>
94                             <table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000">
95                               <tr>
96                                 <td>
97                                   <table border="0" cellpadding="3" cellspacing="1" width="100%">
98                                     <tr>
99                                       <td bgcolor="#fffacd">
100                                         <xsl:apply-templates mode="reflist" select="type"/>
101                                         <p><a href="bugs.html">Daniel Veillard</a></p>
102                                       </td>
103                                     </tr>
104                                   </table>
105                                 </td>
106                               </tr>
107                             </table>
108                           </td>
109                         </tr>
110                       </table>
111                     </td>
112                   </tr>
113                 </table>
114               </td>
115             </tr>
116           </table>
117         </body>
118       </html>
119     </xsl:document>
120   </xsl:template>
121   <xsl:template match="files">
122     <xsl:message>Generating API List of synbols per file</xsl:message>
123     <xsl:variable name="title">List of Symbols per Module for <xsl:value-of select="$module"/></xsl:variable>
124     <xsl:document href="APIfiles.html" method="html" version="4.01" encoding="ISO-8859-1">
125       <html>
126         <head>
127         <xsl:call-template name="style"/>
128         <xsl:element name="title">
129           <xsl:value-of select="$title"/>
130         </xsl:element>
131         </head>
132         <body bgcolor="#8b7765" text="#000000" link="#000000" vlink="#000000">
133           <xsl:call-template name="titlebox">
134             <xsl:with-param name="title" select="$title"/>
135           </xsl:call-template>
136           <table border="0" cellpadding="4" cellspacing="0" width="100%" align="center">
137             <tr>
138               <td bgcolor="#8b7765">
139                 <table border="0" cellspacing="0" cellpadding="2" width="100%">
140                   <tr>
141                     <td valign="top" width="200" bgcolor="#8b7765">
142                       <xsl:call-template name="toc"/>
143                     </td>
144                     <td valign="top" bgcolor="#8b7765">
145                       <table border="0" cellspacing="0" cellpadding="1" width="100%">
146                         <tr>
147                           <td>
148                             <table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000">
149                               <tr>
150                                 <td>
151                                   <table border="0" cellpadding="3" cellspacing="1" width="100%">
152                                     <tr>
153                                       <td bgcolor="#fffacd">
154                                         <xsl:apply-templates mode="reflist" select="file"/>
155                                         <p><a href="bugs.html">Daniel Veillard</a></p>
156                                       </td>
157                                     </tr>
158                                   </table>
159                                 </td>
160                               </tr>
161                             </table>
162                           </td>
163                         </tr>
164                       </table>
165                     </td>
166                   </tr>
167                 </table>
168               </td>
169             </tr>
170           </table>
171         </body>
172       </html>
173     </xsl:document>
174   </xsl:template>
175   <xsl:template match="functions">
176     <xsl:message>Generating API Functions by Type</xsl:message>
177     <xsl:variable name="title">List of function manipulating types in <xsl:value-of select="$module"/></xsl:variable>
178     <xsl:document href="APIfunctions.html" method="html" version="4.01" encoding="ISO-8859-1">
179       <html>
180         <head>
181         <xsl:call-template name="style"/>
182         <xsl:element name="title">
183           <xsl:value-of select="$title"/>
184         </xsl:element>
185         </head>
186         <body bgcolor="#8b7765" text="#000000" link="#000000" vlink="#000000">
187           <xsl:call-template name="titlebox">
188             <xsl:with-param name="title" select="$title"/>
189           </xsl:call-template>
190           <table border="0" cellpadding="4" cellspacing="0" width="100%" align="center">
191             <tr>
192               <td bgcolor="#8b7765">
193                 <table border="0" cellspacing="0" cellpadding="2" width="100%">
194                   <tr>
195                     <td valign="top" width="200" bgcolor="#8b7765">
196                       <xsl:call-template name="toc"/>
197                     </td>
198                     <td valign="top" bgcolor="#8b7765">
199                       <table border="0" cellspacing="0" cellpadding="1" width="100%">
200                         <tr>
201                           <td>
202                             <table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000">
203                               <tr>
204                                 <td>
205                                   <table border="0" cellpadding="3" cellspacing="1" width="100%">
206                                     <tr>
207                                       <td bgcolor="#fffacd">
208                                         <xsl:apply-templates mode="reflist" select="type"/>
209                                         <p><a href="bugs.html">Daniel Veillard</a></p>
210                                       </td>
211                                     </tr>
212                                   </table>
213                                 </td>
214                               </tr>
215                             </table>
216                           </td>
217                         </tr>
218                       </table>
219                     </td>
220                   </tr>
221                 </table>
222               </td>
223             </tr>
224           </table>
225         </body>
226       </html>
227     </xsl:document>
228   </xsl:template>
229   <xsl:template match="alpha">
230     <xsl:message>Generating API Alphabetic list</xsl:message>
231     <xsl:variable name="title">Alphabetic List of Symbols in <xsl:value-of select="$module"/></xsl:variable>
232     <xsl:document href="APIsymbols.html" method="html" version="4.01" encoding="ISO-8859-1">
233       <html>
234         <head>
235         <xsl:call-template name="style"/>
236         <xsl:element name="title">
237           <xsl:value-of select="$title"/>
238         </xsl:element>
239         </head>
240         <body bgcolor="#8b7765" text="#000000" link="#000000" vlink="#000000">
241           <xsl:call-template name="titlebox">
242             <xsl:with-param name="title" select="$title"/>
243           </xsl:call-template>
244           <table border="0" cellpadding="4" cellspacing="0" width="100%" align="center">
245             <tr>
246               <td bgcolor="#8b7765">
247                 <table border="0" cellspacing="0" cellpadding="2" width="100%">
248                   <tr>
249                     <td valign="top" width="200" bgcolor="#8b7765">
250                       <xsl:call-template name="toc"/>
251                     </td>
252                     <td valign="top" bgcolor="#8b7765">
253                       <table border="0" cellspacing="0" cellpadding="1" width="100%">
254                         <tr>
255                           <td>
256                             <table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000">
257                               <tr>
258                                 <td>
259                                   <table border="0" cellpadding="3" cellspacing="1" width="100%">
260                                     <tr>
261                                       <td bgcolor="#fffacd">
262                                         <xsl:apply-templates mode="reflist" select="letter"/>
263                                         <p><a href="bugs.html">Daniel Veillard</a></p>
264                                       </td>
265                                     </tr>
266                                   </table>
267                                 </td>
268                               </tr>
269                             </table>
270                           </td>
271                         </tr>
272                       </table>
273                     </td>
274                   </tr>
275                 </table>
276               </td>
277             </tr>
278           </table>
279         </body>
280       </html>
281     </xsl:document>
282   </xsl:template>
283   <xsl:template name="apichunks">
284     <h2 align="center">
285     <xsl:for-each select="/apirefs/index/chunks/chunk">
286       <xsl:variable name="name" select="@name"/>
287       <xsl:variable name="start" select="@start"/>
288       <xsl:variable name="end" select="@end"/>
289       <xsl:variable name="block" select="concat($start, '-', $end)"/>
290       <a href="API{$name}.html"><xsl:value-of select="$block"/></a>
291       <xsl:text>
292 </xsl:text>
293     </xsl:for-each>
294     </h2>
295   </xsl:template>
296   <xsl:template match="chunk">
297     <xsl:variable name="name" select="@name"/>
298     <xsl:variable name="start" select="@start"/>
299     <xsl:variable name="end" select="@end"/>
300     <xsl:variable name="block" select="concat($start, '-', $end)"/>
301     <xsl:variable name="target" select="/apirefs/index/chunk[@name = $name]"/>
302     <xsl:variable name="title">API Alphabetic Index <xsl:value-of select="$block"/> for <xsl:value-of select="$module"/></xsl:variable>
303     <xsl:document href="API{$name}.html" method="html" version="4.01" encoding="ISO-8859-1">
304       <html>
305         <head>
306         <xsl:call-template name="style"/>
307         <xsl:element name="title">
308           <xsl:value-of select="$title"/>
309         </xsl:element>
310         </head>
311         <body bgcolor="#8b7765" text="#000000" link="#000000" vlink="#000000">
312           <xsl:call-template name="titlebox">
313             <xsl:with-param name="title" select="$title"/>
314           </xsl:call-template>
315           <table border="0" cellpadding="4" cellspacing="0" width="100%" align="center">
316             <tr>
317               <td bgcolor="#8b7765">
318                 <table border="0" cellspacing="0" cellpadding="2" width="100%">
319                   <tr>
320                     <td valign="top" width="200" bgcolor="#8b7765">
321                       <xsl:call-template name="toc"/>
322                     </td>
323                     <td valign="top" bgcolor="#8b7765">
324                       <table border="0" cellspacing="0" cellpadding="1" width="100%">
325                         <tr>
326                           <td>
327                             <table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000">
328                               <tr>
329                                 <td>
330                                   <table border="0" cellpadding="3" cellspacing="1" width="100%">
331                                     <tr>
332                                       <td bgcolor="#fffacd">
333                                         <xsl:call-template name="apichunks"/>
334                                         <xsl:apply-templates mode="wordlist"
335                                                    select="$target/letter"/>
336                                         <xsl:call-template name="apichunks"/>
337                                         <p><a href="bugs.html">Daniel Veillard</a></p>
338                                       </td>
339                                     </tr>
340                                   </table>
341                                 </td>
342                               </tr>
343                             </table>
344                           </td>
345                         </tr>
346                       </table>
347                     </td>
348                   </tr>
349                 </table>
350               </td>
351             </tr>
352           </table>
353         </body>
354       </html>
355     </xsl:document>
356   </xsl:template>
357
358   <xsl:template match="index">
359     <xsl:message>Generating API Index</xsl:message>
360     <xsl:apply-templates select="chunks/chunk"/>
361   </xsl:template>
362
363   <xsl:template match="apirefs">
364     <xsl:message>Generating API Cross References</xsl:message>
365     <xsl:apply-templates select="constructors"/>
366     <xsl:apply-templates select="functions"/>
367     <xsl:apply-templates select="alpha"/>
368     <xsl:apply-templates select="files"/>
369     <xsl:apply-templates select="index"/>
370   </xsl:template>
371
372   <xsl:template match="/">
373     <xsl:apply-templates select="$apirefs/apirefs"/>
374   </xsl:template>
375
376 </xsl:stylesheet>