wiki.xsl 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589
  1. <?xml version="1.0"?>
  2. <!--
  3. Stylesheet to generate the HTML documentation from an XML API descriptions:
  4. xsltproc wiki.xsl libxml2-api.xml
  5. Daniel Veillard
  6. -->
  7. <xsl:stylesheet version="1.0"
  8. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  9. xmlns:exsl="http://exslt.org/common"
  10. xmlns:str="http://exslt.org/strings"
  11. extension-element-prefixes="exsl str"
  12. exclude-result-prefixes="exsl str">
  13. <!-- Generate XHTML-1.0 transitional -->
  14. <xsl:output method="xml" encoding="ISO-8859-1" indent="yes"
  15. doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
  16. doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/>
  17. <!-- Build keys for all symbols -->
  18. <xsl:key name="symbols" match="/api/symbols/*" use="@name"/>
  19. <!-- the target directory for the HTML output -->
  20. <xsl:variable name="htmldir">wiki</xsl:variable>
  21. <xsl:variable name="href_base">../</xsl:variable>
  22. <xsl:template name="style">
  23. <link rel="SHORTCUT ICON" href="/favicon.ico"/>
  24. <style type="text/css">
  25. TD {font-family: Verdana,Arial,Helvetica}
  26. BODY {font-family: Verdana,Arial,Helvetica; margin-top: 2em; margin-left: 0em; margin-right: 0em}
  27. H1 {font-family: Verdana,Arial,Helvetica}
  28. H2 {font-family: Verdana,Arial,Helvetica}
  29. H3 {font-family: Verdana,Arial,Helvetica}
  30. A:link, A:visited, A:active { text-decoration: underline }
  31. </style>
  32. </xsl:template>
  33. <xsl:template name="docstyle">
  34. <style type="text/css">
  35. div.deprecated pre.programlisting {border-style: double;border-color:red}
  36. pre.programlisting {border-style: double;}
  37. </style>
  38. </xsl:template>
  39. <!-- This is convoluted but needed to force the current document to
  40. be the API one and not the result tree from the tokenize() result,
  41. because the keys are only defined on the main document -->
  42. <xsl:template mode="dumptoken" match='*'>
  43. <xsl:param name="token"/>
  44. <xsl:variable name="ref" select="key('symbols', $token)"/>
  45. <xsl:choose>
  46. <xsl:when test="$ref">
  47. <a href="libxml-{$ref/@file}.html#{$ref/@name}"><xsl:value-of select="$token"/></a>
  48. </xsl:when>
  49. <xsl:otherwise>
  50. <xsl:value-of select="$token"/>
  51. </xsl:otherwise>
  52. </xsl:choose>
  53. </xsl:template>
  54. <!-- dumps a string, making cross-reference links -->
  55. <xsl:template name="dumptext">
  56. <xsl:param name="text"/>
  57. <xsl:variable name="ctxt" select='.'/>
  58. <!-- <xsl:value-of select="$text"/> -->
  59. <xsl:for-each select="str:tokenize($text, ' &#9;')">
  60. <xsl:apply-templates select="$ctxt" mode='dumptoken'>
  61. <xsl:with-param name="token" select="string(.)"/>
  62. </xsl:apply-templates>
  63. <xsl:if test="position() != last()">
  64. <xsl:text> </xsl:text>
  65. </xsl:if>
  66. </xsl:for-each>
  67. </xsl:template>
  68. <xsl:template match="macro" mode="toc">
  69. <pre class="programlisting">
  70. <xsl:text>#define </xsl:text><a href="#{@name}"><xsl:value-of select="@name"/></a>
  71. </pre>
  72. </xsl:template>
  73. <xsl:template match="variable" mode="toc">
  74. <pre class="programlisting">
  75. <xsl:text>Variable </xsl:text>
  76. <xsl:call-template name="dumptext">
  77. <xsl:with-param name="text" select="string(@type)"/>
  78. </xsl:call-template>
  79. <xsl:text> </xsl:text>
  80. <a name="{@name}"></a>
  81. <xsl:value-of select="@name"/>
  82. <xsl:text>
  83. </xsl:text>
  84. </pre>
  85. </xsl:template>
  86. <xsl:template match="typedef" mode="toc">
  87. <xsl:variable name="name" select="string(@name)"/>
  88. <pre class="programlisting">
  89. <xsl:choose>
  90. <xsl:when test="@type = 'enum'">
  91. <xsl:text>Enum </xsl:text>
  92. <a href="#{$name}"><xsl:value-of select="$name"/></a>
  93. <xsl:text>
  94. </xsl:text>
  95. </xsl:when>
  96. <xsl:otherwise>
  97. <xsl:text>Typedef </xsl:text>
  98. <xsl:call-template name="dumptext">
  99. <xsl:with-param name="text" select="@type"/>
  100. </xsl:call-template>
  101. <xsl:text> </xsl:text>
  102. <a name="{$name}"><xsl:value-of select="$name"/></a>
  103. <xsl:text>
  104. </xsl:text>
  105. </xsl:otherwise>
  106. </xsl:choose>
  107. </pre>
  108. </xsl:template>
  109. <xsl:template match="typedef[@type = 'enum']">
  110. <xsl:variable name="name" select="string(@name)"/>
  111. <h3>Enum <a name="{$name}"><xsl:value-of select="$name"/></a></h3>
  112. <pre class="programlisting">
  113. <xsl:text>Enum </xsl:text>
  114. <xsl:value-of select="$name"/>
  115. <xsl:text> {
  116. </xsl:text>
  117. <xsl:for-each select="/api/symbols/enum[@type = $name]">
  118. <xsl:sort select="@value" data-type="number" order="ascending"/>
  119. <xsl:text> </xsl:text>
  120. <a name="{@name}"><xsl:value-of select="@name"/></a>
  121. <xsl:text> = </xsl:text>
  122. <xsl:value-of select="@value"/>
  123. <xsl:if test="@info != ''">
  124. <xsl:text> : </xsl:text>
  125. <xsl:call-template name="dumptext">
  126. <xsl:with-param name="text" select="@info"/>
  127. </xsl:call-template>
  128. </xsl:if>
  129. <xsl:text>
  130. </xsl:text>
  131. </xsl:for-each>
  132. <xsl:text>}
  133. </xsl:text>
  134. </pre>
  135. </xsl:template>
  136. <xsl:template match="struct" mode="toc">
  137. <pre class="programlisting">
  138. <xsl:text>Structure </xsl:text><a href="#{@name}"><xsl:value-of select="@name"/></a><br/>
  139. <xsl:value-of select="@type"/><xsl:text>
  140. </xsl:text>
  141. <xsl:if test="not(field)">
  142. <xsl:text>The content of this structure is not made public by the API.
  143. </xsl:text>
  144. </xsl:if>
  145. </pre>
  146. </xsl:template>
  147. <xsl:template match="struct">
  148. <h3><a name="{@name}">Structure <xsl:value-of select="@name"/></a></h3>
  149. <pre class="programlisting">
  150. <xsl:text>Structure </xsl:text><xsl:value-of select="@name"/><br/>
  151. <xsl:value-of select="@type"/><xsl:text> {
  152. </xsl:text>
  153. <xsl:if test="not(field)">
  154. <xsl:text>The content of this structure is not made public by the API.
  155. </xsl:text>
  156. </xsl:if>
  157. <xsl:for-each select="field">
  158. <xsl:text> </xsl:text>
  159. <xsl:call-template name="dumptext">
  160. <xsl:with-param name="text" select="@type"/>
  161. </xsl:call-template>
  162. <xsl:text>&#9;</xsl:text>
  163. <xsl:value-of select="@name"/>
  164. <xsl:if test="@info != ''">
  165. <xsl:text>&#9;: </xsl:text>
  166. <xsl:call-template name="dumptext">
  167. <xsl:with-param name="text" select="substring(@info, 1, 40)"/>
  168. </xsl:call-template>
  169. </xsl:if>
  170. <xsl:text>
  171. </xsl:text>
  172. </xsl:for-each>
  173. <xsl:text>}</xsl:text>
  174. </pre>
  175. </xsl:template>
  176. <xsl:template match="macro">
  177. <xsl:variable name="name" select="string(@name)"/>
  178. <h3><a name="{$name}"></a>Macro: <xsl:value-of select="$name"/></h3>
  179. <pre><xsl:text>#define </xsl:text><xsl:value-of select="$name"/></pre>
  180. <p>
  181. <xsl:call-template name="dumptext">
  182. <xsl:with-param name="text" select="info"/>
  183. </xsl:call-template>
  184. </p><xsl:text>
  185. </xsl:text>
  186. </xsl:template>
  187. <xsl:template match="function" mode="toc">
  188. <xsl:variable name="name" select="string(@name)"/>
  189. <xsl:variable name="nlen" select="string-length($name)"/>
  190. <xsl:variable name="tlen" select="string-length(return/@type)"/>
  191. <xsl:variable name="blen" select="(($nlen + 8) - (($nlen + 8) mod 8)) + (($tlen + 8) - (($tlen + 8) mod 8))"/>
  192. <pre class="programlisting">
  193. <xsl:call-template name="dumptext">
  194. <xsl:with-param name="text" select="return/@type"/>
  195. </xsl:call-template>
  196. <xsl:text>&#9;</xsl:text>
  197. <a href="#{@name}"><xsl:value-of select="@name"/></a>
  198. <xsl:if test="$blen - 40 &lt; -8">
  199. <xsl:text>&#9;</xsl:text>
  200. </xsl:if>
  201. <xsl:if test="$blen - 40 &lt; 0">
  202. <xsl:text>&#9;</xsl:text>
  203. </xsl:if>
  204. <xsl:text>&#9;(</xsl:text>
  205. <xsl:if test="not(arg)">
  206. <xsl:text>void</xsl:text>
  207. </xsl:if>
  208. <xsl:for-each select="arg">
  209. <xsl:call-template name="dumptext">
  210. <xsl:with-param name="text" select="@type"/>
  211. </xsl:call-template>
  212. <xsl:text> </xsl:text>
  213. <xsl:value-of select="@name"/>
  214. <xsl:if test="position() != last()">
  215. <xsl:text>, </xsl:text><br/>
  216. <xsl:if test="$blen - 40 &gt; 8">
  217. <xsl:text>&#9;</xsl:text>
  218. </xsl:if>
  219. <xsl:if test="$blen - 40 &gt; 0">
  220. <xsl:text>&#9;</xsl:text>
  221. </xsl:if>
  222. <xsl:text>&#9;&#9;&#9;&#9;&#9; </xsl:text>
  223. </xsl:if>
  224. </xsl:for-each>
  225. <xsl:text>)</xsl:text>
  226. </pre><xsl:text>
  227. </xsl:text>
  228. </xsl:template>
  229. <xsl:template match="functype" mode="toc">
  230. <xsl:variable name="name" select="string(@name)"/>
  231. <xsl:variable name="nlen" select="string-length($name)"/>
  232. <xsl:variable name="tlen" select="string-length(return/@type)"/>
  233. <xsl:variable name="blen" select="(($nlen + 8) - (($nlen + 8) mod 8)) + (($tlen + 8) - (($tlen + 8) mod 8))"/>
  234. <pre class="programlisting">
  235. <xsl:text>Function type: </xsl:text>
  236. <a href="#{$name}"><xsl:value-of select="$name"/></a>
  237. <xsl:text>
  238. </xsl:text>
  239. <xsl:call-template name="dumptext">
  240. <xsl:with-param name="text" select="return/@type"/>
  241. </xsl:call-template>
  242. <xsl:text>&#9;</xsl:text>
  243. <a href="#{$name}"><xsl:value-of select="$name"/></a>
  244. <xsl:if test="$blen - 40 &lt; -8">
  245. <xsl:text>&#9;</xsl:text>
  246. </xsl:if>
  247. <xsl:if test="$blen - 40 &lt; 0">
  248. <xsl:text>&#9;</xsl:text>
  249. </xsl:if>
  250. <xsl:text>&#9;(</xsl:text>
  251. <xsl:if test="not(arg)">
  252. <xsl:text>void</xsl:text>
  253. </xsl:if>
  254. <xsl:for-each select="arg">
  255. <xsl:call-template name="dumptext">
  256. <xsl:with-param name="text" select="@type"/>
  257. </xsl:call-template>
  258. <xsl:text> </xsl:text>
  259. <xsl:value-of select="@name"/>
  260. <xsl:if test="position() != last()">
  261. <xsl:text>, </xsl:text><br/>
  262. <xsl:if test="$blen - 40 &gt; 8">
  263. <xsl:text>&#9;</xsl:text>
  264. </xsl:if>
  265. <xsl:if test="$blen - 40 &gt; 0">
  266. <xsl:text>&#9;</xsl:text>
  267. </xsl:if>
  268. <xsl:text>&#9;&#9;&#9;&#9;&#9; </xsl:text>
  269. </xsl:if>
  270. </xsl:for-each>
  271. <xsl:text>)
  272. </xsl:text>
  273. </pre>
  274. <xsl:text>
  275. </xsl:text>
  276. </xsl:template>
  277. <xsl:template match="functype">
  278. <xsl:variable name="name" select="string(@name)"/>
  279. <xsl:variable name="nlen" select="string-length($name)"/>
  280. <xsl:variable name="tlen" select="string-length(return/@type)"/>
  281. <xsl:variable name="blen" select="(($nlen + 8) - (($nlen + 8) mod 8)) + (($tlen + 8) - (($tlen + 8) mod 8))"/>
  282. <h3>
  283. <a name="{$name}"></a>
  284. <xsl:text>Function type: </xsl:text>
  285. <xsl:value-of select="$name"/>
  286. </h3>
  287. <pre class="programlisting">
  288. <xsl:text>Function type: </xsl:text>
  289. <xsl:value-of select="$name"/>
  290. <xsl:text>
  291. </xsl:text>
  292. <xsl:call-template name="dumptext">
  293. <xsl:with-param name="text" select="return/@type"/>
  294. </xsl:call-template>
  295. <xsl:text>&#9;</xsl:text>
  296. <xsl:value-of select="@name"/>
  297. <xsl:if test="$blen - 40 &lt; -8">
  298. <xsl:text>&#9;</xsl:text>
  299. </xsl:if>
  300. <xsl:if test="$blen - 40 &lt; 0">
  301. <xsl:text>&#9;</xsl:text>
  302. </xsl:if>
  303. <xsl:text>&#9;(</xsl:text>
  304. <xsl:if test="not(arg)">
  305. <xsl:text>void</xsl:text>
  306. </xsl:if>
  307. <xsl:for-each select="arg">
  308. <xsl:call-template name="dumptext">
  309. <xsl:with-param name="text" select="@type"/>
  310. </xsl:call-template>
  311. <xsl:text> </xsl:text>
  312. <xsl:value-of select="@name"/>
  313. <xsl:if test="position() != last()">
  314. <xsl:text>, </xsl:text><br/>
  315. <xsl:if test="$blen - 40 &gt; 8">
  316. <xsl:text>&#9;</xsl:text>
  317. </xsl:if>
  318. <xsl:if test="$blen - 40 &gt; 0">
  319. <xsl:text>&#9;</xsl:text>
  320. </xsl:if>
  321. <xsl:text>&#9;&#9;&#9;&#9;&#9; </xsl:text>
  322. </xsl:if>
  323. </xsl:for-each>
  324. <xsl:text>)
  325. </xsl:text>
  326. </pre>
  327. <p>
  328. <xsl:call-template name="dumptext">
  329. <xsl:with-param name="text" select="info"/>
  330. </xsl:call-template>
  331. </p>
  332. <xsl:if test="arg | return">
  333. <div class="variablelist"><table border="0"><col align="left"/><tbody>
  334. <xsl:for-each select="arg">
  335. <tr>
  336. <td><span class="term"><i><tt><xsl:value-of select="@name"/></tt></i>:</span></td>
  337. <td>
  338. <xsl:call-template name="dumptext">
  339. <xsl:with-param name="text" select="@info"/>
  340. </xsl:call-template>
  341. </td>
  342. </tr>
  343. </xsl:for-each>
  344. <xsl:if test="return/@info">
  345. <tr>
  346. <td><span class="term"><i><tt>Returns</tt></i>:</span></td>
  347. <td>
  348. <xsl:call-template name="dumptext">
  349. <xsl:with-param name="text" select="return/@info"/>
  350. </xsl:call-template>
  351. </td>
  352. </tr>
  353. </xsl:if>
  354. </tbody></table></div>
  355. </xsl:if>
  356. <br/>
  357. <xsl:text>
  358. </xsl:text>
  359. </xsl:template>
  360. <xsl:template match="function">
  361. <xsl:variable name="name" select="string(@name)"/>
  362. <xsl:variable name="nlen" select="string-length($name)"/>
  363. <xsl:variable name="tlen" select="string-length(return/@type)"/>
  364. <xsl:variable name="blen" select="(($nlen + 8) - (($nlen + 8) mod 8)) + (($tlen + 8) - (($tlen + 8) mod 8))"/>
  365. <h3><a name="{$name}"></a>Function: <xsl:value-of select="$name"/></h3>
  366. <pre class="programlisting">
  367. <xsl:call-template name="dumptext">
  368. <xsl:with-param name="text" select="return/@type"/>
  369. </xsl:call-template>
  370. <xsl:text>&#9;</xsl:text>
  371. <xsl:value-of select="@name"/>
  372. <xsl:if test="$blen - 40 &lt; -8">
  373. <xsl:text>&#9;</xsl:text>
  374. </xsl:if>
  375. <xsl:if test="$blen - 40 &lt; 0">
  376. <xsl:text>&#9;</xsl:text>
  377. </xsl:if>
  378. <xsl:text>&#9;(</xsl:text>
  379. <xsl:if test="not(arg)">
  380. <xsl:text>void</xsl:text>
  381. </xsl:if>
  382. <xsl:for-each select="arg">
  383. <xsl:call-template name="dumptext">
  384. <xsl:with-param name="text" select="@type"/>
  385. </xsl:call-template>
  386. <xsl:text> </xsl:text>
  387. <xsl:value-of select="@name"/>
  388. <xsl:if test="position() != last()">
  389. <xsl:text>, </xsl:text><br/>
  390. <xsl:if test="$blen - 40 &gt; 8">
  391. <xsl:text>&#9;</xsl:text>
  392. </xsl:if>
  393. <xsl:if test="$blen - 40 &gt; 0">
  394. <xsl:text>&#9;</xsl:text>
  395. </xsl:if>
  396. <xsl:text>&#9;&#9;&#9;&#9;&#9; </xsl:text>
  397. </xsl:if>
  398. </xsl:for-each>
  399. <xsl:text>)</xsl:text><br/>
  400. <xsl:text>
  401. </xsl:text>
  402. </pre>
  403. <p>
  404. <xsl:call-template name="dumptext">
  405. <xsl:with-param name="text" select="info"/>
  406. </xsl:call-template>
  407. </p><xsl:text>
  408. </xsl:text>
  409. <xsl:if test="arg | return/@info">
  410. <div class="variablelist"><table border="0"><col align="left"/><tbody>
  411. <xsl:for-each select="arg">
  412. <tr>
  413. <td><span class="term"><i><tt><xsl:value-of select="@name"/></tt></i>:</span></td>
  414. <td>
  415. <xsl:call-template name="dumptext">
  416. <xsl:with-param name="text" select="@info"/>
  417. </xsl:call-template>
  418. </td>
  419. </tr>
  420. </xsl:for-each>
  421. <xsl:if test="return/@info">
  422. <tr>
  423. <td><span class="term"><i><tt>Returns</tt></i>:</span></td>
  424. <td>
  425. <xsl:call-template name="dumptext">
  426. <xsl:with-param name="text" select="return/@info"/>
  427. </xsl:call-template>
  428. </td>
  429. </tr>
  430. </xsl:if>
  431. </tbody></table></div>
  432. </xsl:if>
  433. </xsl:template>
  434. <xsl:template match="exports" mode="toc">
  435. <xsl:apply-templates select="key('symbols', string(@symbol))[1]" mode="toc"/>
  436. </xsl:template>
  437. <xsl:template match="exports">
  438. <xsl:apply-templates select="key('symbols', string(@symbol))[1]"/>
  439. </xsl:template>
  440. <xsl:template name="description">
  441. <xsl:if test="deprecated">
  442. <h2 style="font-weight:bold;color:red;text-align:center">This module is deprecated</h2>
  443. </xsl:if>
  444. <xsl:if test="description">
  445. <p><xsl:value-of select="description"/></p>
  446. </xsl:if>
  447. </xsl:template>
  448. <xsl:template name="docomponents">
  449. <xsl:param name="mode"/>
  450. <xsl:apply-templates select="exports[@type='macro']" mode="$mode">
  451. <xsl:sort select='@symbol'/>
  452. </xsl:apply-templates>
  453. <xsl:apply-templates select="exports[@type='enum']" mode="$mode">
  454. <xsl:sort select='@symbol'/>
  455. </xsl:apply-templates>
  456. <xsl:apply-templates select="exports[@type='typedef']" mode="$mode">
  457. <xsl:sort select='@symbol'/>
  458. </xsl:apply-templates>
  459. <xsl:apply-templates select="exports[@type='struct']" mode="$mode">
  460. <xsl:sort select='@symbol'/>
  461. </xsl:apply-templates>
  462. <xsl:apply-templates select="exports[@type='function']" mode="$mode">
  463. <xsl:sort select='@symbol'/>
  464. </xsl:apply-templates>
  465. </xsl:template>
  466. <xsl:template match="file">
  467. <xsl:variable name="name" select="@name"/>
  468. <xsl:variable name="title">Module <xsl:value-of select="$name"/> from <xsl:value-of select="/api/@name"/></xsl:variable>
  469. <xsl:document href="{$htmldir}/libxml-{$name}.html" method="xml" encoding="ISO-8859-1"
  470. doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
  471. doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  472. <xsl:call-template name="style"/>
  473. <xsl:call-template name="docstyle"/>
  474. <table border="0" cellpadding="3" cellspacing="1" width="100%">
  475. <tr>
  476. <td>
  477. <xsl:call-template name="description"/>
  478. <xsl:choose>
  479. <xsl:when test="deprecated">
  480. <div class="deprecated">
  481. <h2>Table of Contents</h2>
  482. <xsl:apply-templates select="exports" mode="toc"/>
  483. <h2>Description</h2>
  484. <xsl:text>
  485. </xsl:text>
  486. <xsl:apply-templates select="exports"/>
  487. </div>
  488. </xsl:when>
  489. <xsl:otherwise>
  490. <h2>Table of Contents</h2>
  491. <xsl:apply-templates select="exports[@type='macro']" mode="toc">
  492. <xsl:sort select='@symbol'/>
  493. </xsl:apply-templates>
  494. <xsl:apply-templates select="exports[@type='enum']" mode="toc">
  495. <xsl:sort select='@symbol'/>
  496. </xsl:apply-templates>
  497. <xsl:apply-templates select="exports[@type='typedef']" mode="toc">
  498. <xsl:sort select='@symbol'/>
  499. </xsl:apply-templates>
  500. <xsl:apply-templates select="exports[@type='struct']" mode="toc">
  501. <xsl:sort select='@symbol'/>
  502. </xsl:apply-templates>
  503. <xsl:apply-templates select="exports[@type='function']" mode="toc">
  504. <xsl:sort select='@symbol'/>
  505. </xsl:apply-templates>
  506. <h2>Description</h2>
  507. <xsl:text>
  508. </xsl:text>
  509. <xsl:apply-templates select="exports[@type='macro']">
  510. <xsl:sort select='@symbol'/>
  511. </xsl:apply-templates>
  512. <xsl:apply-templates select="exports[@type='enum']">
  513. <xsl:sort select='@symbol'/>
  514. </xsl:apply-templates>
  515. <xsl:apply-templates select="exports[@type='typedef']">
  516. <xsl:sort select='@symbol'/>
  517. </xsl:apply-templates>
  518. <xsl:apply-templates select="exports[@type='struct']">
  519. <xsl:sort select='@symbol'/>
  520. </xsl:apply-templates>
  521. <xsl:apply-templates select="exports[@type='function']">
  522. <xsl:sort select='@symbol'/>
  523. </xsl:apply-templates>
  524. </xsl:otherwise>
  525. </xsl:choose>
  526. </td>
  527. </tr>
  528. </table>
  529. </xsl:document>
  530. </xsl:template>
  531. <xsl:template match="file" mode="toc">
  532. <xsl:variable name="name" select="@name"/>
  533. <b><a href="http://xmlsoft.org/wiki/index.php?title=Libxml2:Api:{$name}"><xsl:value-of select="$name"/></a></b><br/>
  534. <xsl:value-of select="summary"/>
  535. <br/><br/>
  536. </xsl:template>
  537. <xsl:template name="mainpage">
  538. <xsl:param name="file" select="concat($htmldir, '/libxml-index.html')"/>
  539. <xsl:variable name="title">Reference Manual for <xsl:value-of select="/api/@name"/></xsl:variable>
  540. <xsl:document href="{$file}" method="xml" encoding="ISO-8859-1"
  541. doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
  542. doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  543. <xsl:call-template name="style"/>
  544. <xsl:call-template name="docstyle"/>
  545. <table border="0" cellpadding="3" cellspacing="1" width="100%">
  546. <tr>
  547. <td>
  548. <xsl:apply-templates select="/api/files/file" mode="toc"/>
  549. </td>
  550. </tr>
  551. </table>
  552. </xsl:document>
  553. </xsl:template>
  554. <xsl:template match="/">
  555. <!-- Save the main libxml-index.html as well as a couple of copies -->
  556. <xsl:call-template name="mainpage"/>
  557. <!-- now build the file for each of the modules -->
  558. <xsl:apply-templates select="/api/files/file"/>
  559. </xsl:template>
  560. </xsl:stylesheet>