api.xsl 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394
  1. <?xml version="1.0"?>
  2. <!-- this stylesheet builds the API*.html , it works based on libxml2-refs.xml
  3. -->
  4. <xsl:stylesheet version="1.0"
  5. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  6. xmlns:exsl="http://exslt.org/common"
  7. extension-element-prefixes="exsl"
  8. exclude-result-prefixes="exsl">
  9. <!-- Import the rest of the site stylesheets -->
  10. <xsl:import href="site.xsl"/>
  11. <!-- Generate XHTML-1.0 transitional -->
  12. <xsl:output method="xml" encoding="ISO-8859-1" indent="yes"
  13. doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
  14. doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/>
  15. <xsl:variable name="href_base" select="''"/>
  16. <xsl:variable name="apirefs" select="document('libxml2-refs.xml')"/>
  17. <xsl:variable name="module" select="$apirefs/apirefs/@name"/>
  18. <xsl:key name="refhref" match="reference" use="@name"/>
  19. <xsl:template match="ref" mode="anchor">
  20. <xsl:variable name="name" select="@name"/>
  21. <xsl:for-each select="document('libxml2-refs.xml')">
  22. <a href="{key('refhref', $name)/@href}"><xsl:value-of select="$name"/></a><br/>
  23. </xsl:for-each>
  24. </xsl:template>
  25. <xsl:template match="type" mode="reflist">
  26. <h2>Type <xsl:value-of select="@name"/>:</h2>
  27. <p>
  28. <xsl:for-each select="ref">
  29. <xsl:apply-templates mode="anchor" select="."/>
  30. <xsl:text>
  31. </xsl:text>
  32. </xsl:for-each>
  33. </p>
  34. </xsl:template>
  35. <xsl:template match="letter" mode="reflist">
  36. <h2>Letter <xsl:value-of select="@name"/>:</h2>
  37. <p>
  38. <xsl:for-each select="ref">
  39. <xsl:apply-templates mode="anchor" select="."/>
  40. <xsl:text>
  41. </xsl:text>
  42. </xsl:for-each>
  43. </p>
  44. </xsl:template>
  45. <xsl:template match="file" mode="reflist">
  46. <h2><a name="{@name}">Module <xsl:value-of select="@name"/></a>:</h2>
  47. <p>
  48. <xsl:for-each select="ref">
  49. <xsl:apply-templates mode="anchor" select="."/>
  50. <xsl:text>
  51. </xsl:text>
  52. </xsl:for-each>
  53. </p>
  54. </xsl:template>
  55. <xsl:template match="letter" mode="wordlist">
  56. <h2>Letter <xsl:value-of select="@name"/>:</h2>
  57. <dl>
  58. <xsl:for-each select="word">
  59. <dt><xsl:value-of select="@name"/></dt>
  60. <dd>
  61. <xsl:for-each select="ref">
  62. <xsl:apply-templates mode="anchor" select="."/>
  63. <xsl:text>
  64. </xsl:text>
  65. </xsl:for-each>
  66. </dd>
  67. </xsl:for-each>
  68. </dl>
  69. </xsl:template>
  70. <xsl:template match="constructors">
  71. <xsl:message>Generating API Constructors</xsl:message>
  72. <xsl:variable name="title">List of constructors for <xsl:value-of select="$module"/></xsl:variable>
  73. <xsl:document href="APIconstructors.html" method="xml" encoding="ISO-8859-1"
  74. doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
  75. doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  76. <html>
  77. <head>
  78. <xsl:call-template name="style"/>
  79. <xsl:element name="title">
  80. <xsl:value-of select="$title"/>
  81. </xsl:element>
  82. </head>
  83. <body bgcolor="#8b7765" text="#000000" link="#a06060" vlink="#000000">
  84. <xsl:call-template name="titlebox">
  85. <xsl:with-param name="title" select="$title"/>
  86. </xsl:call-template>
  87. <table border="0" cellpadding="4" cellspacing="0" width="100%" align="center">
  88. <tr>
  89. <td bgcolor="#8b7765">
  90. <table border="0" cellspacing="0" cellpadding="2" width="100%">
  91. <tr>
  92. <td valign="top" width="200" bgcolor="#8b7765">
  93. <xsl:call-template name="develtoc"/>
  94. </td>
  95. <td valign="top" bgcolor="#8b7765">
  96. <table border="0" cellspacing="0" cellpadding="1" width="100%">
  97. <tr>
  98. <td>
  99. <table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000">
  100. <tr>
  101. <td>
  102. <table border="0" cellpadding="3" cellspacing="1" width="100%">
  103. <tr>
  104. <td bgcolor="#fffacd">
  105. <xsl:apply-templates mode="reflist" select="type"/>
  106. <p><a href="{$href_base}bugs.html">Daniel Veillard</a></p>
  107. </td>
  108. </tr>
  109. </table>
  110. </td>
  111. </tr>
  112. </table>
  113. </td>
  114. </tr>
  115. </table>
  116. </td>
  117. </tr>
  118. </table>
  119. </td>
  120. </tr>
  121. </table>
  122. </body>
  123. </html>
  124. </xsl:document>
  125. </xsl:template>
  126. <xsl:template match="files">
  127. <xsl:message>Generating API List of synbols per file</xsl:message>
  128. <xsl:variable name="title">List of Symbols per Module for <xsl:value-of select="$module"/></xsl:variable>
  129. <xsl:document href="APIfiles.html" method="xml" encoding="ISO-8859-1"
  130. doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
  131. doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  132. <html>
  133. <head>
  134. <xsl:call-template name="style"/>
  135. <xsl:element name="title">
  136. <xsl:value-of select="$title"/>
  137. </xsl:element>
  138. </head>
  139. <body bgcolor="#8b7765" text="#000000" link="#a06060" vlink="#000000">
  140. <xsl:call-template name="titlebox">
  141. <xsl:with-param name="title" select="$title"/>
  142. </xsl:call-template>
  143. <table border="0" cellpadding="4" cellspacing="0" width="100%" align="center">
  144. <tr>
  145. <td bgcolor="#8b7765">
  146. <table border="0" cellspacing="0" cellpadding="2" width="100%">
  147. <tr>
  148. <td valign="top" width="200" bgcolor="#8b7765">
  149. <xsl:call-template name="develtoc"/>
  150. </td>
  151. <td valign="top" bgcolor="#8b7765">
  152. <table border="0" cellspacing="0" cellpadding="1" width="100%">
  153. <tr>
  154. <td>
  155. <table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000">
  156. <tr>
  157. <td>
  158. <table border="0" cellpadding="3" cellspacing="1" width="100%">
  159. <tr>
  160. <td bgcolor="#fffacd">
  161. <xsl:apply-templates mode="reflist" select="file"/>
  162. <p><a href="{$href_base}bugs.html">Daniel Veillard</a></p>
  163. </td>
  164. </tr>
  165. </table>
  166. </td>
  167. </tr>
  168. </table>
  169. </td>
  170. </tr>
  171. </table>
  172. </td>
  173. </tr>
  174. </table>
  175. </td>
  176. </tr>
  177. </table>
  178. </body>
  179. </html>
  180. </xsl:document>
  181. </xsl:template>
  182. <xsl:template match="functions">
  183. <xsl:message>Generating API Functions by Type</xsl:message>
  184. <xsl:variable name="title">List of function manipulating types in <xsl:value-of select="$module"/></xsl:variable>
  185. <xsl:document href="APIfunctions.html" method="xml" encoding="ISO-8859-1"
  186. doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
  187. doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  188. <html>
  189. <head>
  190. <xsl:call-template name="style"/>
  191. <xsl:element name="title">
  192. <xsl:value-of select="$title"/>
  193. </xsl:element>
  194. </head>
  195. <body bgcolor="#8b7765" text="#000000" link="#a06060" vlink="#000000">
  196. <xsl:call-template name="titlebox">
  197. <xsl:with-param name="title" select="$title"/>
  198. </xsl:call-template>
  199. <table border="0" cellpadding="4" cellspacing="0" width="100%" align="center">
  200. <tr>
  201. <td bgcolor="#8b7765">
  202. <table border="0" cellspacing="0" cellpadding="2" width="100%">
  203. <tr>
  204. <td valign="top" width="200" bgcolor="#8b7765">
  205. <xsl:call-template name="develtoc"/>
  206. </td>
  207. <td valign="top" bgcolor="#8b7765">
  208. <table border="0" cellspacing="0" cellpadding="1" width="100%">
  209. <tr>
  210. <td>
  211. <table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000">
  212. <tr>
  213. <td>
  214. <table border="0" cellpadding="3" cellspacing="1" width="100%">
  215. <tr>
  216. <td bgcolor="#fffacd">
  217. <xsl:apply-templates mode="reflist" select="type"/>
  218. <p><a href="{$href_base}bugs.html">Daniel Veillard</a></p>
  219. </td>
  220. </tr>
  221. </table>
  222. </td>
  223. </tr>
  224. </table>
  225. </td>
  226. </tr>
  227. </table>
  228. </td>
  229. </tr>
  230. </table>
  231. </td>
  232. </tr>
  233. </table>
  234. </body>
  235. </html>
  236. </xsl:document>
  237. </xsl:template>
  238. <xsl:template match="alpha">
  239. <xsl:message>Generating API Alphabetic list</xsl:message>
  240. <xsl:variable name="title">Alphabetic List of Symbols in <xsl:value-of select="$module"/></xsl:variable>
  241. <xsl:document href="APIsymbols.html" method="xml" encoding="ISO-8859-1"
  242. doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
  243. doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  244. <html>
  245. <head>
  246. <xsl:call-template name="style"/>
  247. <xsl:element name="title">
  248. <xsl:value-of select="$title"/>
  249. </xsl:element>
  250. </head>
  251. <body bgcolor="#8b7765" text="#000000" link="#a06060" vlink="#000000">
  252. <xsl:call-template name="titlebox">
  253. <xsl:with-param name="title" select="$title"/>
  254. </xsl:call-template>
  255. <table border="0" cellpadding="4" cellspacing="0" width="100%" align="center">
  256. <tr>
  257. <td bgcolor="#8b7765">
  258. <table border="0" cellspacing="0" cellpadding="2" width="100%">
  259. <tr>
  260. <td valign="top" width="200" bgcolor="#8b7765">
  261. <xsl:call-template name="develtoc"/>
  262. </td>
  263. <td valign="top" bgcolor="#8b7765">
  264. <table border="0" cellspacing="0" cellpadding="1" width="100%">
  265. <tr>
  266. <td>
  267. <table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000">
  268. <tr>
  269. <td>
  270. <table border="0" cellpadding="3" cellspacing="1" width="100%">
  271. <tr>
  272. <td bgcolor="#fffacd">
  273. <xsl:apply-templates mode="reflist" select="letter"/>
  274. <p><a href="{$href_base}bugs.html">Daniel Veillard</a></p>
  275. </td>
  276. </tr>
  277. </table>
  278. </td>
  279. </tr>
  280. </table>
  281. </td>
  282. </tr>
  283. </table>
  284. </td>
  285. </tr>
  286. </table>
  287. </td>
  288. </tr>
  289. </table>
  290. </body>
  291. </html>
  292. </xsl:document>
  293. </xsl:template>
  294. <xsl:template name="apichunks">
  295. <h2 align="center">
  296. <xsl:for-each select="/apirefs/index/chunks/chunk">
  297. <xsl:variable name="name" select="@name"/>
  298. <xsl:variable name="start" select="@start"/>
  299. <xsl:variable name="end" select="@end"/>
  300. <xsl:variable name="block" select="concat($start, '-', $end)"/>
  301. <a href="API{$name}.html"><xsl:value-of select="$block"/></a>
  302. <xsl:text>
  303. </xsl:text>
  304. </xsl:for-each>
  305. </h2>
  306. </xsl:template>
  307. <xsl:template match="chunk">
  308. <xsl:variable name="name" select="@name"/>
  309. <xsl:variable name="start" select="@start"/>
  310. <xsl:variable name="end" select="@end"/>
  311. <xsl:variable name="block" select="concat($start, '-', $end)"/>
  312. <xsl:variable name="target" select="/apirefs/index/chunk[@name = $name]"/>
  313. <xsl:variable name="title">API Alphabetic Index <xsl:value-of select="$block"/> for <xsl:value-of select="$module"/></xsl:variable>
  314. <xsl:document href="API{$name}.html" method="xml" encoding="ISO-8859-1"
  315. doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
  316. doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  317. <html>
  318. <head>
  319. <xsl:call-template name="style"/>
  320. <xsl:element name="title">
  321. <xsl:value-of select="$title"/>
  322. </xsl:element>
  323. </head>
  324. <body bgcolor="#8b7765" text="#000000" link="#a06060" vlink="#000000">
  325. <xsl:call-template name="titlebox">
  326. <xsl:with-param name="title" select="$title"/>
  327. </xsl:call-template>
  328. <table border="0" cellpadding="4" cellspacing="0" width="100%" align="center">
  329. <tr>
  330. <td bgcolor="#8b7765">
  331. <table border="0" cellspacing="0" cellpadding="2" width="100%">
  332. <tr>
  333. <td valign="top" width="200" bgcolor="#8b7765">
  334. <xsl:call-template name="develtoc"/>
  335. </td>
  336. <td valign="top" bgcolor="#8b7765">
  337. <table border="0" cellspacing="0" cellpadding="1" width="100%">
  338. <tr>
  339. <td>
  340. <table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000">
  341. <tr>
  342. <td>
  343. <table border="0" cellpadding="3" cellspacing="1" width="100%">
  344. <tr>
  345. <td bgcolor="#fffacd">
  346. <xsl:call-template name="apichunks"/>
  347. <xsl:apply-templates mode="wordlist"
  348. select="$target/letter"/>
  349. <xsl:call-template name="apichunks"/>
  350. <p><a href="{$href_base}bugs.html">Daniel Veillard</a></p>
  351. </td>
  352. </tr>
  353. </table>
  354. </td>
  355. </tr>
  356. </table>
  357. </td>
  358. </tr>
  359. </table>
  360. </td>
  361. </tr>
  362. </table>
  363. </td>
  364. </tr>
  365. </table>
  366. </body>
  367. </html>
  368. </xsl:document>
  369. </xsl:template>
  370. <xsl:template match="index">
  371. <xsl:message>Generating API Index</xsl:message>
  372. <xsl:apply-templates select="chunks/chunk"/>
  373. </xsl:template>
  374. <xsl:template match="apirefs">
  375. <xsl:message>Generating API Cross References</xsl:message>
  376. <xsl:apply-templates select="constructors"/>
  377. <xsl:apply-templates select="functions"/>
  378. <xsl:apply-templates select="alpha"/>
  379. <xsl:apply-templates select="files"/>
  380. <xsl:apply-templates select="index"/>
  381. </xsl:template>
  382. <xsl:template match="/">
  383. <xsl:apply-templates select="$apirefs/apirefs"/>
  384. </xsl:template>
  385. </xsl:stylesheet>