3 Stylesheet to generate the HTML documentation from an XML API descriptions:
4 xsltproc newapi.xsl libvirt-api.xml
8 <xsl:stylesheet version=
"1.0"
9 xmlns=
"http://www.w3.org/1999/xhtml"
10 xmlns:
html=
"http://www.w3.org/1999/xhtml"
11 xmlns:
xsl=
"http://www.w3.org/1999/XSL/Transform"
12 xmlns:
exsl=
"http://exslt.org/common"
13 xmlns:
str=
"http://exslt.org/strings"
14 extension-element-prefixes=
"exsl str"
15 exclude-result-prefixes=
"exsl str">
17 <!-- Import the main part of the site stylesheets -->
18 <xsl:import href=
"page.xsl"/>
20 <xsl:output method=
"xml" encoding=
"UTF-8" indent=
"yes"/>
22 <!-- Build keys for all symbols -->
23 <xsl:key name=
"symbols" match=
"/api/symbols/*" use=
"@name"/>
25 <xsl:param name=
"builddir" select=
"'..'"/>
27 <!-- the target directory for the HTML output -->
28 <xsl:variable name=
"htmldir">html
</xsl:variable>
29 <xsl:variable name=
"href_base">../
</xsl:variable>
31 <xsl:variable name=
"acls">
32 <xsl:copy-of select=
"document('{$builddir}/src/libvirt_access.xml')/aclinfo/api"/>
34 <xsl:variable name=
"qemuacls">
35 <xsl:copy-of select=
"document('{$builddir}/src/libvirt_access_qemu.xml')/aclinfo/api"/>
37 <xsl:variable name=
"lxcacls">
38 <xsl:copy-of select=
"document('{$builddir}/src/libvirt_access_lxc.xml')/aclinfo/api"/>
41 <xsl:template name=
"aclinfo">
42 <xsl:param name=
"api"/>
44 <xsl:if test=
"count(exsl:node-set($acls)/api[@name=$api]/check) > 0">
45 <h5>Access control parameter checks
</h5>
54 <xsl:apply-templates select=
"exsl:node-set($acls)/api[@name=$api]/check" mode=
"acl"/>
57 <xsl:if test=
"count(exsl:node-set($acls)/api[@name=$api]/filter) > 0">
58 <h5>Access control return value filters
</h5>
66 <xsl:apply-templates select=
"exsl:node-set($acls)/api[@name=$api]/filter" mode=
"acl"/>
71 <xsl:template match=
"check" mode=
"acl">
73 <td><a href=
"../acl.html#object_{@object}"><xsl:value-of select=
"@object"/></a></td>
74 <td><a href=
"../acl.html#perm_{@object}_{@perm}"><xsl:value-of select=
"@perm"/></a></td>
76 <xsl:when test=
"@flags">
77 <td><xsl:value-of select=
"@flags"/></td>
86 <xsl:template match=
"filter" mode=
"acl">
88 <td><xsl:value-of select=
"@object"/></td>
89 <td><xsl:value-of select=
"@perm"/></td>
94 <xsl:template name=
"navbar">
95 <xsl:variable name=
"previous" select=
"preceding-sibling::file[1]"/>
96 <xsl:variable name=
"next" select=
"following-sibling::file[1]"/>
97 <table class=
"navigation" width=
"100%" summary=
"Navigation header"
98 cellpadding=
"2" cellspacing=
"2">
100 <xsl:if test=
"$previous">
101 <td><a accesskey=
"p" href=
"libvirt-{$previous/@name}.html"><img src=
"left.png" width=
"24" height=
"24" border=
"0" alt=
"Prev"></img></a></td>
102 <th align=
"left"><a href=
"libvirt-{$previous/@name}.html"><xsl:value-of select=
"$previous/@name"/></a></th>
104 <td><a accesskey=
"u" href=
"index.html"><img src=
"up.png" width=
"24" height=
"24" border=
"0" alt=
"Up"></img></a></td>
105 <th align=
"left"><a href=
"index.html">API documentation
</a></th>
106 <td><a accesskey=
"h" href=
"../index.html"><img src=
"home.png" width=
"24" height=
"24" border=
"0" alt=
"Home"></img></a></td>
107 <th align=
"center"><a href=
"../index.html">The virtualization API
</a></th>
108 <xsl:if test=
"$next">
109 <th align=
"right"><a href=
"libvirt-{$next/@name}.html"><xsl:value-of select=
"$next/@name"/></a></th>
110 <td><a accesskey=
"n" href=
"libvirt-{$next/@name}.html"><img src=
"right.png" width=
"24" height=
"24" border=
"0" alt=
"Next"></img></a></td>
116 <!-- This is convoluted but needed to force the current document to
117 be the API one and not the result tree from the tokenize() result,
118 because the keys are only defined on the main document -->
119 <xsl:template mode=
"dumptoken" match='*'
>
120 <xsl:param name=
"token"/>
121 <xsl:variable name=
"stem" select=
"translate($token, '(),.:;@', '')"/>
122 <xsl:variable name=
"ref" select=
"key('symbols', $stem)"/>
124 <xsl:when test=
"$ref">
125 <xsl:value-of select=
"substring-before($token, $stem)"/>
126 <a href=
"libvirt-{$ref/@file}.html#{$ref/@name}"><xsl:value-of select=
"$stem"/></a>
127 <xsl:value-of select=
"substring-after($token, $stem)"/>
129 <xsl:when test=
"starts-with($token, 'http://')">
131 <xsl:value-of select=
"$token"/>
134 <xsl:when test=
"starts-with($token, '<http://') and contains($token, '>')">
135 <xsl:variable name=
"link"
136 select=
"substring(substring-before($token, '>'), 2)"/>
138 <xsl:value-of select=
"$link"/>
140 <xsl:value-of select=
"substring-after($token, '>')"/>
143 <xsl:value-of select=
"$token"/>
148 <!-- dumps a string, making cross-reference links -->
149 <xsl:template name=
"dumptext">
150 <xsl:param name=
"text"/>
151 <xsl:variable name=
"ctxt" select='.'
/>
152 <!-- <xsl:value-of select="$text"/> -->
153 <xsl:for-each select=
"str:tokenize($text, ' 	 ')">
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>
164 <!-- process blocks of text. blocks are separated by two consecutive line -->
167 <!-- blocks indented with at least 2 spaces are considered code blocks. -->
169 <!-- consecutive code blocks are collapsed into a single code block. -->
170 <xsl:template name=
"formatblock">
171 <xsl:param name=
"block"/>
172 <xsl:param name=
"rest"/>
174 <xsl:variable name=
"multipleCodeBlocks"
175 select=
"starts-with($block, ' ') and starts-with($rest, ' ')"/>
178 <xsl:when test=
"$multipleCodeBlocks">
179 <xsl:call-template name=
"formatblock">
180 <xsl:with-param name=
"block">
182 <xsl:when test=
"contains($rest, '

