newapi.xsl 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766
  1. <?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. 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. <!-- Import the main part of the site stylesheets -->
  14. <xsl:import href="site.xsl"/>
  15. <!-- Generate XHTML-1.0 transitional -->
  16. <xsl:output method="xml" encoding="ISO-8859-1" indent="yes"
  17. doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
  18. doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/>
  19. <!-- Build keys for all symbols -->
  20. <xsl:key name="symbols" match="/api/symbols/*" use="@name"/>
  21. <!-- the target directory for the HTML output -->
  22. <xsl:variable name="htmldir">html</xsl:variable>
  23. <xsl:variable name="href_base">../</xsl:variable>
  24. <!-- The table of content for the HTML API pages -->
  25. <xsl:variable name="menu_name">API Menu</xsl:variable>
  26. <xsl:variable name="apitoc">
  27. <form action="../search.php"
  28. enctype="application/x-www-form-urlencoded" method="get">
  29. <input name="query" type="text" size="20" value=""/>
  30. <input name="submit" type="submit" value="Search ..."/>
  31. </form>
  32. <ul><!-- style="margin-left: -1em" -->
  33. <li><a style="font-weight:bold"
  34. href="{$href_base}index.html">Main Menu</a></li>
  35. <li><a style="font-weight:bold"
  36. href="{$href_base}docs.html">Developer Menu</a></li>
  37. <li><a style="font-weight:bold"
  38. href="{$href_base}examples/index.html">Code Examples</a></li>
  39. <li><a style="font-weight:bold"
  40. href="index.html">API Menu</a></li>
  41. <li><a href="libxml-parser.html">Parser API</a></li>
  42. <li><a href="libxml-tree.html">Tree API</a></li>
  43. <li><a href="libxml-xmlreader.html">Reader API</a></li>
  44. <li><a href="{$href_base}guidelines.html">XML Guidelines</a></li>
  45. <li><a href="{$href_base}ChangeLog.html">ChangeLog</a></li>
  46. </ul>
  47. </xsl:variable>
  48. <xsl:template name="apitoc">
  49. <table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000">
  50. <tr>
  51. <td>
  52. <table width="100%" border="0" cellspacing="1" cellpadding="3">
  53. <tr>
  54. <td colspan="1" bgcolor="#eecfa1" align="center">
  55. <center>
  56. <b><xsl:value-of select="$menu_name"/></b>
  57. </center>
  58. </td>
  59. </tr>
  60. <tr>
  61. <td bgcolor="#fffacd">
  62. <xsl:copy-of select="$apitoc"/>
  63. </td>
  64. </tr>
  65. </table>
  66. <table width="100%" border="0" cellspacing="1" cellpadding="3">
  67. <tr>
  68. <td colspan="1" bgcolor="#eecfa1" align="center">
  69. <center>
  70. <b>API Indexes</b>
  71. </center>
  72. </td>
  73. </tr>
  74. <tr>
  75. <td bgcolor="#fffacd">
  76. <xsl:copy-of select="$api"/>
  77. </td>
  78. </tr>
  79. </table>
  80. <table width="100%" border="0" cellspacing="1" cellpadding="3">
  81. <tr>
  82. <td colspan="1" bgcolor="#eecfa1" align="center">
  83. <center>
  84. <b>Related links</b>
  85. </center>
  86. </td>
  87. </tr>
  88. <tr>
  89. <td bgcolor="#fffacd">
  90. <xsl:copy-of select="$related"/>
  91. </td>
  92. </tr>
  93. </table>
  94. </td>
  95. </tr>
  96. </table>
  97. </xsl:template>
  98. <xsl:template name="docstyle">
  99. <style type="text/css">
  100. div.deprecated pre.programlisting {border-style: double;border-color:red}
  101. pre.programlisting {border-style: double;background: #EECFA1}
  102. </style>
  103. </xsl:template>
  104. <xsl:template name="navbar">
  105. <xsl:variable name="previous" select="preceding-sibling::file[1]"/>
  106. <xsl:variable name="next" select="following-sibling::file[1]"/>
  107. <table class="navigation" width="100%" summary="Navigation header"
  108. cellpadding="2" cellspacing="2">
  109. <tr valign="middle">
  110. <xsl:if test="$previous">
  111. <td><a accesskey="p" href="libxml-{$previous/@name}.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></img></a></td>
  112. <th align="left"><a href="libxml-{$previous/@name}.html"><xsl:value-of select="$previous/@name"/></a></th>
  113. </xsl:if>
  114. <td><a accesskey="u" href="index.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></img></a></td>
  115. <th align="left"><a href="index.html">API documentation</a></th>
  116. <td><a accesskey="h" href="../index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></img></a></td>
  117. <th align="center"><a href="../index.html">The XML C parser and toolkit of Gnome</a></th>
  118. <xsl:if test="$next">
  119. <th align="right"><a href="libxml-{$next/@name}.html"><xsl:value-of select="$next/@name"/></a></th>
  120. <td><a accesskey="n" href="libxml-{$next/@name}.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></img></a></td>
  121. </xsl:if>
  122. </tr>
  123. </table>
  124. </xsl:template>
  125. <!-- This is convoluted but needed to force the current document to
  126. be the API one and not the result tree from the tokenize() result,
  127. because the keys are only defined on the main document -->
  128. <xsl:template mode="dumptoken" match='*'>
  129. <xsl:param name="token"/>
  130. <xsl:variable name="ref" select="key('symbols', $token)"/>
  131. <xsl:choose>
  132. <xsl:when test="$ref">
  133. <a href="libxml-{$ref/@file}.html#{$ref/@name}"><xsl:value-of select="$token"/></a>
  134. </xsl:when>
  135. <xsl:otherwise>
  136. <xsl:value-of select="$token"/>
  137. </xsl:otherwise>
  138. </xsl:choose>
  139. </xsl:template>
  140. <!-- dumps a string, making cross-reference links -->
  141. <xsl:template name="dumptext">
  142. <xsl:param name="text"/>
  143. <xsl:variable name="ctxt" select='.'/>
  144. <!-- <xsl:value-of select="$text"/> -->
  145. <xsl:for-each select="str:tokenize($text, ' &#9;')">
  146. <xsl:apply-templates select="$ctxt" mode='dumptoken'>
  147. <xsl:with-param name="token" select="string(.)"/>
  148. </xsl:apply-templates>
  149. <xsl:if test="position() != last()">
  150. <xsl:text> </xsl:text>
  151. </xsl:if>
  152. </xsl:for-each>
  153. </xsl:template>
  154. <xsl:template match="macro" mode="toc">
  155. <pre class="programlisting">
  156. <xsl:text>#define </xsl:text><a href="#{@name}"><xsl:value-of select="@name"/></a>
  157. </pre>
  158. </xsl:template>
  159. <xsl:template match="variable" mode="toc">
  160. <pre class="programlisting">
  161. <xsl:text>Variable </xsl:text>
  162. <xsl:call-template name="dumptext">
  163. <xsl:with-param name="text" select="string(@type)"/>
  164. </xsl:call-template>
  165. <xsl:text> </xsl:text>
  166. <a name="{@name}"></a>
  167. <xsl:value-of select="@name"/>
  168. <xsl:text>
  169. </xsl:text>
  170. </pre>
  171. </xsl:template>
  172. <xsl:template match="typedef" mode="toc">
  173. <xsl:variable name="name" select="string(@name)"/>
  174. <pre class="programlisting">
  175. <xsl:choose>
  176. <xsl:when test="@type = 'enum'">
  177. <xsl:text>Enum </xsl:text>
  178. <a href="#{$name}"><xsl:value-of select="$name"/></a>
  179. <xsl:text>
  180. </xsl:text>
  181. </xsl:when>
  182. <xsl:otherwise>
  183. <xsl:text>Typedef </xsl:text>
  184. <xsl:call-template name="dumptext">
  185. <xsl:with-param name="text" select="@type"/>
  186. </xsl:call-template>
  187. <xsl:text> </xsl:text>
  188. <a name="{$name}"><xsl:value-of select="$name"/></a>
  189. <xsl:text>
  190. </xsl:text>
  191. </xsl:otherwise>
  192. </xsl:choose>
  193. </pre>
  194. </xsl:template>
  195. <xsl:template match="typedef[@type = 'enum']">
  196. <xsl:variable name="name" select="string(@name)"/>
  197. <h3>Enum <a name="{$name}"><xsl:value-of select="$name"/></a></h3>
  198. <pre class="programlisting">
  199. <xsl:text>Enum </xsl:text>
  200. <xsl:value-of select="$name"/>
  201. <xsl:text> {
  202. </xsl:text>
  203. <xsl:for-each select="/api/symbols/enum[@type = $name]">
  204. <xsl:sort select="@value" data-type="number" order="ascending"/>
  205. <xsl:text> </xsl:text>
  206. <a name="{@name}"><xsl:value-of select="@name"/></a>
  207. <xsl:text> = </xsl:text>
  208. <xsl:value-of select="@value"/>
  209. <xsl:if test="@info != ''">
  210. <xsl:text> : </xsl:text>
  211. <xsl:call-template name="dumptext">
  212. <xsl:with-param name="text" select="@info"/>
  213. </xsl:call-template>
  214. </xsl:if>
  215. <xsl:text>
  216. </xsl:text>
  217. </xsl:for-each>
  218. <xsl:text>}
  219. </xsl:text>
  220. </pre>
  221. </xsl:template>
  222. <xsl:template match="struct" mode="toc">
  223. <pre class="programlisting">
  224. <xsl:text>Structure </xsl:text><a href="#{@name}"><xsl:value-of select="@name"/></a><br/>
  225. <xsl:value-of select="@type"/><xsl:text>
  226. </xsl:text>
  227. <xsl:if test="not(field)">
  228. <xsl:text>The content of this structure is not made public by the API.
  229. </xsl:text>
  230. </xsl:if>
  231. </pre>
  232. </xsl:template>
  233. <xsl:template match="struct">
  234. <h3><a name="{@name}">Structure <xsl:value-of select="@name"/></a></h3>
  235. <pre class="programlisting">
  236. <xsl:text>Structure </xsl:text><xsl:value-of select="@name"/><br/>
  237. <xsl:value-of select="@type"/><xsl:text> {
  238. </xsl:text>
  239. <xsl:if test="not(field)">
  240. <xsl:text>The content of this structure is not made public by the API.
  241. </xsl:text>
  242. </xsl:if>
  243. <xsl:for-each select="field">
  244. <xsl:text> </xsl:text>
  245. <xsl:call-template name="dumptext">
  246. <xsl:with-param name="text" select="@type"/>
  247. </xsl:call-template>
  248. <xsl:text>&#9;</xsl:text>
  249. <xsl:value-of select="@name"/>
  250. <xsl:if test="@info != ''">
  251. <xsl:text>&#9;: </xsl:text>
  252. <xsl:call-template name="dumptext">
  253. <xsl:with-param name="text" select="substring(@info, 1, 40)"/>
  254. </xsl:call-template>
  255. </xsl:if>
  256. <xsl:text>
  257. </xsl:text>
  258. </xsl:for-each>
  259. <xsl:text>}</xsl:text>
  260. </pre>
  261. </xsl:template>
  262. <xsl:template match="macro">
  263. <xsl:variable name="name" select="string(@name)"/>
  264. <h3><a name="{$name}"></a>Macro: <xsl:value-of select="$name"/></h3>
  265. <pre><xsl:text>#define </xsl:text><xsl:value-of select="$name"/></pre>
  266. <p>
  267. <xsl:call-template name="dumptext">
  268. <xsl:with-param name="text" select="info"/>
  269. </xsl:call-template>
  270. </p><xsl:text>
  271. </xsl:text>
  272. </xsl:template>
  273. <xsl:template match="function" mode="toc">
  274. <xsl:variable name="name" select="string(@name)"/>
  275. <xsl:variable name="nlen" select="string-length($name)"/>
  276. <xsl:variable name="tlen" select="string-length(return/@type)"/>
  277. <xsl:variable name="blen" select="(($nlen + 8) - (($nlen + 8) mod 8)) + (($tlen + 8) - (($tlen + 8) mod 8))"/>
  278. <pre class="programlisting">
  279. <xsl:call-template name="dumptext">
  280. <xsl:with-param name="text" select="return/@type"/>
  281. </xsl:call-template>
  282. <xsl:text>&#9;</xsl:text>
  283. <a href="#{@name}"><xsl:value-of select="@name"/></a>
  284. <xsl:if test="$blen - 40 &lt; -8">
  285. <xsl:text>&#9;</xsl:text>
  286. </xsl:if>
  287. <xsl:if test="$blen - 40 &lt; 0">
  288. <xsl:text>&#9;</xsl:text>
  289. </xsl:if>
  290. <xsl:text>&#9;(</xsl:text>
  291. <xsl:if test="not(arg)">
  292. <xsl:text>void</xsl:text>
  293. </xsl:if>
  294. <xsl:for-each select="arg">
  295. <xsl:call-template name="dumptext">
  296. <xsl:with-param name="text" select="@type"/>
  297. </xsl:call-template>
  298. <xsl:text> </xsl:text>
  299. <xsl:value-of select="@name"/>
  300. <xsl:if test="position() != last()">
  301. <xsl:text>, </xsl:text><br/>
  302. <xsl:if test="$blen - 40 &gt; 8">
  303. <xsl:text>&#9;</xsl:text>
  304. </xsl:if>
  305. <xsl:if test="$blen - 40 &gt; 0">
  306. <xsl:text>&#9;</xsl:text>
  307. </xsl:if>
  308. <xsl:text>&#9;&#9;&#9;&#9;&#9; </xsl:text>
  309. </xsl:if>
  310. </xsl:for-each>
  311. <xsl:text>)</xsl:text>
  312. </pre><xsl:text>
  313. </xsl:text>
  314. </xsl:template>
  315. <xsl:template match="functype" mode="toc">
  316. <xsl:variable name="name" select="string(@name)"/>
  317. <xsl:variable name="nlen" select="string-length($name)"/>
  318. <xsl:variable name="tlen" select="string-length(return/@type)"/>
  319. <xsl:variable name="blen" select="(($nlen + 8) - (($nlen + 8) mod 8)) + (($tlen + 8) - (($tlen + 8) mod 8))"/>
  320. <pre class="programlisting">
  321. <xsl:text>Function type: </xsl:text>
  322. <a href="#{$name}"><xsl:value-of select="$name"/></a>
  323. <xsl:text>
  324. </xsl:text>
  325. <xsl:call-template name="dumptext">
  326. <xsl:with-param name="text" select="return/@type"/>
  327. </xsl:call-template>
  328. <xsl:text>&#9;</xsl:text>
  329. <a href="#{$name}"><xsl:value-of select="$name"/></a>
  330. <xsl:if test="$blen - 40 &lt; -8">
  331. <xsl:text>&#9;</xsl:text>
  332. </xsl:if>
  333. <xsl:if test="$blen - 40 &lt; 0">
  334. <xsl:text>&#9;</xsl:text>
  335. </xsl:if>
  336. <xsl:text>&#9;(</xsl:text>
  337. <xsl:if test="not(arg)">
  338. <xsl:text>void</xsl:text>
  339. </xsl:if>
  340. <xsl:for-each select="arg">
  341. <xsl:call-template name="dumptext">
  342. <xsl:with-param name="text" select="@type"/>
  343. </xsl:call-template>
  344. <xsl:text> </xsl:text>
  345. <xsl:value-of select="@name"/>
  346. <xsl:if test="position() != last()">
  347. <xsl:text>, </xsl:text><br/>
  348. <xsl:if test="$blen - 40 &gt; 8">
  349. <xsl:text>&#9;</xsl:text>
  350. </xsl:if>
  351. <xsl:if test="$blen - 40 &gt; 0">
  352. <xsl:text>&#9;</xsl:text>
  353. </xsl:if>
  354. <xsl:text>&#9;&#9;&#9;&#9;&#9; </xsl:text>
  355. </xsl:if>
  356. </xsl:for-each>
  357. <xsl:text>)
  358. </xsl:text>
  359. </pre>
  360. <xsl:text>
  361. </xsl:text>
  362. </xsl:template>
  363. <xsl:template match="functype">
  364. <xsl:variable name="name" select="string(@name)"/>
  365. <xsl:variable name="nlen" select="string-length($name)"/>
  366. <xsl:variable name="tlen" select="string-length(return/@type)"/>
  367. <xsl:variable name="blen" select="(($nlen + 8) - (($nlen + 8) mod 8)) + (($tlen + 8) - (($tlen + 8) mod 8))"/>
  368. <h3>
  369. <a name="{$name}"></a>
  370. <xsl:text>Function type: </xsl:text>
  371. <xsl:value-of select="$name"/>
  372. </h3>
  373. <pre class="programlisting">
  374. <xsl:text>Function type: </xsl:text>
  375. <xsl:value-of select="$name"/>
  376. <xsl:text>
  377. </xsl:text>
  378. <xsl:call-template name="dumptext">
  379. <xsl:with-param name="text" select="return/@type"/>
  380. </xsl:call-template>
  381. <xsl:text>&#9;</xsl:text>
  382. <xsl:value-of select="@name"/>
  383. <xsl:if test="$blen - 40 &lt; -8">
  384. <xsl:text>&#9;</xsl:text>
  385. </xsl:if>
  386. <xsl:if test="$blen - 40 &lt; 0">
  387. <xsl:text>&#9;</xsl:text>
  388. </xsl:if>
  389. <xsl:text>&#9;(</xsl:text>
  390. <xsl:if test="not(arg)">
  391. <xsl:text>void</xsl:text>
  392. </xsl:if>
  393. <xsl:for-each select="arg">
  394. <xsl:call-template name="dumptext">
  395. <xsl:with-param name="text" select="@type"/>
  396. </xsl:call-template>
  397. <xsl:text> </xsl:text>
  398. <xsl:value-of select="@name"/>
  399. <xsl:if test="position() != last()">
  400. <xsl:text>, </xsl:text><br/>
  401. <xsl:if test="$blen - 40 &gt; 8">
  402. <xsl:text>&#9;</xsl:text>
  403. </xsl:if>
  404. <xsl:if test="$blen - 40 &gt; 0">
  405. <xsl:text>&#9;</xsl:text>
  406. </xsl:if>
  407. <xsl:text>&#9;&#9;&#9;&#9;&#9; </xsl:text>
  408. </xsl:if>
  409. </xsl:for-each>
  410. <xsl:text>)
  411. </xsl:text>
  412. </pre>
  413. <p>
  414. <xsl:call-template name="dumptext">
  415. <xsl:with-param name="text" select="info"/>
  416. </xsl:call-template>
  417. </p>
  418. <xsl:if test="arg | return">
  419. <div class="variablelist"><table border="0"><col align="left"/><tbody>
  420. <xsl:for-each select="arg">
  421. <tr>
  422. <td><span class="term"><i><tt><xsl:value-of select="@name"/></tt></i>:</span></td>
  423. <td>
  424. <xsl:call-template name="dumptext">
  425. <xsl:with-param name="text" select="@info"/>
  426. </xsl:call-template>
  427. </td>
  428. </tr>
  429. </xsl:for-each>
  430. <xsl:if test="return/@info">
  431. <tr>
  432. <td><span class="term"><i><tt>Returns</tt></i>:</span></td>
  433. <td>
  434. <xsl:call-template name="dumptext">
  435. <xsl:with-param name="text" select="return/@info"/>
  436. </xsl:call-template>
  437. </td>
  438. </tr>
  439. </xsl:if>
  440. </tbody></table></div>
  441. </xsl:if>
  442. <br/>
  443. <xsl:text>
  444. </xsl:text>
  445. </xsl:template>
  446. <xsl:template match="function">
  447. <xsl:variable name="name" select="string(@name)"/>
  448. <xsl:variable name="nlen" select="string-length($name)"/>
  449. <xsl:variable name="tlen" select="string-length(return/@type)"/>
  450. <xsl:variable name="blen" select="(($nlen + 8) - (($nlen + 8) mod 8)) + (($tlen + 8) - (($tlen + 8) mod 8))"/>
  451. <h3><a name="{$name}"></a>Function: <xsl:value-of select="$name"/></h3>
  452. <pre class="programlisting">
  453. <xsl:call-template name="dumptext">
  454. <xsl:with-param name="text" select="return/@type"/>
  455. </xsl:call-template>
  456. <xsl:text>&#9;</xsl:text>
  457. <xsl:value-of select="@name"/>
  458. <xsl:if test="$blen - 40 &lt; -8">
  459. <xsl:text>&#9;</xsl:text>
  460. </xsl:if>
  461. <xsl:if test="$blen - 40 &lt; 0">
  462. <xsl:text>&#9;</xsl:text>
  463. </xsl:if>
  464. <xsl:text>&#9;(</xsl:text>
  465. <xsl:if test="not(arg)">
  466. <xsl:text>void</xsl:text>
  467. </xsl:if>
  468. <xsl:for-each select="arg">
  469. <xsl:call-template name="dumptext">
  470. <xsl:with-param name="text" select="@type"/>
  471. </xsl:call-template>
  472. <xsl:text> </xsl:text>
  473. <xsl:value-of select="@name"/>
  474. <xsl:if test="position() != last()">
  475. <xsl:text>, </xsl:text><br/>
  476. <xsl:if test="$blen - 40 &gt; 8">
  477. <xsl:text>&#9;</xsl:text>
  478. </xsl:if>
  479. <xsl:if test="$blen - 40 &gt; 0">
  480. <xsl:text>&#9;</xsl:text>
  481. </xsl:if>
  482. <xsl:text>&#9;&#9;&#9;&#9;&#9; </xsl:text>
  483. </xsl:if>
  484. </xsl:for-each>
  485. <xsl:text>)</xsl:text><br/>
  486. <xsl:text>
  487. </xsl:text>
  488. </pre>
  489. <p>
  490. <xsl:call-template name="dumptext">
  491. <xsl:with-param name="text" select="info"/>
  492. </xsl:call-template>
  493. </p><xsl:text>
  494. </xsl:text>
  495. <xsl:if test="arg | return/@info">
  496. <div class="variablelist"><table border="0"><col align="left"/><tbody>
  497. <xsl:for-each select="arg">
  498. <tr>
  499. <td><span class="term"><i><tt><xsl:value-of select="@name"/></tt></i>:</span></td>
  500. <td>
  501. <xsl:call-template name="dumptext">
  502. <xsl:with-param name="text" select="@info"/>
  503. </xsl:call-template>
  504. </td>
  505. </tr>
  506. </xsl:for-each>
  507. <xsl:if test="return/@info">
  508. <tr>
  509. <td><span class="term"><i><tt>Returns</tt></i>:</span></td>
  510. <td>
  511. <xsl:call-template name="dumptext">
  512. <xsl:with-param name="text" select="return/@info"/>
  513. </xsl:call-template>
  514. </td>
  515. </tr>
  516. </xsl:if>
  517. </tbody></table></div>
  518. </xsl:if>
  519. </xsl:template>
  520. <xsl:template match="exports" mode="toc">
  521. <xsl:apply-templates select="key('symbols', string(@symbol))[1]" mode="toc"/>
  522. </xsl:template>
  523. <xsl:template match="exports">
  524. <xsl:apply-templates select="key('symbols', string(@symbol))[1]"/>
  525. </xsl:template>
  526. <xsl:template name="description">
  527. <xsl:if test="deprecated">
  528. <h2 style="font-weight:bold;color:red;text-align:center">This module is deprecated</h2>
  529. </xsl:if>
  530. <xsl:if test="description">
  531. <p><xsl:value-of select="description"/></p>
  532. </xsl:if>
  533. </xsl:template>
  534. <!--
  535. <xsl:template name="docomponents">
  536. <xsl:param name="mode"/>
  537. <xsl:apply-templates select="exports[@type='macro']" mode="$mode">
  538. <xsl:sort select='@symbol'/>
  539. </xsl:apply-templates>
  540. <xsl:apply-templates select="exports[@type='enum']" mode="$mode">
  541. <xsl:sort select='@symbol'/>
  542. </xsl:apply-templates>
  543. <xsl:apply-templates select="exports[@type='typedef']" mode="$mode">
  544. <xsl:sort select='@symbol'/>
  545. </xsl:apply-templates>
  546. <xsl:apply-templates select="exports[@type='struct']" mode="$mode">
  547. <xsl:sort select='@symbol'/>
  548. </xsl:apply-templates>
  549. <xsl:apply-templates select="exports[@type='function']" mode="$mode">
  550. <xsl:sort select='@symbol'/>
  551. </xsl:apply-templates>
  552. </xsl:template>
  553. -->
  554. <xsl:template match="file">
  555. <xsl:variable name="name" select="@name"/>
  556. <xsl:variable name="title">Module <xsl:value-of select="$name"/> from <xsl:value-of select="/api/@name"/></xsl:variable>
  557. <xsl:document href="{$htmldir}/libxml-{$name}.html" method="xml" encoding="ISO-8859-1"
  558. doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
  559. doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  560. <html>
  561. <head>
  562. <xsl:call-template name="style"/>
  563. <xsl:call-template name="docstyle"/>
  564. <title><xsl:value-of select="$title"/></title>
  565. </head>
  566. <body bgcolor="#8b7765" text="#000000" link="#a06060" vlink="#000000">
  567. <xsl:call-template name="titlebox">
  568. <xsl:with-param name="title" select="$title"/>
  569. </xsl:call-template>
  570. <table border="0" cellpadding="4" cellspacing="0" width="100%" align="center">
  571. <tr>
  572. <td bgcolor="#8b7765">
  573. <table border="0" cellspacing="0" cellpadding="2" width="100%">
  574. <tr>
  575. <td valign="top" width="200" bgcolor="#8b7765">
  576. <xsl:call-template name="apitoc"/>
  577. </td>
  578. <td valign="top" bgcolor="#8b7765">
  579. <table border="0" cellspacing="0" cellpadding="1" width="100%">
  580. <tr>
  581. <td>
  582. <table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000">
  583. <tr>
  584. <td>
  585. <table border="0" cellpadding="3" cellspacing="1" width="100%">
  586. <tr>
  587. <td bgcolor="#fffacd">
  588. <xsl:call-template name="navbar"/>
  589. <xsl:call-template name="description"/>
  590. <xsl:choose>
  591. <xsl:when test="deprecated">
  592. <div class="deprecated">
  593. <h2>Table of Contents</h2>
  594. <xsl:apply-templates select="exports" mode="toc"/>
  595. <h2>Description</h2>
  596. <xsl:text>
  597. </xsl:text>
  598. <xsl:apply-templates select="exports"/>
  599. </div>
  600. </xsl:when>
  601. <xsl:otherwise>
  602. <h2>Table of Contents</h2>
  603. <xsl:apply-templates select="exports[@type='macro']" mode="toc">
  604. <xsl:sort select='@symbol'/>
  605. </xsl:apply-templates>
  606. <xsl:apply-templates select="exports[@type='enum']" mode="toc">
  607. <xsl:sort select='@symbol'/>
  608. </xsl:apply-templates>
  609. <xsl:apply-templates select="exports[@type='typedef']" mode="toc">
  610. <xsl:sort select='@symbol'/>
  611. </xsl:apply-templates>
  612. <xsl:apply-templates select="exports[@type='struct']" mode="toc">
  613. <xsl:sort select='@symbol'/>
  614. </xsl:apply-templates>
  615. <xsl:apply-templates select="exports[@type='function']" mode="toc">
  616. <xsl:sort select='@symbol'/>
  617. </xsl:apply-templates>
  618. <h2>Description</h2>
  619. <xsl:text>
  620. </xsl:text>
  621. <xsl:apply-templates select="exports[@type='macro']">
  622. <xsl:sort select='@symbol'/>
  623. </xsl:apply-templates>
  624. <xsl:apply-templates select="exports[@type='enum']">
  625. <xsl:sort select='@symbol'/>
  626. </xsl:apply-templates>
  627. <xsl:apply-templates select="exports[@type='typedef']">
  628. <xsl:sort select='@symbol'/>
  629. </xsl:apply-templates>
  630. <xsl:apply-templates select="exports[@type='struct']">
  631. <xsl:sort select='@symbol'/>
  632. </xsl:apply-templates>
  633. <xsl:apply-templates select="exports[@type='function']">
  634. <xsl:sort select='@symbol'/>
  635. </xsl:apply-templates>
  636. </xsl:otherwise>
  637. </xsl:choose>
  638. <p><a href="{$href_base}bugs.html">Daniel Veillard</a></p>
  639. </td>
  640. </tr>
  641. </table>
  642. </td>
  643. </tr>
  644. </table>
  645. </td>
  646. </tr>
  647. </table>
  648. </td>
  649. </tr>
  650. </table>
  651. </td>
  652. </tr>
  653. </table>
  654. </body>
  655. </html>
  656. </xsl:document>
  657. </xsl:template>
  658. <xsl:template match="file" mode="toc">
  659. <xsl:variable name="name" select="@name"/>
  660. <li>
  661. <a href="libxml-{$name}.html"><xsl:value-of select="$name"/></a>
  662. <xsl:text>: </xsl:text>
  663. <xsl:value-of select="summary"/>
  664. </li>
  665. </xsl:template>
  666. <xsl:template name="mainpage">
  667. <xsl:param name="file" select="concat($htmldir, '/index.html')"/>
  668. <xsl:variable name="title">Reference Manual for <xsl:value-of select="/api/@name"/></xsl:variable>
  669. <xsl:document href="{$file}" method="xml" encoding="ISO-8859-1"
  670. doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
  671. doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  672. <html>
  673. <head>
  674. <xsl:call-template name="style"/>
  675. <xsl:call-template name="docstyle"/>
  676. <title><xsl:value-of select="$title"/></title>
  677. </head>
  678. <body bgcolor="#8b7765" text="#000000" link="#a06060" vlink="#000000">
  679. <xsl:call-template name="titlebox">
  680. <xsl:with-param name="title" select="$title"/>
  681. </xsl:call-template>
  682. <table border="0" cellpadding="4" cellspacing="0" width="100%" align="center">
  683. <tr>
  684. <td bgcolor="#8b7765">
  685. <table border="0" cellspacing="0" cellpadding="2" width="100%">
  686. <tr>
  687. <td valign="top" width="200" bgcolor="#8b7765">
  688. <xsl:call-template name="apitoc"/>
  689. </td>
  690. <td valign="top" bgcolor="#8b7765">
  691. <table border="0" cellspacing="0" cellpadding="1" width="100%">
  692. <tr>
  693. <td>
  694. <table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000">
  695. <tr>
  696. <td>
  697. <table border="0" cellpadding="3" cellspacing="1" width="100%">
  698. <tr>
  699. <td bgcolor="#fffacd">
  700. <h2>Table of Contents</h2>
  701. <ul>
  702. <xsl:apply-templates select="/api/files/file" mode="toc"/>
  703. </ul>
  704. <p><a href="{$href_base}bugs.html">Daniel Veillard</a></p>
  705. </td>
  706. </tr>
  707. </table>
  708. </td>
  709. </tr>
  710. </table>
  711. </td>
  712. </tr>
  713. </table>
  714. </td>
  715. </tr>
  716. </table>
  717. </td>
  718. </tr>
  719. </table>
  720. </body>
  721. </html>
  722. </xsl:document>
  723. </xsl:template>
  724. <xsl:template match="/">
  725. <!-- Save the main index.html as well as a couple of copies -->
  726. <xsl:call-template name="mainpage"/>
  727. <xsl:call-template name="mainpage">
  728. <xsl:with-param name="file" select="concat($htmldir, '/book1.html')"/>
  729. </xsl:call-template>
  730. <xsl:call-template name="mainpage">
  731. <xsl:with-param name="file" select="concat($htmldir, '/libxml-lib.html')"/>
  732. </xsl:call-template>
  733. <!-- now build the file for each of the modules -->
  734. <xsl:apply-templates select="/api/files/file"/>
  735. </xsl:template>
  736. </xsl:stylesheet>