blob: 17d0464ac48b5ea37dea03e09045acc78cc2dfe2 [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>
Daniel Veillarda1800a22004-05-16 00:55:18 +000051 <li><a href="{$href_base}ChangeLog.html">ChangeLog</a></li>
Daniel Veillarde8ba84e2003-11-18 13:54:15 +000052 </ul>
53 </xsl:variable>
54 <xsl:template name="apitoc">
55 <table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000">
56 <tr>
57 <td>
58 <table width="100%" border="0" cellspacing="1" cellpadding="3">
59 <tr>
60 <td colspan="1" bgcolor="#eecfa1" align="center">
61 <center>
62 <b><xsl:value-of select="$menu_name"/></b>
63 </center>
64 </td>
65 </tr>
66 <tr>
67 <td bgcolor="#fffacd">
68 <xsl:copy-of select="$apitoc"/>
69 </td>
70 </tr>
71 </table>
72 <table width="100%" border="0" cellspacing="1" cellpadding="3">
73 <tr>
74 <td colspan="1" bgcolor="#eecfa1" align="center">
75 <center>
76 <b>API Indexes</b>
77 </center>
78 </td>
79 </tr>
80 <tr>
81 <td bgcolor="#fffacd">
82 <xsl:copy-of select="$api"/>
83 </td>
84 </tr>
85 </table>
86 <table width="100%" border="0" cellspacing="1" cellpadding="3">
87 <tr>
88 <td colspan="1" bgcolor="#eecfa1" align="center">
89 <center>
90 <b>Related links</b>
91 </center>
92 </td>
93 </tr>
94 <tr>
95 <td bgcolor="#fffacd">
96 <xsl:copy-of select="$related"/>
97 </td>
98 </tr>
99 </table>
100 </td>
101 </tr>
102 </table>
103 </xsl:template>
104
105 <xsl:template name="docstyle">
106 <style type="text/css">
Daniel Veillardbe586972003-11-18 20:56:51 +0000107 div.deprecated pre.programlisting {border-style: double;border-color:red}
MST 2004 John Fleck2050d892004-01-05 01:56:38 +0000108 pre.programlisting {border-style: double;background: #EECFA1}
Daniel Veillarde8ba84e2003-11-18 13:54:15 +0000109 </style>
110 </xsl:template>
Daniel Veillardbff06bf2003-11-17 16:58:05 +0000111 <xsl:template name="navbar">
112 <xsl:variable name="previous" select="preceding-sibling::file[1]"/>
113 <xsl:variable name="next" select="following-sibling::file[1]"/>
114 <table class="navigation" width="100%" summary="Navigation header"
115 cellpadding="2" cellspacing="2">
116 <tr valign="middle">
117 <xsl:if test="$previous">
118 <td><a accesskey="p" href="libxml-{$previous/@name}.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></img></a></td>
119 <th align="left"><a href="libxml-{$previous/@name}.html"><xsl:value-of select="$previous/@name"/></a></th>
120 </xsl:if>
121 <td><a accesskey="u" href="index.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></img></a></td>
122 <th align="left"><a href="index.html">API documentation</a></th>
123 <td><a accesskey="h" href="../index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></img></a></td>
124 <th align="center"><a href="../index.html">The XML C parser and toolkit of Gnome</a></th>
125 <xsl:if test="$next">
126 <th align="right"><a href="libxml-{$next/@name}.html"><xsl:value-of select="$next/@name"/></a></th>
127 <td><a accesskey="n" href="libxml-{$next/@name}.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></img></a></td>
128 </xsl:if>
129 </tr>
130 </table>
131 </xsl:template>
132
Daniel Veillard0b3d9b82003-11-17 11:51:30 +0000133 <!-- This is convoluted but needed to force the current document to
134 be the API one and not the result tree from the tokenize() result,
135 because the keys are only defined on the main document -->
136 <xsl:template mode="dumptoken" match='*'>
137 <xsl:param name="token"/>
138 <xsl:variable name="ref" select="key('symbols', $token)"/>
139 <xsl:choose>
140 <xsl:when test="$ref">
141 <a href="libxml-{$ref/@file}.html#{$ref/@name}"><xsl:value-of select="$token"/></a>
142 </xsl:when>
143 <xsl:otherwise>
144 <xsl:value-of select="$token"/>
145 </xsl:otherwise>
146 </xsl:choose>
147 </xsl:template>
148
149 <!-- dumps a string, making cross-reference links -->
Daniel Veillardc72f9fd2003-11-16 23:59:52 +0000150 <xsl:template name="dumptext">
151 <xsl:param name="text"/>
Daniel Veillard0b3d9b82003-11-17 11:51:30 +0000152 <xsl:variable name="ctxt" select='.'/>
153 <!-- <xsl:value-of select="$text"/> -->
154 <xsl:for-each select="str:tokenize($text, ' &#9;')">
155 <xsl:apply-templates select="$ctxt" mode='dumptoken'>
156 <xsl:with-param name="token" select="string(.)"/>
157 </xsl:apply-templates>
158 <xsl:if test="position() != last()">
159 <xsl:text> </xsl:text>
160 </xsl:if>
161 </xsl:for-each>
Daniel Veillardc72f9fd2003-11-16 23:59:52 +0000162 </xsl:template>
163
164 <xsl:template match="macro" mode="toc">
Daniel Veillard0b3d9b82003-11-17 11:51:30 +0000165 <pre class="programlisting">
Daniel Veillard1a792412003-11-18 23:52:38 +0000166 <xsl:text>#define </xsl:text><a href="#{@name}"><xsl:value-of select="@name"/></a>
Daniel Veillard0b3d9b82003-11-17 11:51:30 +0000167 </pre>
168 </xsl:template>
169
Daniel Veillard2925c0a2003-11-17 13:58:17 +0000170 <xsl:template match="variable" mode="toc">
171 <pre class="programlisting">
172 <xsl:text>Variable </xsl:text>
173 <xsl:call-template name="dumptext">
174 <xsl:with-param name="text" select="string(@type)"/>
175 </xsl:call-template>
176 <xsl:text> </xsl:text>
177 <a name="{@name}"></a>
178 <xsl:value-of select="@name"/>
179 <xsl:text>
180
181</xsl:text>
182 </pre>
183 </xsl:template>
184
Daniel Veillard0b3d9b82003-11-17 11:51:30 +0000185 <xsl:template match="typedef" mode="toc">
186 <xsl:variable name="name" select="string(@name)"/>
187 <pre class="programlisting">
188 <xsl:choose>
189 <xsl:when test="@type = 'enum'">
190 <xsl:text>Enum </xsl:text>
Daniel Veillard1a792412003-11-18 23:52:38 +0000191 <a href="#{$name}"><xsl:value-of select="$name"/></a>
192 <xsl:text>
Daniel Veillard0b3d9b82003-11-17 11:51:30 +0000193</xsl:text>
194 </xsl:when>
195 <xsl:otherwise>
196 <xsl:text>Typedef </xsl:text>
197 <xsl:call-template name="dumptext">
198 <xsl:with-param name="text" select="@type"/>
199 </xsl:call-template>
200 <xsl:text> </xsl:text>
201 <a name="{$name}"><xsl:value-of select="$name"/></a>
202 <xsl:text>
Daniel Veillard0b3d9b82003-11-17 11:51:30 +0000203</xsl:text>
204 </xsl:otherwise>
205 </xsl:choose>
206 </pre>
Daniel Veillardc72f9fd2003-11-16 23:59:52 +0000207 </xsl:template>
208
Daniel Veillard1a792412003-11-18 23:52:38 +0000209 <xsl:template match="typedef[@type = 'enum']">
210 <xsl:variable name="name" select="string(@name)"/>
William M. Brack7f40d132003-11-19 09:52:29 +0000211 <h3>Enum <a name="{$name}"><xsl:value-of select="$name"/></a></h3>
Daniel Veillard1a792412003-11-18 23:52:38 +0000212 <pre class="programlisting">
213 <xsl:text>Enum </xsl:text>
214 <xsl:value-of select="$name"/>
215 <xsl:text> {
216</xsl:text>
217 <xsl:for-each select="/api/symbols/enum[@type = $name]">
218 <xsl:sort select="@value" data-type="number" order="ascending"/>
219 <xsl:text> </xsl:text>
220 <a name="{@name}"><xsl:value-of select="@name"/></a>
221 <xsl:text> = </xsl:text>
222 <xsl:value-of select="@value"/>
223 <xsl:if test="@info != ''">
224 <xsl:text> : </xsl:text>
225 <xsl:call-template name="dumptext">
226 <xsl:with-param name="text" select="@info"/>
227 </xsl:call-template>
228 </xsl:if>
229 <xsl:text>
230</xsl:text>
231 </xsl:for-each>
232 <xsl:text>}
233</xsl:text>
234 </pre>
235 </xsl:template>
236
Daniel Veillardc72f9fd2003-11-16 23:59:52 +0000237 <xsl:template match="struct" mode="toc">
Daniel Veillard0b3d9b82003-11-17 11:51:30 +0000238 <pre class="programlisting">
Daniel Veillard1a792412003-11-18 23:52:38 +0000239 <xsl:text>Structure </xsl:text><a href="#{@name}"><xsl:value-of select="@name"/></a><br/>
240 <xsl:value-of select="@type"/><xsl:text>
241</xsl:text>
242 <xsl:if test="not(field)">
243 <xsl:text>The content of this structure is not made public by the API.
244</xsl:text>
245 </xsl:if>
246 </pre>
247 </xsl:template>
248
249 <xsl:template match="struct">
250 <h3><a name="{@name}">Structure <xsl:value-of select="@name"/></a></h3>
251 <pre class="programlisting">
252 <xsl:text>Structure </xsl:text><xsl:value-of select="@name"/><br/>
Daniel Veillardc72f9fd2003-11-16 23:59:52 +0000253 <xsl:value-of select="@type"/><xsl:text> {
254</xsl:text>
Daniel Veillard2925c0a2003-11-17 13:58:17 +0000255 <xsl:if test="not(field)">
256 <xsl:text>The content of this structure is not made public by the API.
257</xsl:text>
258 </xsl:if>
Daniel Veillardc72f9fd2003-11-16 23:59:52 +0000259 <xsl:for-each select="field">
260 <xsl:text> </xsl:text>
Daniel Veillard0b3d9b82003-11-17 11:51:30 +0000261 <xsl:call-template name="dumptext">
262 <xsl:with-param name="text" select="@type"/>
263 </xsl:call-template>
264 <xsl:text>&#9;</xsl:text>
Daniel Veillard2925c0a2003-11-17 13:58:17 +0000265 <xsl:value-of select="@name"/>
266 <xsl:if test="@info != ''">
267 <xsl:text>&#9;: </xsl:text>
268 <xsl:call-template name="dumptext">
Daniel Veillardbe586972003-11-18 20:56:51 +0000269 <xsl:with-param name="text" select="substring(@info, 1, 40)"/>
Daniel Veillard2925c0a2003-11-17 13:58:17 +0000270 </xsl:call-template>
271 </xsl:if>
Daniel Veillard0b3d9b82003-11-17 11:51:30 +0000272 <xsl:text>
Daniel Veillardc72f9fd2003-11-16 23:59:52 +0000273</xsl:text>
274 </xsl:for-each>
Daniel Veillard2925c0a2003-11-17 13:58:17 +0000275 <xsl:text>}</xsl:text>
Daniel Veillard0b3d9b82003-11-17 11:51:30 +0000276 </pre>
Daniel Veillardc72f9fd2003-11-16 23:59:52 +0000277 </xsl:template>
278
279 <xsl:template match="macro">
280 <xsl:variable name="name" select="string(@name)"/>
281 <h3><a name="{$name}"></a>Macro: <xsl:value-of select="$name"/></h3>
282 <pre><xsl:text>#define </xsl:text><xsl:value-of select="$name"/></pre>
283 <p>
284 <xsl:call-template name="dumptext">
285 <xsl:with-param name="text" select="info"/>
286 </xsl:call-template>
287 </p><xsl:text>
288</xsl:text>
289 </xsl:template>
290
291 <xsl:template match="function" mode="toc">
Daniel Veillard1a792412003-11-18 23:52:38 +0000292 <xsl:variable name="name" select="string(@name)"/>
293 <xsl:variable name="nlen" select="string-length($name)"/>
294 <xsl:variable name="tlen" select="string-length(return/@type)"/>
295 <xsl:variable name="blen" select="(($nlen + 8) - (($nlen + 8) mod 8)) + (($tlen + 8) - (($tlen + 8) mod 8))"/>
Daniel Veillard0b3d9b82003-11-17 11:51:30 +0000296 <pre class="programlisting">
Daniel Veillardc72f9fd2003-11-16 23:59:52 +0000297 <xsl:call-template name="dumptext">
298 <xsl:with-param name="text" select="return/@type"/>
299 </xsl:call-template>
300 <xsl:text>&#9;</xsl:text>
301 <a href="#{@name}"><xsl:value-of select="@name"/></a>
Daniel Veillard1a792412003-11-18 23:52:38 +0000302 <xsl:if test="$blen - 40 &lt; -8">
303 <xsl:text>&#9;</xsl:text>
304 </xsl:if>
305 <xsl:if test="$blen - 40 &lt; 0">
306 <xsl:text>&#9;</xsl:text>
307 </xsl:if>
Daniel Veillardc72f9fd2003-11-16 23:59:52 +0000308 <xsl:text>&#9;(</xsl:text>
Daniel Veillard0b3d9b82003-11-17 11:51:30 +0000309 <xsl:if test="not(arg)">
310 <xsl:text>void</xsl:text>
311 </xsl:if>
Daniel Veillardc72f9fd2003-11-16 23:59:52 +0000312 <xsl:for-each select="arg">
313 <xsl:call-template name="dumptext">
314 <xsl:with-param name="text" select="@type"/>
315 </xsl:call-template>
316 <xsl:text> </xsl:text>
317 <xsl:value-of select="@name"/>
318 <xsl:if test="position() != last()">
Daniel Veillard1a792412003-11-18 23:52:38 +0000319 <xsl:text>, </xsl:text><br/>
320 <xsl:if test="$blen - 40 &gt; 8">
321 <xsl:text>&#9;</xsl:text>
322 </xsl:if>
323 <xsl:if test="$blen - 40 &gt; 0">
324 <xsl:text>&#9;</xsl:text>
325 </xsl:if>
326 <xsl:text>&#9;&#9;&#9;&#9;&#9; </xsl:text>
Daniel Veillardc72f9fd2003-11-16 23:59:52 +0000327 </xsl:if>
328 </xsl:for-each>
Daniel Veillard1a792412003-11-18 23:52:38 +0000329 <xsl:text>)</xsl:text>
330 </pre><xsl:text>
Daniel Veillardc72f9fd2003-11-16 23:59:52 +0000331</xsl:text>
Daniel Veillard0b3d9b82003-11-17 11:51:30 +0000332 </xsl:template>
333
334 <xsl:template match="functype" mode="toc">
Daniel Veillard0b3d9b82003-11-17 11:51:30 +0000335 <xsl:variable name="name" select="string(@name)"/>
Daniel Veillard1a792412003-11-18 23:52:38 +0000336 <xsl:variable name="nlen" select="string-length($name)"/>
337 <xsl:variable name="tlen" select="string-length(return/@type)"/>
338 <xsl:variable name="blen" select="(($nlen + 8) - (($nlen + 8) mod 8)) + (($tlen + 8) - (($tlen + 8) mod 8))"/>
339 <pre class="programlisting">
340 <xsl:text>Function type: </xsl:text>
341 <a href="#{$name}"><xsl:value-of select="$name"/></a>
342 <xsl:text>
343</xsl:text>
344 <xsl:call-template name="dumptext">
345 <xsl:with-param name="text" select="return/@type"/>
346 </xsl:call-template>
347 <xsl:text>&#9;</xsl:text>
348 <a href="#{$name}"><xsl:value-of select="$name"/></a>
349 <xsl:if test="$blen - 40 &lt; -8">
350 <xsl:text>&#9;</xsl:text>
351 </xsl:if>
352 <xsl:if test="$blen - 40 &lt; 0">
353 <xsl:text>&#9;</xsl:text>
354 </xsl:if>
355 <xsl:text>&#9;(</xsl:text>
356 <xsl:if test="not(arg)">
357 <xsl:text>void</xsl:text>
358 </xsl:if>
359 <xsl:for-each select="arg">
360 <xsl:call-template name="dumptext">
361 <xsl:with-param name="text" select="@type"/>
362 </xsl:call-template>
363 <xsl:text> </xsl:text>
364 <xsl:value-of select="@name"/>
365 <xsl:if test="position() != last()">
366 <xsl:text>, </xsl:text><br/>
367 <xsl:if test="$blen - 40 &gt; 8">
368 <xsl:text>&#9;</xsl:text>
369 </xsl:if>
370 <xsl:if test="$blen - 40 &gt; 0">
371 <xsl:text>&#9;</xsl:text>
372 </xsl:if>
373 <xsl:text>&#9;&#9;&#9;&#9;&#9; </xsl:text>
374 </xsl:if>
375 </xsl:for-each>
376 <xsl:text>)
377</xsl:text>
378 </pre>
379 <xsl:text>
380</xsl:text>
381 </xsl:template>
382
383 <xsl:template match="functype">
384 <xsl:variable name="name" select="string(@name)"/>
385 <xsl:variable name="nlen" select="string-length($name)"/>
386 <xsl:variable name="tlen" select="string-length(return/@type)"/>
387 <xsl:variable name="blen" select="(($nlen + 8) - (($nlen + 8) mod 8)) + (($tlen + 8) - (($tlen + 8) mod 8))"/>
388 <h3>
389 <a name="{$name}"></a>
390 <xsl:text>Function type: </xsl:text>
391 <xsl:value-of select="$name"/>
392 </h3>
393 <pre class="programlisting">
Daniel Veillard0b3d9b82003-11-17 11:51:30 +0000394 <xsl:text>Function type: </xsl:text>
395 <xsl:value-of select="$name"/>
396 <xsl:text>
397</xsl:text>
398 <xsl:call-template name="dumptext">
399 <xsl:with-param name="text" select="return/@type"/>
400 </xsl:call-template>
401 <xsl:text>&#9;</xsl:text>
402 <xsl:value-of select="@name"/>
Daniel Veillard1a792412003-11-18 23:52:38 +0000403 <xsl:if test="$blen - 40 &lt; -8">
404 <xsl:text>&#9;</xsl:text>
405 </xsl:if>
406 <xsl:if test="$blen - 40 &lt; 0">
407 <xsl:text>&#9;</xsl:text>
408 </xsl:if>
Daniel Veillard0b3d9b82003-11-17 11:51:30 +0000409 <xsl:text>&#9;(</xsl:text>
410 <xsl:if test="not(arg)">
411 <xsl:text>void</xsl:text>
412 </xsl:if>
413 <xsl:for-each select="arg">
414 <xsl:call-template name="dumptext">
415 <xsl:with-param name="text" select="@type"/>
416 </xsl:call-template>
417 <xsl:text> </xsl:text>
418 <xsl:value-of select="@name"/>
419 <xsl:if test="position() != last()">
Daniel Veillard1a792412003-11-18 23:52:38 +0000420 <xsl:text>, </xsl:text><br/>
421 <xsl:if test="$blen - 40 &gt; 8">
422 <xsl:text>&#9;</xsl:text>
423 </xsl:if>
424 <xsl:if test="$blen - 40 &gt; 0">
425 <xsl:text>&#9;</xsl:text>
426 </xsl:if>
427 <xsl:text>&#9;&#9;&#9;&#9;&#9; </xsl:text>
Daniel Veillard0b3d9b82003-11-17 11:51:30 +0000428 </xsl:if>
429 </xsl:for-each>
430 <xsl:text>)
431</xsl:text>
432 </pre>
433 <p>
434 <xsl:call-template name="dumptext">
435 <xsl:with-param name="text" select="info"/>
436 </xsl:call-template>
Daniel Veillard2925c0a2003-11-17 13:58:17 +0000437 </p>
Daniel Veillard0b3d9b82003-11-17 11:51:30 +0000438 <xsl:if test="arg | return">
439 <div class="variablelist"><table border="0"><col align="left"/><tbody>
440 <xsl:for-each select="arg">
441 <tr>
442 <td><span class="term"><i><tt><xsl:value-of select="@name"/></tt></i>:</span></td>
Daniel Veillard2925c0a2003-11-17 13:58:17 +0000443 <td>
444 <xsl:call-template name="dumptext">
445 <xsl:with-param name="text" select="@info"/>
446 </xsl:call-template>
447 </td>
Daniel Veillard0b3d9b82003-11-17 11:51:30 +0000448 </tr>
449 </xsl:for-each>
450 <xsl:if test="return/@info">
451 <tr>
452 <td><span class="term"><i><tt>Returns</tt></i>:</span></td>
Daniel Veillard2925c0a2003-11-17 13:58:17 +0000453 <td>
454 <xsl:call-template name="dumptext">
455 <xsl:with-param name="text" select="return/@info"/>
456 </xsl:call-template>
457 </td>
Daniel Veillard0b3d9b82003-11-17 11:51:30 +0000458 </tr>
459 </xsl:if>
460 </tbody></table></div>
461 </xsl:if>
Daniel Veillard2925c0a2003-11-17 13:58:17 +0000462 <br/>
463 <xsl:text>
464</xsl:text>
Daniel Veillardc72f9fd2003-11-16 23:59:52 +0000465 </xsl:template>
466
467 <xsl:template match="function">
468 <xsl:variable name="name" select="string(@name)"/>
Daniel Veillard1a792412003-11-18 23:52:38 +0000469 <xsl:variable name="nlen" select="string-length($name)"/>
470 <xsl:variable name="tlen" select="string-length(return/@type)"/>
471 <xsl:variable name="blen" select="(($nlen + 8) - (($nlen + 8) mod 8)) + (($tlen + 8) - (($tlen + 8) mod 8))"/>
Daniel Veillardc72f9fd2003-11-16 23:59:52 +0000472 <h3><a name="{$name}"></a>Function: <xsl:value-of select="$name"/></h3>
473 <pre class="programlisting">
474 <xsl:call-template name="dumptext">
475 <xsl:with-param name="text" select="return/@type"/>
476 </xsl:call-template>
477 <xsl:text>&#9;</xsl:text>
478 <xsl:value-of select="@name"/>
Daniel Veillard1a792412003-11-18 23:52:38 +0000479 <xsl:if test="$blen - 40 &lt; -8">
480 <xsl:text>&#9;</xsl:text>
481 </xsl:if>
482 <xsl:if test="$blen - 40 &lt; 0">
483 <xsl:text>&#9;</xsl:text>
484 </xsl:if>
Daniel Veillardc72f9fd2003-11-16 23:59:52 +0000485 <xsl:text>&#9;(</xsl:text>
Daniel Veillard0b3d9b82003-11-17 11:51:30 +0000486 <xsl:if test="not(arg)">
487 <xsl:text>void</xsl:text>
488 </xsl:if>
Daniel Veillardc72f9fd2003-11-16 23:59:52 +0000489 <xsl:for-each select="arg">
490 <xsl:call-template name="dumptext">
491 <xsl:with-param name="text" select="@type"/>
492 </xsl:call-template>
493 <xsl:text> </xsl:text>
494 <xsl:value-of select="@name"/>
495 <xsl:if test="position() != last()">
Daniel Veillard1a792412003-11-18 23:52:38 +0000496 <xsl:text>, </xsl:text><br/>
497 <xsl:if test="$blen - 40 &gt; 8">
498 <xsl:text>&#9;</xsl:text>
499 </xsl:if>
500 <xsl:if test="$blen - 40 &gt; 0">
501 <xsl:text>&#9;</xsl:text>
502 </xsl:if>
503 <xsl:text>&#9;&#9;&#9;&#9;&#9; </xsl:text>
Daniel Veillardc72f9fd2003-11-16 23:59:52 +0000504 </xsl:if>
505 </xsl:for-each>
506 <xsl:text>)</xsl:text><br/>
507 <xsl:text>
508</xsl:text>
509 </pre>
510 <p>
511 <xsl:call-template name="dumptext">
512 <xsl:with-param name="text" select="info"/>
513 </xsl:call-template>
514 </p><xsl:text>
515</xsl:text>
Daniel Veillard0b3d9b82003-11-17 11:51:30 +0000516 <xsl:if test="arg | return/@info">
517 <div class="variablelist"><table border="0"><col align="left"/><tbody>
518 <xsl:for-each select="arg">
519 <tr>
520 <td><span class="term"><i><tt><xsl:value-of select="@name"/></tt></i>:</span></td>
Daniel Veillard2925c0a2003-11-17 13:58:17 +0000521 <td>
522 <xsl:call-template name="dumptext">
523 <xsl:with-param name="text" select="@info"/>
524 </xsl:call-template>
525 </td>
Daniel Veillard0b3d9b82003-11-17 11:51:30 +0000526 </tr>
527 </xsl:for-each>
528 <xsl:if test="return/@info">
529 <tr>
530 <td><span class="term"><i><tt>Returns</tt></i>:</span></td>
Daniel Veillard2925c0a2003-11-17 13:58:17 +0000531 <td>
532 <xsl:call-template name="dumptext">
533 <xsl:with-param name="text" select="return/@info"/>
534 </xsl:call-template>
535 </td>
Daniel Veillard0b3d9b82003-11-17 11:51:30 +0000536 </tr>
537 </xsl:if>
538 </tbody></table></div>
Daniel Veillardc72f9fd2003-11-16 23:59:52 +0000539 </xsl:if>
Daniel Veillardc72f9fd2003-11-16 23:59:52 +0000540 </xsl:template>
541
542 <xsl:template match="exports" mode="toc">
Daniel Veillard2925c0a2003-11-17 13:58:17 +0000543 <xsl:apply-templates select="key('symbols', string(@symbol))[1]" mode="toc"/>
Daniel Veillardc72f9fd2003-11-16 23:59:52 +0000544 </xsl:template>
545
546 <xsl:template match="exports">
Daniel Veillard2925c0a2003-11-17 13:58:17 +0000547 <xsl:apply-templates select="key('symbols', string(@symbol))[1]"/>
Daniel Veillardc72f9fd2003-11-16 23:59:52 +0000548 </xsl:template>
549
Daniel Veillardbe586972003-11-18 20:56:51 +0000550 <xsl:template name="description">
551 <xsl:if test="deprecated">
552 <h2 style="font-weight:bold;color:red;text-align:center">This module is deprecated</h2>
553 </xsl:if>
554 <xsl:if test="description">
555 <p><xsl:value-of select="description"/></p>
556 </xsl:if>
557 </xsl:template>
558
William M. Brack7f40d132003-11-19 09:52:29 +0000559 <xsl:template name="docomponents">
560 <xsl:param name="mode"/>
561 <xsl:apply-templates select="exports[@type='macro']" mode="$mode">
562 <xsl:sort select='@symbol'/>
563 </xsl:apply-templates>
564 <xsl:apply-templates select="exports[@type='enum']" mode="$mode">
565 <xsl:sort select='@symbol'/>
566 </xsl:apply-templates>
567 <xsl:apply-templates select="exports[@type='typedef']" mode="$mode">
568 <xsl:sort select='@symbol'/>
569 </xsl:apply-templates>
570 <xsl:apply-templates select="exports[@type='struct']" mode="$mode">
571 <xsl:sort select='@symbol'/>
572 </xsl:apply-templates>
573 <xsl:apply-templates select="exports[@type='function']" mode="$mode">
574 <xsl:sort select='@symbol'/>
575 </xsl:apply-templates>
576 </xsl:template>
577
Daniel Veillardc72f9fd2003-11-16 23:59:52 +0000578 <xsl:template match="file">
579 <xsl:variable name="name" select="@name"/>
580 <xsl:variable name="title">Module <xsl:value-of select="$name"/> from <xsl:value-of select="/api/@name"/></xsl:variable>
581 <xsl:document href="{$htmldir}/libxml-{$name}.html" method="xml" encoding="ISO-8859-1"
582 doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
583 doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
584 <html>
585 <head>
586 <xsl:call-template name="style"/>
Daniel Veillarde8ba84e2003-11-18 13:54:15 +0000587 <xsl:call-template name="docstyle"/>
Daniel Veillardc72f9fd2003-11-16 23:59:52 +0000588 <title><xsl:value-of select="$title"/></title>
589 </head>
Daniel Veillard7a2c2ee2004-08-14 13:56:39 +0000590 <body bgcolor="#8b7765" text="#000000" link="#a06060" vlink="#000000">
Daniel Veillardc72f9fd2003-11-16 23:59:52 +0000591 <xsl:call-template name="titlebox">
592 <xsl:with-param name="title" select="$title"/>
593 </xsl:call-template>
594 <table border="0" cellpadding="4" cellspacing="0" width="100%" align="center">
595 <tr>
596 <td bgcolor="#8b7765">
597 <table border="0" cellspacing="0" cellpadding="2" width="100%">
598 <tr>
599 <td valign="top" width="200" bgcolor="#8b7765">
Daniel Veillarde8ba84e2003-11-18 13:54:15 +0000600 <xsl:call-template name="apitoc"/>
Daniel Veillardc72f9fd2003-11-16 23:59:52 +0000601 </td>
602 <td valign="top" bgcolor="#8b7765">
603 <table border="0" cellspacing="0" cellpadding="1" width="100%">
604 <tr>
605 <td>
606 <table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000">
607 <tr>
608 <td>
609 <table border="0" cellpadding="3" cellspacing="1" width="100%">
610 <tr>
611 <td bgcolor="#fffacd">
Daniel Veillardbff06bf2003-11-17 16:58:05 +0000612 <xsl:call-template name="navbar"/>
Daniel Veillardbe586972003-11-18 20:56:51 +0000613 <xsl:call-template name="description"/>
614 <xsl:choose>
615 <xsl:when test="deprecated">
616 <div class="deprecated">
617 <h2>Table of Contents</h2>
618 <xsl:apply-templates select="exports" mode="toc"/>
619 <h2>Description</h2>
620 <xsl:text>
Daniel Veillardc72f9fd2003-11-16 23:59:52 +0000621</xsl:text>
Daniel Veillardbe586972003-11-18 20:56:51 +0000622 <xsl:apply-templates select="exports"/>
623 </div>
624 </xsl:when>
625 <xsl:otherwise>
626 <h2>Table of Contents</h2>
Daniel Veillard1a792412003-11-18 23:52:38 +0000627 <xsl:apply-templates select="exports[@type='macro']" mode="toc">
628 <xsl:sort select='@symbol'/>
629 </xsl:apply-templates>
630 <xsl:apply-templates select="exports[@type='enum']" mode="toc">
631 <xsl:sort select='@symbol'/>
632 </xsl:apply-templates>
633 <xsl:apply-templates select="exports[@type='typedef']" mode="toc">
634 <xsl:sort select='@symbol'/>
635 </xsl:apply-templates>
636 <xsl:apply-templates select="exports[@type='struct']" mode="toc">
637 <xsl:sort select='@symbol'/>
638 </xsl:apply-templates>
639 <xsl:apply-templates select="exports[@type='function']" mode="toc">
640 <xsl:sort select='@symbol'/>
641 </xsl:apply-templates>
Daniel Veillardbe586972003-11-18 20:56:51 +0000642 <h2>Description</h2>
643 <xsl:text>
644</xsl:text>
William M. Brack7f40d132003-11-19 09:52:29 +0000645 <xsl:apply-templates select="exports[@type='macro']">
646 <xsl:sort select='@symbol'/>
647 </xsl:apply-templates>
648 <xsl:apply-templates select="exports[@type='enum']">
649 <xsl:sort select='@symbol'/>
650 </xsl:apply-templates>
651 <xsl:apply-templates select="exports[@type='typedef']">
652 <xsl:sort select='@symbol'/>
653 </xsl:apply-templates>
654 <xsl:apply-templates select="exports[@type='struct']">
655 <xsl:sort select='@symbol'/>
656 </xsl:apply-templates>
657 <xsl:apply-templates select="exports[@type='function']">
658 <xsl:sort select='@symbol'/>
659 </xsl:apply-templates>
Daniel Veillardbe586972003-11-18 20:56:51 +0000660 </xsl:otherwise>
661 </xsl:choose>
662 <p><a href="{$href_base}bugs.html">Daniel Veillard</a></p>
Daniel Veillardc72f9fd2003-11-16 23:59:52 +0000663 </td>
664 </tr>
665 </table>
666 </td>
667 </tr>
668 </table>
669 </td>
670 </tr>
671 </table>
672 </td>
673 </tr>
674 </table>
675 </td>
676 </tr>
677 </table>
678 </body>
679 </html>
680 </xsl:document>
681 </xsl:template>
682
683 <xsl:template match="file" mode="toc">
684 <xsl:variable name="name" select="@name"/>
Daniel Veillardbe586972003-11-18 20:56:51 +0000685 <li>
686 <a href="libxml-{$name}.html"><xsl:value-of select="$name"/></a>
687 <xsl:text>: </xsl:text>
688 <xsl:value-of select="summary"/>
689 </li>
Daniel Veillardc72f9fd2003-11-16 23:59:52 +0000690 </xsl:template>
691
Daniel Veillardbe586972003-11-18 20:56:51 +0000692 <xsl:template name="mainpage">
693 <xsl:param name="file" select="concat($htmldir, '/index.html')"/>
Daniel Veillardc72f9fd2003-11-16 23:59:52 +0000694 <xsl:variable name="title">Reference Manual for <xsl:value-of select="/api/@name"/></xsl:variable>
Daniel Veillardbe586972003-11-18 20:56:51 +0000695 <xsl:document href="{$file}" method="xml" encoding="ISO-8859-1"
Daniel Veillardc72f9fd2003-11-16 23:59:52 +0000696 doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
697 doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
698 <html>
699 <head>
700 <xsl:call-template name="style"/>
Daniel Veillarde8ba84e2003-11-18 13:54:15 +0000701 <xsl:call-template name="docstyle"/>
Daniel Veillardc72f9fd2003-11-16 23:59:52 +0000702 <title><xsl:value-of select="$title"/></title>
703 </head>
Daniel Veillard7a2c2ee2004-08-14 13:56:39 +0000704 <body bgcolor="#8b7765" text="#000000" link="#a06060" vlink="#000000">
Daniel Veillardc72f9fd2003-11-16 23:59:52 +0000705 <xsl:call-template name="titlebox">
706 <xsl:with-param name="title" select="$title"/>
707 </xsl:call-template>
708 <table border="0" cellpadding="4" cellspacing="0" width="100%" align="center">
709 <tr>
710 <td bgcolor="#8b7765">
711 <table border="0" cellspacing="0" cellpadding="2" width="100%">
712 <tr>
713 <td valign="top" width="200" bgcolor="#8b7765">
Daniel Veillarde8ba84e2003-11-18 13:54:15 +0000714 <xsl:call-template name="apitoc"/>
Daniel Veillardc72f9fd2003-11-16 23:59:52 +0000715 </td>
716 <td valign="top" bgcolor="#8b7765">
717 <table border="0" cellspacing="0" cellpadding="1" width="100%">
718 <tr>
719 <td>
720 <table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000">
721 <tr>
722 <td>
723 <table border="0" cellpadding="3" cellspacing="1" width="100%">
724 <tr>
725 <td bgcolor="#fffacd">
726 <h2>Table of Contents</h2>
727 <ul>
728 <xsl:apply-templates select="/api/files/file" mode="toc"/>
729 </ul>
Daniel Veillardbe586972003-11-18 20:56:51 +0000730 <p><a href="{$href_base}bugs.html">Daniel Veillard</a></p>
Daniel Veillardc72f9fd2003-11-16 23:59:52 +0000731 </td>
732 </tr>
733 </table>
734 </td>
735 </tr>
736 </table>
737 </td>
738 </tr>
739 </table>
740 </td>
741 </tr>
742 </table>
743 </td>
744 </tr>
745 </table>
746 </body>
747 </html>
748 </xsl:document>
Daniel Veillardbe586972003-11-18 20:56:51 +0000749 </xsl:template>
750
751 <xsl:template match="/">
752 <!-- Save the main index.html as well as a couple of copies -->
753 <xsl:call-template name="mainpage"/>
754 <xsl:call-template name="mainpage">
755 <xsl:with-param name="file" select="concat($htmldir, '/book1.html')"/>
756 </xsl:call-template>
757 <xsl:call-template name="mainpage">
758 <xsl:with-param name="file" select="concat($htmldir, '/libxml-lib.html')"/>
759 </xsl:call-template>
Daniel Veillardc72f9fd2003-11-16 23:59:52 +0000760 <!-- now build the file for each of the modules -->
761 <xsl:apply-templates select="/api/files/file"/>
762 </xsl:template>
763
764</xsl:stylesheet>