')">
183 <xsl:value-of select=
"concat($block, '
 
',
184 substring-before($rest, '

'))" />
187 <xsl:value-of select=
"concat($block, '
 
', $rest)" />
191 <xsl:with-param name=
"rest" select=
"substring-after($rest, '

')"/>
194 <xsl:when test=
"starts-with($block, ' ')">
195 <pre class=
"code"><xsl:for-each select=
"str:tokenize($block, '
')">
197 <xsl:when test=
"starts-with(., ' ')">
198 <xsl:value-of select=
"substring(., 3)"/>
201 <xsl:value-of select=
"."/>
204 <xsl:if test=
"position() != last()">
205 <xsl:text>
</xsl:text>
207 </xsl:for-each></pre>
211 <xsl:call-template name=
"dumptext">
212 <xsl:with-param name=
"text" select=
"$block"/>
217 <xsl:if test=
"not($multipleCodeBlocks)">
218 <xsl:call-template name=
"formattext">
219 <xsl:with-param name=
"text" select=
"$rest"/>
224 <xsl:template name=
"formattext">
225 <xsl:param name=
"text" />
227 <xsl:if test=
"$text">
228 <xsl:variable name=
"head" select=
"substring-before($text, '

')"/>
229 <xsl:variable name=
"rest" select=
"substring-after($text, '

')"/>
231 <xsl:call-template name=
"formatblock">
232 <xsl:with-param name=
"block">
234 <xsl:when test=
"contains($text, '

')">
235 <xsl:value-of select=
"$head"/>
238 <xsl:value-of select=
"$text"/>
242 <xsl:with-param name=
"rest" select=
"$rest"/>
247 <xsl:template match=
"macro" mode=
"toc">
248 <span class=
"directive">#define
</span><xsl:text> </xsl:text>
249 <a href=
"#{@name}"><xsl:value-of select=
"@name"/></a>
254 <xsl:template match=
"variable" mode=
"toc">
256 <xsl:call-template name=
"dumptext">
257 <xsl:with-param name=
"text" select=
"string(@type)"/>
260 <xsl:text> </xsl:text>
261 <a name=
"{@name}"></a>
262 <xsl:value-of select=
"@name"/>
267 <xsl:template match=
"typedef" mode=
"toc">
268 <span class=
"keyword">typedef
</span>
269 <xsl:text> </xsl:text><xsl:variable name=
"name" select=
"string(@name)"/>
271 <xsl:when test=
"@type = 'enum'">
272 <span class=
"keyword">enum
</span><xsl:text> </xsl:text>
273 <a href=
"#{$name}"><xsl:value-of select=
"$name"/></a>
279 <xsl:call-template name=
"dumptext">
280 <xsl:with-param name=
"text" select=
"@type"/>
283 <xsl:text> </xsl:text>
284 <a name=
"{$name}"><xsl:value-of select=
"$name"/></a>
291 <xsl:template name=
"enumvalue">
292 <xsl:param name=
"value" select=
"@value"/>
293 <xsl:param name=
"valuehex" select=
"@value_hex"/>
294 <xsl:param name=
"valuebitshift" select=
"@value_bitshift"/>
295 <xsl:value-of select=
"@value"/>
296 <xsl:if test=
"$valuehex != '' or $valuebitshift != ''">
297 <xsl:text> (
</xsl:text>
298 <xsl:if test=
"$valuehex != ''">
299 <xsl:value-of select=
"@value_hex"/>
301 <xsl:if test=
"$valuebitshift != ''">
302 <xsl:text>;
1 << </xsl:text>
303 <xsl:value-of select=
"@value_bitshift"/>
305 <xsl:text>)
</xsl:text>
309 <xsl:template match=
"typedef[@type = 'enum']">
310 <xsl:variable name=
"name" select=
"string(@name)"/>
311 <h3><a id=
"{$name}"><code><xsl:value-of select=
"$name"/></code></a></h3>
314 <span class=
"keyword">enum
</span><xsl:text> </xsl:text>
315 <xsl:value-of select=
"$name"/>
320 <xsl:for-each select=
"/api/symbols/enum[@type = $name]">
321 <xsl:sort select=
"@value" data-type=
"number" order=
"ascending"/>
323 <td><a name=
"{@name}"><xsl:value-of select=
"@name"/></a></td>
324 <td><xsl:text> =
</xsl:text></td>
326 <xsl:when test=
"@info != ''">
327 <td class=
"enumvalue"><xsl:call-template name=
"enumvalue"/></td>
329 <div class=
"comment">
330 <xsl:call-template name=
"dumptext">
331 <xsl:with-param name=
"text" select=
"@info"/>
337 <td colspan=
"2" class=
"enumvalue"><xsl:call-template name=
"enumvalue"/></td>
350 <xsl:template match=
"struct" mode=
"toc">
351 <span class=
"keyword">typedef
</span><xsl:text> </xsl:text>
352 <span class=
"type"><xsl:value-of select=
"@type"/></span>
353 <xsl:text> </xsl:text>
354 <a href=
"#{@name}"><xsl:value-of select=
"@name"/></a>
359 <xsl:template match=
"struct">
360 <h3><a id=
"{@name}"><code><xsl:value-of select=
"@name"/></code></a></h3>
363 <span class=
"keyword">struct
</span>
364 <xsl:value-of select=
"@name"/>
368 <xsl:if test=
"field">
370 <xsl:for-each select=
"field">
372 <xsl:when test='@type =
"union"'
>
373 <tr><td><span class=
"keyword">union
</span> {
</td></tr>
376 <xsl:for-each select=
"union/field">
380 <xsl:call-template name=
"dumptext">
381 <xsl:with-param name=
"text" select=
"@type"/>
385 <td><xsl:value-of select=
"@name"/></td>
386 <xsl:if test=
"@info != ''">
388 <div class=
"comment">
389 <xsl:call-template name=
"dumptext">
390 <xsl:with-param name=
"text" select=
"@info"/>
400 <td><xsl:value-of select=
"@name"/></td>
401 <xsl:if test=
"@info != ''">
403 <div class=
"comment">
404 <xsl:call-template name=
"dumptext">
405 <xsl:with-param name=
"text" select=
"@info"/>
416 <xsl:call-template name=
"dumptext">
417 <xsl:with-param name=
"text" select=
"@type"/>
421 <td><xsl:value-of select=
"@name"/></td>
422 <xsl:if test=
"@info != ''">
424 <div class=
"comment">
425 <xsl:call-template name=
"dumptext">
426 <xsl:with-param name=
"text" select=
"@info"/>
437 <xsl:if test=
"not(field)">
438 <div class=
"undisclosed">The content of this structure is not made public by the API
</div>
448 <xsl:template match=
"macro">
449 <xsl:variable name=
"name" select=
"string(@name)"/>
450 <h3><a id=
"{$name}"><code><xsl:value-of select=
"$name"/></code></a></h3>
451 <pre class=
"api"><span class=
"directive">#define
</span><xsl:text> </xsl:text><xsl:value-of select=
"$name"/></pre>
452 <div class=
"description">
453 <xsl:call-template name=
"formattext">
454 <xsl:with-param name=
"text" select=
"info"/>
460 <xsl:template match=
"function" mode=
"toc">
461 <xsl:variable name=
"name" select=
"string(@name)"/>
462 <xsl:variable name=
"nlen" select=
"string-length($name)"/>
463 <xsl:variable name=
"tlen" select=
"string-length(return/@type)"/>
464 <xsl:variable name=
"blen" select=
"(($nlen + 8) - (($nlen + 8) mod 8)) + (($tlen + 8) - (($tlen + 8) mod 8))"/>
466 <xsl:call-template name=
"dumptext">
467 <xsl:with-param name=
"text" select=
"return/@type"/>
470 <xsl:text>	</xsl:text>
471 <a href=
"#{@name}"><xsl:value-of select=
"@name"/></a>
472 <xsl:if test=
"$blen - 40 < -8">
473 <xsl:text>	</xsl:text>
475 <xsl:if test=
"$blen - 40 < 0">
476 <xsl:text>	</xsl:text>
478 <xsl:text>	(
</xsl:text>
479 <xsl:if test=
"not(arg)">
480 <span class=
"type">void
</span>
482 <xsl:for-each select=
"arg">
484 <xsl:call-template name=
"dumptext">
485 <xsl:with-param name=
"text" select=
"@type"/>
488 <xsl:text> </xsl:text>
489 <xsl:value-of select=
"@name"/>
490 <xsl:if test=
"position() != last()">
491 <xsl:text>,
</xsl:text><br/>
492 <xsl:if test=
"$blen - 40 > 8">
493 <xsl:text>	</xsl:text>
495 <xsl:if test=
"$blen - 40 > 0">
496 <xsl:text>	</xsl:text>
498 <xsl:text>					 </xsl:text>
505 <xsl:template match=
"functype" mode=
"toc">
506 <xsl:variable name=
"name" select=
"string(@name)"/>
507 <xsl:variable name=
"nlen" select=
"string-length($name)"/>
508 <xsl:variable name=
"tlen" select=
"string-length(return/@type)"/>
509 <xsl:variable name=
"blen" select=
"(($nlen + 8) - (($nlen + 8) mod 8)) + (($tlen + 8) - (($tlen + 8) mod 8))"/>
510 <span class=
"keyword">typedef
</span><xsl:text> </xsl:text>
511 <a href=
"#{$name}"><xsl:value-of select=
"$name"/></a>
515 <xsl:call-template name=
"dumptext">
516 <xsl:with-param name=
"text" select=
"return/@type"/>
519 <xsl:text>	</xsl:text>
520 <a href=
"#{$name}"><xsl:value-of select=
"$name"/></a>
521 <xsl:if test=
"$blen - 40 < -8">
522 <xsl:text>	</xsl:text>
524 <xsl:if test=
"$blen - 40 < 0">
525 <xsl:text>	</xsl:text>
527 <xsl:text>	(
</xsl:text>
528 <xsl:if test=
"not(arg)">
529 <span class=
"type">void
</span>
531 <xsl:for-each select=
"arg">
533 <xsl:call-template name=
"dumptext">
534 <xsl:with-param name=
"text" select=
"@type"/>
537 <xsl:text> </xsl:text>
538 <xsl:value-of select=
"@name"/>
539 <xsl:if test=
"position() != last()">
540 <xsl:text>,
</xsl:text><br/>
541 <xsl:if test=
"$blen - 40 > 8">
542 <xsl:text>	</xsl:text>
544 <xsl:if test=
"$blen - 40 > 0">
545 <xsl:text>	</xsl:text>
547 <xsl:text>					 </xsl:text>
556 <xsl:template match=
"functype">
557 <xsl:variable name=
"name" select=
"string(@name)"/>
558 <xsl:variable name=
"nlen" select=
"string-length($name)"/>
559 <xsl:variable name=
"tlen" select=
"string-length(return/@type)"/>
560 <xsl:variable name=
"blen" select=
"(($nlen + 8) - (($nlen + 8) mod 8)) + (($tlen + 8) - (($tlen + 8) mod 8))"/>
561 <h3><a id=
"{$name}"><code><xsl:value-of select=
"$name"/></code></a></h3>
563 <span class=
"keyword">typedef
</span><xsl:text> </xsl:text>
565 <xsl:call-template name=
"dumptext">
566 <xsl:with-param name=
"text" select=
"return/@type"/>
569 <xsl:text>	(*
</xsl:text>
570 <xsl:value-of select=
"@name"/>
571 <xsl:if test=
"$blen - 40 < -8">
572 <xsl:text>	</xsl:text>
574 <xsl:if test=
"$blen - 40 < 0">
575 <xsl:text>	</xsl:text>
577 <xsl:text>)
	(
</xsl:text>
578 <xsl:if test=
"not(arg)">
579 <span class=
"type">void
</span>
581 <xsl:for-each select=
"arg">
583 <xsl:call-template name=
"dumptext">
584 <xsl:with-param name=
"text" select=
"@type"/>
587 <xsl:text> </xsl:text>
588 <xsl:value-of select=
"@name"/>
589 <xsl:if test=
"position() != last()">
592 <xsl:if test=
"$blen - 40 > 8">
593 <xsl:text>	</xsl:text>
595 <xsl:if test=
"$blen - 40 > 0">
596 <xsl:text>	</xsl:text>
598 <xsl:text>					 </xsl:text>
604 <div class=
"description">
605 <xsl:call-template name=
"formattext">
606 <xsl:with-param name=
"text" select=
"info"/>
609 <xsl:if test=
"arg | return">
610 <dl class=
"variablelist">
611 <xsl:for-each select=
"arg">
612 <dt><xsl:value-of select=
"@name"/></dt>
614 <xsl:call-template name=
"dumptext">
615 <xsl:with-param name=
"text" select=
"@info"/>
619 <xsl:if test=
"return/@info">
622 <xsl:call-template name=
"dumptext">
623 <xsl:with-param name=
"text" select=
"return/@info"/>
634 <xsl:template match=
"function">
635 <xsl:variable name=
"name" select=
"string(@name)"/>
636 <xsl:variable name=
"nlen" select=
"string-length($name)"/>
637 <xsl:variable name=
"tlen" select=
"string-length(return/@type)"/>
638 <xsl:variable name=
"blen" select=
"(($nlen + 8) - (($nlen + 8) mod 8)) + (($tlen + 8) - (($tlen + 8) mod 8))"/>
639 <h3><a id=
"{$name}"><code><xsl:value-of select=
"$name"/></code></a></h3>
642 <xsl:call-template name=
"dumptext">
643 <xsl:with-param name=
"text" select=
"return/@type"/>
646 <xsl:text>	</xsl:text>
647 <xsl:value-of select=
"@name"/>
648 <xsl:if test=
"$blen - 40 < -8">
649 <xsl:text>	</xsl:text>
651 <xsl:if test=
"$blen - 40 < 0">
652 <xsl:text>	</xsl:text>
654 <xsl:text>	(
</xsl:text>
655 <xsl:if test=
"not(arg)">
656 <span class=
"type">void
</span>
658 <xsl:for-each select=
"arg">
660 <xsl:call-template name=
"dumptext">
661 <xsl:with-param name=
"text" select=
"@type"/>
664 <xsl:text> </xsl:text>
665 <xsl:value-of select=
"@name"/>
666 <xsl:if test=
"position() != last()">
669 <xsl:if test=
"$blen - 40 > 8">
670 <xsl:text>	</xsl:text>
672 <xsl:if test=
"$blen - 40 > 0">
673 <xsl:text>	</xsl:text>
675 <xsl:text>					 </xsl:text>
678 <xsl:text>)
</xsl:text>
680 <div class=
"description">
681 <xsl:call-template name=
"formattext">
682 <xsl:with-param name=
"text" select=
"info"/>
686 <xsl:if test=
"arg | return/@info">
687 <dl class=
"variablelist">
688 <xsl:for-each select=
"arg">
689 <dt><xsl:value-of select=
"@name"/></dt>
691 <xsl:call-template name=
"dumptext">
692 <xsl:with-param name=
"text" select=
"@info"/>
696 <xsl:if test=
"return/@info">
699 <xsl:call-template name=
"dumptext">
700 <xsl:with-param name=
"text" select=
"return/@info"/>
707 <xsl:call-template name=
"aclinfo">
708 <xsl:with-param name=
"api" select=
"$name"/>
713 <xsl:template match=
"exports" mode=
"toc">
714 <xsl:apply-templates select=
"key('symbols', string(@symbol))[1]" mode=
"toc"/>
717 <xsl:template match=
"exports">
718 <xsl:apply-templates select=
"key('symbols', string(@symbol))[1]"/>
721 <xsl:template name=
"description">
722 <xsl:if test=
"deprecated">
723 <h2 style=
"font-weight:bold;color:red;text-align:center">This module is deprecated
</h2>
725 <xsl:if test=
"description">
727 <xsl:call-template name=
"dumptext">
728 <xsl:with-param name=
"text" select=
"description"/>
734 <xsl:template name=
"docomponents">
735 <xsl:apply-templates select=
"exports[@type='macro']">
736 <xsl:sort select='@symbol'
/>
737 </xsl:apply-templates>
738 <xsl:apply-templates select=
"exports[@type='enum']">
739 <xsl:sort select='@symbol'
/>
740 </xsl:apply-templates>
741 <xsl:apply-templates select=
"exports[@type='typedef']">
742 <xsl:sort select='@symbol'
/>
743 </xsl:apply-templates>
744 <xsl:apply-templates select=
"exports[@type='struct']">
745 <xsl:sort select='@symbol'
/>
746 </xsl:apply-templates>
747 <xsl:apply-templates select=
"exports[@type='function']">
748 <xsl:sort select='@symbol'
/>
749 </xsl:apply-templates>
752 <xsl:template match=
"file">
753 <xsl:variable name=
"name" select=
"@name"/>
754 <xsl:variable name=
"title">Module
<xsl:value-of select=
"$name"/> from
<xsl:value-of select=
"/api/@name"/></xsl:variable>
755 <xsl:text disable-output-escaping=
"yes"><!DOCTYPE html
>
759 <h1><xsl:value-of select=
"$title"/></h1>
760 <xsl:call-template name=
"description"/>
761 <h2>Table of Contents
</h2>
762 <xsl:if test=
"count(exports[@type='macro']) > 0">
763 <h3><a href=
"#macros">Macros
</a></h3>
765 <xsl:apply-templates select=
"exports[@type='macro']" mode=
"toc">
766 <xsl:sort select='@symbol'
/>
767 </xsl:apply-templates>
770 <h3><a href=
"#types">Types
</a></h3>
772 <xsl:apply-templates select=
"exports[@type='typedef']" mode=
"toc">
773 <xsl:sort select='@symbol'
/>
774 </xsl:apply-templates>
776 <h3><a href=
"#functions">Functions
</a></h3>
778 <xsl:apply-templates select=
"exports[@type='function']" mode=
"toc">
779 <xsl:sort select='@symbol'
/>
780 </xsl:apply-templates>
785 <xsl:if test=
"count(exports[@type='macro']) > 0">
786 <h3><a id=
"macros">Macros
</a></h3>
787 <xsl:apply-templates select=
"exports[@type='macro']">
788 <xsl:sort select='@symbol'
/>
789 </xsl:apply-templates>
791 <h3><a id=
"types">Types
</a></h3>
792 <xsl:apply-templates select=
"exports[@type='typedef']">
793 <xsl:sort select='@symbol'
/>
794 </xsl:apply-templates>
795 <h3><a id=
"functions">Functions
</a></h3>
796 <xsl:apply-templates select=
"exports[@type='function']">
797 <xsl:sort select='@symbol'
/>
798 </xsl:apply-templates>
803 <xsl:template match=
"file" mode=
"toc">
804 <xsl:variable name=
"name" select=
"@name"/>
806 <a href=
"libvirt-{$name}.html"><xsl:value-of select=
"$name"/></a>
807 <xsl:text>:
</xsl:text>
808 <xsl:value-of select=
"summary"/>
812 <xsl:template name=
"mainpage">
813 <xsl:variable name=
"title">Reference Manual for
<xsl:value-of select=
"/api/@name"/></xsl:variable>
814 <xsl:text disable-output-escaping=
"yes"><!DOCTYPE html
>
818 <h1><xsl:value-of select=
"$title"/></h1>
819 <h2>Table of Contents
</h2>
821 <xsl:apply-templates select=
"/api/files/file" mode=
"toc"/>
827 <xsl:template match=
"/">
828 <!-- Save the main index.html as well as a couple of copies -->
829 <xsl:variable name=
"mainpage">
830 <xsl:call-template name=
"mainpage"/>
833 href=
"{concat($htmldir, '/index.html')}"
837 <xsl:apply-templates select=
"exsl:node-set($mainpage)" mode=
"page">
838 <xsl:with-param name=
"pagename" select=
"concat($htmldir, '/index.html')"/>
839 <xsl:with-param name=
"timestamp" select=
"$timestamp"/>
840 </xsl:apply-templates>
843 <xsl:for-each select=
"/api/files/file">
844 <xsl:variable name=
"subpage">
845 <xsl:apply-templates select=
"."/>
849 href=
"{concat($htmldir, '/libvirt-', @name, '.html')}"
853 <xsl:apply-templates select=
"exsl:node-set($subpage)" mode=
"page">
854 <xsl:with-param name=
"pagename" select=
"concat($htmldir, '/libvirt-', @name, '.html')"/>
855 <xsl:with-param name=
"timestamp" select=
"$timestamp"/>
856 </xsl:apply-templates>