blob: 2748a7b79bbff548fe0104bbc856f0d3828fa2c4 [file] [log] [blame]
Daniel Veillardc72f9fd2003-11-16 23:59:52 +00001<?xml version="1.0"?>
2<!--
3 Stylesheet to generate the HTML documentation from an XML API descriptions:
4 xsltproc newapi.xsl libxml2-api.xml
5
6 Daniel Veillard
7-->
8<xsl:stylesheet version="1.0"
9 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
10 xmlns:exsl="http://exslt.org/common"
Daniel Veillard0b3d9b82003-11-17 11:51:30 +000011 xmlns:str="http://exslt.org/strings"
12 extension-element-prefixes="exsl str"
13 exclude-result-prefixes="exsl str">
Daniel Veillardc72f9fd2003-11-16 23:59:52 +000014
Daniel Veillard0b3d9b82003-11-17 11:51:30 +000015 <!-- Import the main part of the site stylesheets -->
Daniel Veillardc72f9fd2003-11-16 23:59:52 +000016 <xsl:import href="site.xsl"/>
17
18 <!-- Generate XHTML-1.0 transitional -->
19 <xsl:output method="xml" encoding="ISO-8859-1" indent="yes"
20 doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
21 doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/>
22
23 <!-- Build keys for all symbols -->
24 <xsl:key name="symbols" match="/api/symbols/*" use="@name"/>
25
Daniel Veillard2925c0a2003-11-17 13:58:17 +000026 <!-- the target directory for the HTML output -->
27 <xsl:variable name="htmldir">html</xsl:variable>
Daniel Veillarde8ba84e2003-11-18 13:54:15 +000028 <xsl:variable name="href_base">../</xsl:variable>
Daniel Veillardc72f9fd2003-11-16 23:59:52 +000029
Daniel Veillarde8ba84e2003-11-18 13:54:15 +000030 <!-- The table of content for the HTML API pages -->
31 <xsl:variable name="menu_name">API Menu</xsl:variable>
32 <xsl:variable name="apitoc">
33 <form action="../search.php"
34 enctype="application/x-www-form-urlencoded" method="get">
35 <input name="query" type="text" size="20" value=""/>
36 <input name="submit" type="submit" value="Search ..."/>
37 </form>
38 <ul><!-- style="margin-left: -1em" -->
39 <li><a style="font-weight:bold"
40 href="{$href_base}index.html">Main Menu</a></li>
41 <li><a style="font-weight:bold"
42 href="{$href_base}docs.html">Developer Menu</a></li>
43 <li><a style="font-weight:bold"
44 href="{$href_base}examples/index.html">Code Examples</a></li>
45 <li><a style="font-weight:bold"
Daniel Veillardbe586972003-11-18 20:56:51 +000046 href="index.html">API Menu</a></li>
Daniel Veillarde8ba84e2003-11-18 13:54:15 +000047 <li><a href="libxml-parser.html">Parser API</a></li>
48 <li><a href="libxml-tree.html">Tree API</a></li>
49 <li><a href="libxml-xmlreader.html">Reader API</a></li>
50 <li><a href="{$href_base}guidelines.html">XML Guidelines</a></li>
51 </ul>
52 </xsl:variable>
53 <xsl:template name="apitoc">
54 <table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000">
55 <tr>
56 <td>
57 <table width="100%" border="0" cellspacing="1" cellpadding="3">
58 <tr>
59 <td colspan="1" bgcolor="#eecfa1" align="center">
60 <center>
61 <b><xsl:value-of select="$menu_name"/></b>
62 </center>
63 </td>
64 </tr>
65 <tr>
66 <td bgcolor="#fffacd">
67 <xsl:copy-of select="$apitoc"/>
68 </td>
69 </tr>
70 </table>
71 <table width="100%" border="0" cellspacing="1" cellpadding="3">
72 <tr>
73 <td colspan="1" bgcolor="#eecfa1" align="center">
74 <center>
75 <b>API Indexes</b>
76 </center>
77 </td>
78 </tr>
79 <tr>
80 <td bgcolor="#fffacd">
81 <xsl:copy-of select="$api"/>
82 </td>
83 </tr>
84 </table>
85 <table width="100%" border="0" cellspacing="1" cellpadding="3">
86 <tr>
87 <td colspan="1" bgcolor="#eecfa1" align="center">
88 <center>
89 <b>Related links</b>
90 </center>
91 </td>
92 </tr>
93 <tr>
94 <td bgcolor="#fffacd">
95 <xsl:copy-of select="$related"/>
96 </td>
97 </tr>
98 </table>
99 </td>
100 </tr>
101 </table>
102 </xsl:template>
103
104 <xsl:template name="docstyle">
105 <style type="text/css">
Daniel Veillardbe586972003-11-18 20:56:51 +0000106 div.deprecated pre.programlisting {border-style: double;border-color:red}
Daniel Veillarde8ba84e2003-11-18 13:54:15 +0000107 pre.programlisting {border-style: double}
108 </style>
109 </xsl:template>
Daniel Veillardbff06bf2003-11-17 16:58:05 +0000110 <xsl:template name="navbar">
111 <xsl:variable name="previous" select="preceding-sibling::file[1]"/>
112 <xsl:variable name="next" select="following-sibling::file[1]"/>
113 <table class="navigation" width="100%" summary="Navigation header"
114 cellpadding="2" cellspacing="2">
115 <tr valign="middle">
116 <xsl:if test="$previous">
117 <td><a accesskey="p" href="libxml-{$previous/@name}.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></img></a></td>
118 <th align="left"><a href="libxml-{$previous/@name}.html"><xsl:value-of select="$previous/@name"/></a></th>
119 </xsl:if>
120 <td><a accesskey="u" href="index.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></img></a></td>
121 <th align="left"><a href="index.html">API documentation</a></th>
122 <td><a accesskey="h" href="../index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></img></a></td>
123 <th align="center"><a href="../index.html">The XML C parser and toolkit of Gnome</a></th>
124 <xsl:if test="$next">
125 <th align="right"><a href="libxml-{$next/@name}.html"><xsl:value-of select="$next/@name"/></a></th>
126 <td><a accesskey="n" href="libxml-{$next/@name}.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></img></a></td>
127 </xsl:if>
128 </tr>
129 </table>
130 </xsl:template>
131
Daniel Veillard0b3d9b82003-11-17 11:51:30 +0000132 <!-- This is convoluted but needed to force the current document to
133 be the API one and not the result tree from the tokenize() result,
134 because the keys are only defined on the main document -->
135 <xsl:template mode="dumptoken" match='*'>
136 <xsl:param name="token"/>
137 <xsl:variable name="ref" select="key('symbols', $token)"/>
138 <xsl:choose>
139 <xsl:when test="$ref">
140 <a href="libxml-{$ref/@file}.html#{$ref/@name}"><xsl:value-of select="$token"/></a>
141 </xsl:when>
142 <xsl:otherwise>
143 <xsl:value-of select="$token"/>
144 </xsl:otherwise>
145 </xsl:choose>
146 </xsl:template>
147
148 <!-- dumps a string, making cross-reference links -->
Daniel Veillardc72f9fd2003-11-16 23:59:52 +0000149 <xsl:template name="dumptext">
150 <xsl:param name="text"/>
Daniel Veillard0b3d9b82003-11-17 11:51:30 +0000151 <xsl:variable name="ctxt" select='.'/>
152 <!-- <xsl:value-of select="$text"/> -->
153 <xsl:for-each select="str:tokenize($text, ' &#9;')">
154 <xsl:apply-templates select="$ctxt" mode='dumptoken'>
155 <xsl:with-param name="token" select="string(.)"/>
156 </xsl:apply-templates>
157 <xsl:if test="position() != last()">
158 <xsl:text> </xsl:text>
159 </xsl:if>
160 </xsl:for-each>
Daniel Veillardc72f9fd2003-11-16 23:59:52 +0000161 </xsl:template>
162
163 <xsl:template match="macro" mode="toc">
Daniel Veillard0b3d9b82003-11-17 11:51:30 +0000164 <pre class="programlisting">
Daniel Veillard1a792412003-11-18 23:52:38 +0000165 <xsl:text>#define </xsl:text><a href="#{@name}"><xsl:value-of select="@name"/></a>
Daniel Veillard0b3d9b82003-11-17 11:51:30 +0000166 </pre>
167 </xsl:template>
168
Daniel Veillard2925c0a2003-11-17 13:58:17 +0000169 <xsl:template match="variable" mode="toc">
170 <pre class="programlisting">
171 <xsl:text>Variable </xsl:text>
172 <xsl:call-template name="dumptext">
173 <xsl:with-param name="text" select="string(@type)"/>
174 </xsl:call-template>
175 <xsl:text> </xsl:text>
176 <a name="{@name}"></a>
177 <xsl:value-of select="@name"/>
178 <xsl:text>
179
180</xsl:text>
181 </pre>
182 </xsl:template>
183
Daniel Veillard0b3d9b82003-11-17 11:51:30 +0000184 <xsl:template match="typedef" mode="toc">
185 <xsl:variable name="name" select="string(@name)"/>
186 <pre class="programlisting">
187 <xsl:choose>
188 <xsl:when test="@type = 'enum'">
189 <xsl:text>Enum </xsl:text>
Daniel Veillard1a792412003-11-18 23:52:38 +0000190 <a href="#{$name}"><xsl:value-of select="$name"/></a>
191 <xsl:text>
Daniel Veillard0b3d9b82003-11-17 11:51:30 +0000192</xsl:text>
193 </xsl:when>
194 <xsl:otherwise>
195 <xsl:text>Typedef </xsl:text>
196 <xsl:call-template name="dumptext">
197 <xsl:with-param name="text" select="@type"/>
198 </xsl:call-template>
199 <xsl:text> </xsl:text>
200 <a name="{$name}"><xsl:value-of select="$name"/></a>
201 <xsl:text>
Daniel Veillard0b3d9b82003-11-17 11:51:30 +0000202</xsl:text>
203 </xsl:otherwise>
204 </xsl:choose>
205 </pre>
Daniel Veillardc72f9fd2003-11-16 23:59:52 +0000206 </xsl:template>
207
Daniel Veillard1a792412003-11-18 23:52:38 +0000208 <xsl:template match="typedef[@type = 'enum']">
209 <xsl:variable name="name" select="string(@name)"/>
210 <h3><a name="{$name}"><xsl:value-of select="$name"/></a></h3>
211 <pre class="programlisting">
212 <xsl:text>Enum </xsl:text>
213 <xsl:value-of select="$name"/>
214 <xsl:text> {
215</xsl:text>
216 <xsl:for-each select="/api/symbols/enum[@type = $name]">
217 <xsl:sort select="@value" data-type="number" order="ascending"/>
218 <xsl:text> </xsl:text>
219 <a name="{@name}"><xsl:value-of select="@name"/></a>
220 <xsl:text> = </xsl:text>
221 <xsl:value-of select="@value"/>
222 <xsl:if test="@info != ''">
223 <xsl:text> : </xsl:text>
224 <xsl:call-template name="dumptext">
225 <xsl:with-param name="text" select="@info"/>
226 </xsl:call-template>
227 </xsl:if>
228 <xsl:text>
229</xsl:text>
230 </xsl:for-each>
231 <xsl:text>}
232</xsl:text>
233 </pre>
234 </xsl:template>
235
Daniel Veillardc72f9fd2003-11-16 23:59:52 +0000236 <xsl:template match="struct" mode="toc">
Daniel Veillard0b3d9b82003-11-17 11:51:30 +0000237 <pre class="programlisting">
Daniel Veillard1a792412003-11-18 23:52:38 +0000238 <xsl:text>Structure </xsl:text><a href="#{@name}"><xsl:value-of select="@name"/></a><br/>
239 <xsl:value-of select="@type"/><xsl:text>
240</xsl:text>
241 <xsl:if test="not(field)">
242 <xsl:text>The content of this structure is not made public by the API.
243</xsl:text>
244 </xsl:if>
245 </pre>
246 </xsl:template>
247
248 <xsl:template match="struct">
249 <h3><a name="{@name}">Structure <xsl:value-of select="@name"/></a></h3>
250 <pre class="programlisting">
251 <xsl:text>Structure </xsl:text><xsl:value-of select="@name"/><br/>
Daniel Veillardc72f9fd2003-11-16 23:59:52 +0000252 <xsl:value-of select="@type"/><xsl:text> {
253</xsl:text>
Daniel Veillard2925c0a2003-11-17 13:58:17 +0000254 <xsl:if test="not(field)">
255 <xsl:text>The content of this structure is not made public by the API.
256</xsl:text>
257 </xsl:if>
Daniel Veillardc72f9fd2003-11-16 23:59:52 +0000258 <xsl:for-each select="field">
259 <xsl:text> </xsl:text>
Daniel Veillard0b3d9b82003-11-17 11:51:30 +0000260 <xsl:call-template name="dumptext">
261 <xsl:with-param name="text" select="@type"/>
262 </xsl:call-template>
263 <xsl:text>&#9;</xsl:text>
Daniel Veillard2925c0a2003-11-17 13:58:17 +0000264 <xsl:value-of select="@name"/>
265 <xsl:if test="@info != ''">
266 <xsl:text>&#9;: </xsl:text>
267 <xsl:call-template name="dumptext">
Daniel Veillardbe586972003-11-18 20:56:51 +0000268 <xsl:with-param name="text" select="substring(@info, 1, 40)"/>
Daniel Veillard2925c0a2003-11-17 13:58:17 +0000269 </xsl:call-template>
270 </xsl:if>
Daniel Veillard0b3d9b82003-11-17 11:51:30 +0000271 <xsl:text>
Daniel Veillardc72f9fd2003-11-16 23:59:52 +0000272</xsl:text>
273 </xsl:for-each>
Daniel Veillard2925c0a2003-11-17 13:58:17 +0000274 <xsl:text>}</xsl:text>
Daniel Veillard0b3d9b82003-11-17 11:51:30 +0000275 </pre>
Daniel Veillardc72f9fd2003-11-16 23:59:52 +0000276 </xsl:template>
277
278 <xsl:template match="macro">
279 <xsl:variable name="name" select="string(@name)"/>
280 <h3><a name="{$name}"></a>Macro: <xsl:value-of select="$name"/></h3>
281 <pre><xsl:text>#define </xsl:text><xsl:value-of select="$name"/></pre>
282 <p>
283 <xsl:call-template name="dumptext">
284 <xsl:with-param name="text" select="info"/>
285 </xsl:call-template>
286 </p><xsl:text>
287</xsl:text>
288 </xsl:template>
289
290 <xsl:template match="function" mode="toc">
Daniel Veillard1a792412003-11-18 23:52:38 +0000291 <xsl:variable name="name" select="string(@name)"/>
292 <xsl:variable name="nlen" select="string-length($name)"/>
293 <xsl:variable name="tlen" select="string-length(return/@type)"/>
294 <xsl:variable name="blen" select="(($nlen + 8) - (($nlen + 8) mod 8)) + (($tlen + 8) - (($tlen + 8) mod 8))"/>
Daniel Veillard0b3d9b82003-11-17 11:51:30 +0000295 <pre class="programlisting">
Daniel Veillardc72f9fd2003-11-16 23:59:52 +0000296 <xsl:call-template name="dumptext">
297 <xsl:with-param name="text" select="return/@type"/>
298 </xsl:call-template>
299 <xsl:text>&#9;</xsl:text>
300 <a href="#{@name}"><xsl:value-of select="@name"/></a>
Daniel Veillard1a792412003-11-18 23:52:38 +0000301 <xsl:if test="$blen - 40 &lt; -8">
302 <xsl:text>&#9;</xsl:text>
303 </xsl:if>
304 <xsl:if test="$blen - 40 &lt; 0">
305 <xsl:text>&#9;</xsl:text>
306 </xsl:if>
Daniel Veillardc72f9fd2003-11-16 23:59:52 +0000307 <xsl:text>&#9;(</xsl:text>
Daniel Veillard0b3d9b82003-11-17 11:51:30 +0000308 <xsl:if test="not(arg)">
309 <xsl:text>void</xsl:text>
310 </xsl:if>
Daniel Veillardc72f9fd2003-11-16 23:59:52 +0000311 <xsl:for-each select="arg">
312 <xsl:call-template name="dumptext">
313 <xsl:with-param name="text" select="@type"/>
314 </xsl:call-template>
315 <xsl:text> </xsl:text>
316 <xsl:value-of select="@name"/>
317 <xsl:if test="position() != last()">
Daniel Veillard1a792412003-11-18 23:52:38 +0000318 <xsl:text>, </xsl:text><br/>
319 <xsl:if test="$blen - 40 &gt; 8">
320 <xsl:text>&#9;</xsl:text>
321 </xsl:if>
322 <xsl:if test="$blen - 40 &gt; 0">
323 <xsl:text>&#9;</xsl:text>
324 </xsl:if>
325 <xsl:text>&#9;&#9;&#9;&#9;&#9; </xsl:text>
Daniel Veillardc72f9fd2003-11-16 23:59:52 +0000326 </xsl:if>
327 </xsl:for-each>
Daniel Veillard1a792412003-11-18 23:52:38 +0000328 <xsl:text>)</xsl:text>
329 </pre><xsl:text>
Daniel Veillardc72f9fd2003-11-16 23:59:52 +0000330</xsl:text>
Daniel Veillard0b3d9b82003-11-17 11:51:30 +0000331 </xsl:template>
332
333 <xsl:template match="functype" mode="toc">
Daniel Veillard0b3d9b82003-11-17 11:51:30 +0000334 <xsl:variable name="name" select="string(@name)"/>
Daniel Veillard1a792412003-11-18 23:52:38 +0000335 <xsl:variable name="nlen" select="string-length($name)"/>
336 <xsl:variable name="tlen" select="string-length(return/@type)"/>
337 <xsl:variable name="blen" select="(($nlen + 8) - (($nlen + 8) mod 8)) + (($tlen + 8) - (($tlen + 8) mod 8))"/>
338 <pre class="programlisting">
339 <xsl:text>Function type: </xsl:text>
340 <a href="#{$name}"><xsl:value-of select="$name"/></a>
341 <xsl:text>
342</xsl:text>
343 <xsl:call-template name="dumptext">
344 <xsl:with-param name="text" select="return/@type"/>
345 </xsl:call-template>
346 <xsl:text>&#9;</xsl:text>
347 <a href="#{$name}"><xsl:value-of select="$name"/></a>
348 <xsl:if test="$blen - 40 &lt; -8">
349 <xsl:text>&#9;</xsl:text>
350 </xsl:if>
351 <xsl:if test="$blen - 40 &lt; 0">
352 <xsl:text>&#9;</xsl:text>
353 </xsl:if>
354 <xsl:text>&#9;(</xsl:text>
355 <xsl:if test="not(arg)">
356 <xsl:text>void</xsl:text>
357 </xsl:if>
358 <xsl:for-each select="arg">
359 <xsl:call-template name="dumptext">
360 <xsl:with-param name="text" select="@type"/>
361 </xsl:call-template>
362 <xsl:text> </xsl:text>
363 <xsl:value-of select="@name"/>
364 <xsl:if test="position() != last()">
365 <xsl:text>, </xsl:text><br/>
366 <xsl:if test="$blen - 40 &gt; 8">
367 <xsl:text>&#9;</xsl:text>
368 </xsl:if>
369 <xsl:if test="$blen - 40 &gt; 0">
370 <xsl:text>&#9;</xsl:text>
371 </xsl:if>
372 <xsl:text>&#9;&#9;&#9;&#9;&#9; </xsl:text>
373 </xsl:if>
374 </xsl:for-each>
375 <xsl:text>)
376</xsl:text>
377 </pre>
378 <xsl:text>
379</xsl:text>
380 </xsl:template>
381
382 <xsl:template match="functype">
383 <xsl:variable name="name" select="string(@name)"/>
384 <xsl:variable name="nlen" select="string-length($name)"/>
385 <xsl:variable name="tlen" select="string-length(return/@type)"/>
386 <xsl:variable name="blen" select="(($nlen + 8) - (($nlen + 8) mod 8)) + (($tlen + 8) - (($tlen + 8) mod 8))"/>
387 <h3>
388 <a name="{$name}"></a>
389 <xsl:text>Function type: </xsl:text>
390 <xsl:value-of select="$name"/>
391 </h3>
392 <pre class="programlisting">
Daniel Veillard0b3d9b82003-11-17 11:51:30 +0000393 <xsl:text>Function type: </xsl:text>
394 <xsl:value-of select="$name"/>
395 <xsl:text>
396</xsl:text>
397 <xsl:call-template name="dumptext">
398 <xsl:with-param name="text" select="return/@type"/>
399 </xsl:call-template>
400 <xsl:text>&#9;</xsl:text>
401 <xsl:value-of select="@name"/>
Daniel Veillard1a792412003-11-18 23:52:38 +0000402 <xsl:if test="$blen - 40 &lt; -8">
403 <xsl:text>&#9;</xsl:text>
404 </xsl:if>
405 <xsl:if test="$blen - 40 &lt; 0">
406 <xsl:text>&#9;</xsl:text>
407 </xsl:if>
Daniel Veillard0b3d9b82003-11-17 11:51:30 +0000408 <xsl:text>&#9;(</xsl:text>
409 <xsl:if test="not(arg)">
410 <xsl:text>void</xsl:text>
411 </xsl:if>
412 <xsl:for-each select="arg">
413 <xsl:call-template name="dumptext">
414 <xsl:with-param name="text" select="@type"/>
415 </xsl:call-template>
416 <xsl:text> </xsl:text>
417 <xsl:value-of select="@name"/>
418 <xsl:if test="position() != last()">
Daniel Veillard1a792412003-11-18 23:52:38 +0000419 <xsl:text>, </xsl:text><br/>
420 <xsl:if test="$blen - 40 &gt; 8">
421 <xsl:text>&#9;</xsl:text>
422 </xsl:if>
423 <xsl:if test="$blen - 40 &gt; 0">
424 <xsl:text>&#9;</xsl:text>
425 </xsl:if>
426 <xsl:text>&#9;&#9;&#9;&#9;&#9; </xsl:text>
Daniel Veillard0b3d9b82003-11-17 11:51:30 +0000427 </xsl:if>
428 </xsl:for-each>
429 <xsl:text>)
430</xsl:text>
431 </pre>
432 <p>
433 <xsl:call-template name="dumptext">
434 <xsl:with-param name="text" select="info"/>
435 </xsl:call-template>
Daniel Veillard2925c0a2003-11-17 13:58:17 +0000436 </p>
Daniel Veillard0b3d9b82003-11-17 11:51:30 +0000437 <xsl:if test="arg | return">
438 <div class="variablelist"><table border="0"><col align="left"/><tbody>
439 <xsl:for-each select="arg">
440 <tr>
441 <td><span class="term"><i><tt><xsl:value-of select="@name"/></tt></i>:</span></td>
Daniel Veillard2925c0a2003-11-17 13:58:17 +0000442 <td>
443 <xsl:call-template name="dumptext">
444 <xsl:with-param name="text" select="@info"/>
445 </xsl:call-template>
446 </td>
Daniel Veillard0b3d9b82003-11-17 11:51:30 +0000447 </tr>
448 </xsl:for-each>
449 <xsl:if test="return/@info">
450 <tr>
451 <td><span class="term"><i><tt>Returns</tt></i>:</span></td>
Daniel Veillard2925c0a2003-11-17 13:58:17 +0000452 <td>
453 <xsl:call-template name="dumptext">
454 <xsl:with-param name="text" select="return/@info"/>
455 </xsl:call-template>
456 </td>
Daniel Veillard0b3d9b82003-11-17 11:51:30 +0000457 </tr>
458 </xsl:if>
459 </tbody></table></div>
460 </xsl:if>
Daniel Veillard2925c0a2003-11-17 13:58:17 +0000461 <br/>
462 <xsl:text>
463</xsl:text>
Daniel Veillardc72f9fd2003-11-16 23:59:52 +0000464 </xsl:template>
465
466 <xsl:template match="function">
467 <xsl:variable name="name" select="string(@name)"/>
Daniel Veillard1a792412003-11-18 23:52:38 +0000468 <xsl:variable name="nlen" select="string-length($name)"/>
469 <xsl:variable name="tlen" select="string-length(return/@type)"/>
470 <xsl:variable name="blen" select="(($nlen + 8) - (($nlen + 8) mod 8)) + (($tlen + 8) - (($tlen + 8) mod 8))"/>
Daniel Veillardc72f9fd2003-11-16 23:59:52 +0000471 <h3><a name="{$name}"></a>Function: <xsl:value-of select="$name"/></h3>
472 <pre class="programlisting">
473 <xsl:call-template name="dumptext">
474 <xsl:with-param name="text" select="return/@type"/>
475 </xsl:call-template>
476 <xsl:text>&#9;</xsl:text>
477 <xsl:value-of select="@name"/>
Daniel Veillard1a792412003-11-18 23:52:38 +0000478 <xsl:if test="$blen - 40 &lt; -8">
479 <xsl:text>&#9;</xsl:text>
480 </xsl:if>
481 <xsl:if test="$blen - 40 &lt; 0">
482 <xsl:text>&#9;</xsl:text>
483 </xsl:if>
Daniel Veillardc72f9fd2003-11-16 23:59:52 +0000484 <xsl:text>&#9;(</xsl:text>
Daniel Veillard0b3d9b82003-11-17 11:51:30 +0000485 <xsl:if test="not(arg)">
486 <xsl:text>void</xsl:text>
487 </xsl:if>
Daniel Veillardc72f9fd2003-11-16 23:59:52 +0000488 <xsl:for-each select="arg">
489 <xsl:call-template name="dumptext">
490 <xsl:with-param name="text" select="@type"/>
491 </xsl:call-template>
492 <xsl:text> </xsl:text>
493 <xsl:value-of select="@name"/>
494 <xsl:if test="position() != last()">
Daniel Veillard1a792412003-11-18 23:52:38 +0000495 <xsl:text>, </xsl:text><br/>
496 <xsl:if test="$blen - 40 &gt; 8">
497 <xsl:text>&#9;</xsl:text>
498 </xsl:if>
499 <xsl:if test="$blen - 40 &gt; 0">
500 <xsl:text>&#9;</xsl:text>
501 </xsl:if>
502 <xsl:text>&#9;&#9;&#9;&#9;&#9; </xsl:text>
Daniel Veillardc72f9fd2003-11-16 23:59:52 +0000503 </xsl:if>
504 </xsl:for-each>
505 <xsl:text>)</xsl:text><br/>
506 <xsl:text>
507</xsl:text>
508 </pre>
509 <p>
510 <xsl:call-template name="dumptext">
511 <xsl:with-param name="text" select="info"/>
512 </xsl:call-template>
513 </p><xsl:text>
514</xsl:text>
Daniel Veillard0b3d9b82003-11-17 11:51:30 +0000515 <xsl:if test="arg | return/@info">
516 <div class="variablelist"><table border="0"><col align="left"/><tbody>
517 <xsl:for-each select="arg">
518 <tr>
519 <td><span class="term"><i><tt><xsl:value-of select="@name"/></tt></i>:</span></td>
Daniel Veillard2925c0a2003-11-17 13:58:17 +0000520 <td>
521 <xsl:call-template name="dumptext">
522 <xsl:with-param name="text" select="@info"/>
523 </xsl:call-template>
524 </td>
Daniel Veillard0b3d9b82003-11-17 11:51:30 +0000525 </tr>
526 </xsl:for-each>
527 <xsl:if test="return/@info">
528 <tr>
529 <td><span class="term"><i><tt>Returns</tt></i>:</span></td>
Daniel Veillard2925c0a2003-11-17 13:58:17 +0000530 <td>
531 <xsl:call-template name="dumptext">
532 <xsl:with-param name="text" select="return/@info"/>
533 </xsl:call-template>
534 </td>
Daniel Veillard0b3d9b82003-11-17 11:51:30 +0000535 </tr>
536 </xsl:if>
537 </tbody></table></div>
Daniel Veillardc72f9fd2003-11-16 23:59:52 +0000538 </xsl:if>
Daniel Veillardc72f9fd2003-11-16 23:59:52 +0000539 </xsl:template>
540
541 <xsl:template match="exports" mode="toc">
Daniel Veillard2925c0a2003-11-17 13:58:17 +0000542 <xsl:apply-templates select="key('symbols', string(@symbol))[1]" mode="toc"/>
Daniel Veillardc72f9fd2003-11-16 23:59:52 +0000543 </xsl:template>
544
545 <xsl:template match="exports">
Daniel Veillard2925c0a2003-11-17 13:58:17 +0000546 <xsl:apply-templates select="key('symbols', string(@symbol))[1]"/>
Daniel Veillardc72f9fd2003-11-16 23:59:52 +0000547 </xsl:template>
548
Daniel Veillardbe586972003-11-18 20:56:51 +0000549 <xsl:template name="description">
550 <xsl:if test="deprecated">
551 <h2 style="font-weight:bold;color:red;text-align:center">This module is deprecated</h2>
552 </xsl:if>
553 <xsl:if test="description">
554 <p><xsl:value-of select="description"/></p>
555 </xsl:if>
556 </xsl:template>
557
Daniel Veillardc72f9fd2003-11-16 23:59:52 +0000558 <xsl:template match="file">
559 <xsl:variable name="name" select="@name"/>
560 <xsl:variable name="title">Module <xsl:value-of select="$name"/> from <xsl:value-of select="/api/@name"/></xsl:variable>
561 <xsl:document href="{$htmldir}/libxml-{$name}.html" method="xml" encoding="ISO-8859-1"
562 doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
563 doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
564 <html>
565 <head>
566 <xsl:call-template name="style"/>
Daniel Veillarde8ba84e2003-11-18 13:54:15 +0000567 <xsl:call-template name="docstyle"/>
Daniel Veillardc72f9fd2003-11-16 23:59:52 +0000568 <title><xsl:value-of select="$title"/></title>
569 </head>
570 <body bgcolor="#8b7765" text="#000000" link="#000000" vlink="#000000">
571 <xsl:call-template name="titlebox">
572 <xsl:with-param name="title" select="$title"/>
573 </xsl:call-template>
574 <table border="0" cellpadding="4" cellspacing="0" width="100%" align="center">
575 <tr>
576 <td bgcolor="#8b7765">
577 <table border="0" cellspacing="0" cellpadding="2" width="100%">
578 <tr>
579 <td valign="top" width="200" bgcolor="#8b7765">
Daniel Veillarde8ba84e2003-11-18 13:54:15 +0000580 <xsl:call-template name="apitoc"/>
Daniel Veillardc72f9fd2003-11-16 23:59:52 +0000581 </td>
582 <td valign="top" bgcolor="#8b7765">
583 <table border="0" cellspacing="0" cellpadding="1" width="100%">
584 <tr>
585 <td>
586 <table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000">
587 <tr>
588 <td>
589 <table border="0" cellpadding="3" cellspacing="1" width="100%">
590 <tr>
591 <td bgcolor="#fffacd">
Daniel Veillardbff06bf2003-11-17 16:58:05 +0000592 <xsl:call-template name="navbar"/>
Daniel Veillardbe586972003-11-18 20:56:51 +0000593 <xsl:call-template name="description"/>
594 <xsl:choose>
595 <xsl:when test="deprecated">
596 <div class="deprecated">
597 <h2>Table of Contents</h2>
598 <xsl:apply-templates select="exports" mode="toc"/>
599 <h2>Description</h2>
600 <xsl:text>
Daniel Veillardc72f9fd2003-11-16 23:59:52 +0000601</xsl:text>
Daniel Veillardbe586972003-11-18 20:56:51 +0000602 <xsl:apply-templates select="exports"/>
603 </div>
604 </xsl:when>
605 <xsl:otherwise>
606 <h2>Table of Contents</h2>
Daniel Veillard1a792412003-11-18 23:52:38 +0000607 <xsl:apply-templates select="exports[@type='macro']" mode="toc">
608 <xsl:sort select='@symbol'/>
609 </xsl:apply-templates>
610 <xsl:apply-templates select="exports[@type='enum']" mode="toc">
611 <xsl:sort select='@symbol'/>
612 </xsl:apply-templates>
613 <xsl:apply-templates select="exports[@type='typedef']" mode="toc">
614 <xsl:sort select='@symbol'/>
615 </xsl:apply-templates>
616 <xsl:apply-templates select="exports[@type='struct']" mode="toc">
617 <xsl:sort select='@symbol'/>
618 </xsl:apply-templates>
619 <xsl:apply-templates select="exports[@type='function']" mode="toc">
620 <xsl:sort select='@symbol'/>
621 </xsl:apply-templates>
Daniel Veillardbe586972003-11-18 20:56:51 +0000622 <h2>Description</h2>
623 <xsl:text>
624</xsl:text>
625 <xsl:apply-templates select="exports"/>
626 </xsl:otherwise>
627 </xsl:choose>
628 <p><a href="{$href_base}bugs.html">Daniel Veillard</a></p>
Daniel Veillardc72f9fd2003-11-16 23:59:52 +0000629 </td>
630 </tr>
631 </table>
632 </td>
633 </tr>
634 </table>
635 </td>
636 </tr>
637 </table>
638 </td>
639 </tr>
640 </table>
641 </td>
642 </tr>
643 </table>
644 </body>
645 </html>
646 </xsl:document>
647 </xsl:template>
648
649 <xsl:template match="file" mode="toc">
650 <xsl:variable name="name" select="@name"/>
Daniel Veillardbe586972003-11-18 20:56:51 +0000651 <li>
652 <a href="libxml-{$name}.html"><xsl:value-of select="$name"/></a>
653 <xsl:text>: </xsl:text>
654 <xsl:value-of select="summary"/>
655 </li>
Daniel Veillardc72f9fd2003-11-16 23:59:52 +0000656 </xsl:template>
657
Daniel Veillardbe586972003-11-18 20:56:51 +0000658 <xsl:template name="mainpage">
659 <xsl:param name="file" select="concat($htmldir, '/index.html')"/>
Daniel Veillardc72f9fd2003-11-16 23:59:52 +0000660 <xsl:variable name="title">Reference Manual for <xsl:value-of select="/api/@name"/></xsl:variable>
Daniel Veillardbe586972003-11-18 20:56:51 +0000661 <xsl:document href="{$file}" method="xml" encoding="ISO-8859-1"
Daniel Veillardc72f9fd2003-11-16 23:59:52 +0000662 doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
663 doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
664 <html>
665 <head>
666 <xsl:call-template name="style"/>
Daniel Veillarde8ba84e2003-11-18 13:54:15 +0000667 <xsl:call-template name="docstyle"/>
Daniel Veillardc72f9fd2003-11-16 23:59:52 +0000668 <title><xsl:value-of select="$title"/></title>
669 </head>
670 <body bgcolor="#8b7765" text="#000000" link="#000000" vlink="#000000">
671 <xsl:call-template name="titlebox">
672 <xsl:with-param name="title" select="$title"/>
673 </xsl:call-template>
674 <table border="0" cellpadding="4" cellspacing="0" width="100%" align="center">
675 <tr>
676 <td bgcolor="#8b7765">
677 <table border="0" cellspacing="0" cellpadding="2" width="100%">
678 <tr>
679 <td valign="top" width="200" bgcolor="#8b7765">
Daniel Veillarde8ba84e2003-11-18 13:54:15 +0000680 <xsl:call-template name="apitoc"/>
Daniel Veillardc72f9fd2003-11-16 23:59:52 +0000681 </td>
682 <td valign="top" bgcolor="#8b7765">
683 <table border="0" cellspacing="0" cellpadding="1" width="100%">
684 <tr>
685 <td>
686 <table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000">
687 <tr>
688 <td>
689 <table border="0" cellpadding="3" cellspacing="1" width="100%">
690 <tr>
691 <td bgcolor="#fffacd">
692 <h2>Table of Contents</h2>
693 <ul>
694 <xsl:apply-templates select="/api/files/file" mode="toc"/>
695 </ul>
Daniel Veillardbe586972003-11-18 20:56:51 +0000696 <p><a href="{$href_base}bugs.html">Daniel Veillard</a></p>
Daniel Veillardc72f9fd2003-11-16 23:59:52 +0000697 </td>
698 </tr>
699 </table>
700 </td>
701 </tr>
702 </table>
703 </td>
704 </tr>
705 </table>
706 </td>
707 </tr>
708 </table>
709 </td>
710 </tr>
711 </table>
712 </body>
713 </html>
714 </xsl:document>
Daniel Veillardbe586972003-11-18 20:56:51 +0000715 </xsl:template>
716
717 <xsl:template match="/">
718 <!-- Save the main index.html as well as a couple of copies -->
719 <xsl:call-template name="mainpage"/>
720 <xsl:call-template name="mainpage">
721 <xsl:with-param name="file" select="concat($htmldir, '/book1.html')"/>
722 </xsl:call-template>
723 <xsl:call-template name="mainpage">
724 <xsl:with-param name="file" select="concat($htmldir, '/libxml-lib.html')"/>
725 </xsl:call-template>
Daniel Veillardc72f9fd2003-11-16 23:59:52 +0000726 <!-- now build the file for each of the modules -->
727 <xsl:apply-templates select="/api/files/file"/>
728 </xsl:template>
729
730</xsl:stylesheet>