custom.xsl 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426
  1. <?xml version="1.0" ?>
  2. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
  3. <!-- Version: $Id: pawndoc.xsl 3612 2006-07-22 09:59:46Z thiadmer $ -->
  4. <xsl:template match="/">
  5. <HTML>
  6. <HEAD>
  7. <META http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  8. <TITLE><xsl:value-of select="doc/assembly/name"/></TITLE>
  9. <STYLE type="text/css">
  10. BODY { FONT-FAMILY: "Verdana", sans-serif; FONT-SIZE: x-small; }
  11. CODE { FONT-SIZE: small; }
  12. DL { MARGIN-LEFT: 4em; DISPLAY: compact }
  13. DT { FONT-WEIGHT: bold }
  14. A:link { COLOR: #4e4887 }
  15. A:visited { COLOR: #8080c8 }
  16. A:active { COLOR: #f16043 }
  17. A:hover { COLOR: #f16043 }
  18. P { MARGIN-BOTTOM: 0.5em; MARGIN-TOP: 0.5em; MARGIN-LEFT: 4em }
  19. P.noindent { MARGIN-LEFT: 0em }
  20. P.syntax { FONT-WEIGHT: bold }
  21. HR.para { HEIGHT: 0; BORDER: 0; COLOR: transparent; BACKGROUND-COLOR: transparent; MARGIN-TOP: 0.5em; MARGIN-BOTTOM: 0; }
  22. XMP { BACKGROUND-COLOR: #ddeeff; FONT-SIZE: x-small; MARGIN: 1em }
  23. PRE { BACKGROUND-COLOR: #ddeeff; FONT-SIZE: x-small; MARGIN: 1em }
  24. TABLE { BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; BORDER-RIGHT: medium none; BORDER-TOP: medium none }
  25. TABLE.param { BACKGROUND-COLOR: #ddeeff; }
  26. TABLE.transition { BACKGROUND-COLOR: #ddeeff; }
  27. TD { BACKGROUND-COLOR: #ddeeff; BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; BORDER-RIGHT: medium none; BORDER-TOP: medium none; FONT-SIZE: x-small; MARGIN: 2px; PADDING-BOTTOM: 2px; PADDING-LEFT: 2px; PADDING-RIGHT: 2px; PADDING-TOP: 2px; TEXT-ALIGN: left }
  28. TD.header { BACKGROUND-COLOR: transparent; FONT-WEIGHT: bold; COLOR: #4e4887; WIDTH: 3.3em; PADDING-LEFT: 0px; MARGIN-BOTTOM: 0.5em }
  29. TD.inline { BACKGROUND-COLOR: transparent }
  30. TD.param { FONT-WEIGHT: bold; FONT-STYLE: italic; PADDING-RIGHT: 20px; }
  31. TD.transition { PADDING-RIGHT: 10px; }
  32. TH { BACKGROUND-COLOR: #336699; COLOR: #ddeeff; BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; BORDER-RIGHT: medium none; BORDER-TOP: medium none; FONT-SIZE: x-small; MARGIN: 2px; PADDING-BOTTOM: 2px; PADDING-LEFT: 4px; PADDING-RIGHT: 4px; PADDING-TOP: 2px; TEXT-ALIGN: left }
  33. UL { MARGIN-TOP: 0.5em; }
  34. LI.referrer { DISPLAY: inline; PADDING-RIGHT: 8px }
  35. LI.dependency { DISPLAY: inline; PADDING-RIGHT: 8px }
  36. LI.seealso { DISPLAY: inline; PADDING-RIGHT: 8px }
  37. LI.attribute { DISPLAY: inline; PADDING-RIGHT: 8px }
  38. LI.post { DISPLAY: inline; PADDING-RIGHT: 8px }
  39. LI.author { DISPLAY: inline; PADDING-RIGHT: 8px }
  40. LI.fixes { DISPLAY: inline; PADDING-RIGHT: 8px }
  41. LI.see { DISPLAY: inline; PADDING-RIGHT: 8px }
  42. LI.changelog { DISPLAY: inline; }
  43. .symbol { PADDING-RIGHT: 8px }
  44. OL { MARGIN-TOP: 0.5em; }
  45. SPAN.paraminfo { FONT-WEIGHT:Bold; COLOR: #336699; }
  46. H1 { COLOR: #4e4887; FONT-SIZE: x-large; MARGIN-BOTTOM: 0.5em; MARGIN-TOP: 1em; PADDING-LEFT: 4px }
  47. H2 { BORDER-RIGHT: #4e4887 8px solid; BORDER-TOP: #4e4887 2px solid; COLOR: #4e4887; MARGIN-BOTTOM: 0.5em; MARGIN-TOP: 1em; }
  48. H2.general { BORDER: none; }
  49. H3 { COLOR: #4e4887; FONT-SIZE: x-small; MARGIN-BOTTOM: 0.5em }
  50. H4 { COLOR: #4e4887; FONT-SIZE: x-small; FONT-STYLE: italic; MARGIN-BOTTOM: 0.5em; DISPLAY: inline; MARGIN: 50px 8px 0px 0px }
  51. H5 { COLOR: #4e4887; FONT-SIZE: xx-small; MARGIN-BOTTOM: 0.5em }
  52. H6 { COLOR: #4e4887; FONT-SIZE: xx-small; FONT-STYLE: italic; MARGIN-BOTTOM: 0.5em }
  53. DIV.library { TEXT-ALIGN: center; BORDER-RIGHT: #4e4887 8px solid; BORDER-TOP: #4e4887 2px solid; COLOR: #4e4887; MARGIN-BOTTOM: 0.5em; MARGIN-TOP: 1em; }
  54. H1.library { TEXT-ALIGN: center; COLOR: #4e4887; MARGIN-TOP: 0.3em; }
  55. H2.library { TEXT-ALIGN: center; BORDER: none; }
  56. PRE { BACKGROUND-COLOR: #ddeeff; FONT-SIZE: small; MARGIN: 1em }
  57. </STYLE>
  58. </HEAD>
  59. <BODY>
  60. <!-- <h1><xsl:value-of select="doc/assembly/name"/></h1> -->
  61. <xsl:apply-templates select="doc/general"/>
  62. <xsl:apply-templates select="doc/members/member"/>
  63. </BODY>
  64. </HTML>
  65. </xsl:template>
  66. <xsl:template match="general">
  67. <xsl:apply-templates/>
  68. <br/>
  69. </xsl:template>
  70. <xsl:template match="member">
  71. <xsl:choose>
  72. <xsl:when test="substring(@name,1,2) = 'T:'">
  73. <a><xsl:attribute name="name"><xsl:value-of select="substring(@name,3)"/></xsl:attribute><h2><span style="float:right; padding-right:2px">enumeration</span><xsl:value-of select="substring(@name,3)"/></h2></a>
  74. <xsl:apply-templates select="summary"/>
  75. <xsl:if test="remarks">
  76. <h3>Remarks</h3>
  77. <xsl:apply-templates select="remarks"/>
  78. </xsl:if>
  79. <xsl:if test="member">
  80. <h3>Members</h3>
  81. <blockquote>
  82. <xsl:apply-templates select="member"/>
  83. </blockquote>
  84. </xsl:if>
  85. <xsl:apply-templates select="example"/>
  86. <xsl:if test="referrer">
  87. <h3>Used by</h3>
  88. <ul><xsl:apply-templates select="referrer"/></ul>
  89. </xsl:if>
  90. <xsl:if test="fixes">
  91. <h3>Fixes</h3>
  92. <ul><xsl:apply-templates select="fixes"/></ul>
  93. </xsl:if>
  94. <xsl:if test="dependency">
  95. <h3>Depends on</h3>
  96. <ul><xsl:apply-templates select="dependency"/></ul>
  97. </xsl:if>
  98. <xsl:if test="seealso">
  99. <h3>See Also</h3>
  100. <ul><xsl:apply-templates select="seealso"/></ul>
  101. </xsl:if>
  102. </xsl:when>
  103. <xsl:when test="substring(@name,1,2) = 'C:'">
  104. <a><xsl:attribute name="name"><xsl:value-of select="substring(@name,3)"/></xsl:attribute><h2><span style="float:right; padding-right:2px">constant</span><xsl:value-of select="substring(@name,3)"/></h2></a>
  105. <p class="noindent"><table><tr><td class="header inline">Value</td><td class="inline"><xsl:value-of select="@value"/></td></tr></table></p>
  106. <xsl:apply-templates select="summary"/>
  107. <xsl:apply-templates select="tagname"/>
  108. <xsl:apply-templates select="size"/>
  109. <xsl:if test="remarks">
  110. <h3>Remarks</h3>
  111. <xsl:apply-templates select="remarks"/>
  112. </xsl:if>
  113. <xsl:apply-templates select="example"/>
  114. <xsl:if test="referrer">
  115. <h3>Used by</h3>
  116. <ul><xsl:apply-templates select="referrer"/></ul>
  117. </xsl:if>
  118. <xsl:if test="fixes">
  119. <h3>Fixes</h3>
  120. <ul><xsl:apply-templates select="fixes"/></ul>
  121. </xsl:if>
  122. <xsl:if test="dependency">
  123. <h3>Depends on</h3>
  124. <ul><xsl:apply-templates select="dependency"/></ul>
  125. </xsl:if>
  126. <xsl:if test="seealso">
  127. <h3>See Also</h3>
  128. <ul><xsl:apply-templates select="seealso"/></ul>
  129. </xsl:if>
  130. </xsl:when>
  131. <xsl:when test="substring(@name,1,2) = 'M:'">
  132. <a><xsl:attribute name="name"><xsl:value-of select="substring(@name,3)"/></xsl:attribute><h2><span style="float:right; padding-right:2px">function</span><xsl:value-of select="substring(@name,3)"/></h2></a>
  133. <xsl:apply-templates select="summary"/>
  134. <h3>Syntax</h3><p class="syntax"><xsl:value-of select="@syntax"/></p>
  135. <xsl:if test="param">
  136. <p><table class="param"><xsl:apply-templates select="param"/></table></p>
  137. </xsl:if>
  138. <xsl:apply-templates select="tagname"/>
  139. <xsl:apply-templates select="returns"/>
  140. <xsl:if test="remarks">
  141. <h3>Remarks</h3>
  142. <xsl:apply-templates select="remarks"/>
  143. </xsl:if>
  144. <xsl:apply-templates select="example"/>
  145. <xsl:if test="referrer">
  146. <h3>Used by</h3>
  147. <ul><xsl:apply-templates select="referrer"/></ul>
  148. </xsl:if>
  149. <xsl:if test="fixes">
  150. <h3>Fixes</h3>
  151. <ul><xsl:apply-templates select="fixes"/></ul>
  152. </xsl:if>
  153. <xsl:if test="dependency">
  154. <h3>Depends on</h3>
  155. <ul><xsl:apply-templates select="dependency"/></ul>
  156. </xsl:if>
  157. <xsl:if test="attribute">
  158. <h3>Attributes</h3>
  159. <ul><xsl:apply-templates select="attribute"/></ul>
  160. </xsl:if>
  161. <xsl:apply-templates select="automaton"/>
  162. <xsl:if test="transition">
  163. <h3>Transition table</h3>
  164. <p>
  165. <table class="transition">
  166. <tr><th>Source</th><th>Target</th><th>Condition</th></tr>
  167. <xsl:apply-templates select="transition"/>
  168. </table>
  169. </p>
  170. </xsl:if>
  171. <xsl:apply-templates select="stacksize"/>
  172. <xsl:if test="seealso">
  173. <h3>See Also</h3>
  174. <ul><xsl:apply-templates select="seealso"/></ul>
  175. </xsl:if>
  176. </xsl:when>
  177. <xsl:when test="substring(@name,1,2) = 'F:'">
  178. <a><xsl:attribute name="name"><xsl:value-of select="substring(@name,3)"/></xsl:attribute><h2><span style="float:right; padding-right:2px">variable</span><xsl:value-of select="substring(@name,3)"/></h2></a>
  179. <xsl:apply-templates select="summary"/>
  180. <xsl:apply-templates select="tagname"/>
  181. <xsl:if test="remarks">
  182. <h3>Remarks</h3>
  183. <xsl:apply-templates select="remarks"/>
  184. </xsl:if>
  185. <xsl:apply-templates select="example"/>
  186. <xsl:if test="referrer">
  187. <h3>Used by</h3>
  188. <ul><xsl:apply-templates select="referrer"/></ul>
  189. </xsl:if>
  190. <xsl:if test="fixes">
  191. <h3>Fixes</h3>
  192. <ul><xsl:apply-templates select="fixes"/></ul>
  193. </xsl:if>
  194. <xsl:if test="dependency">
  195. <h3>Depends on</h3>
  196. <ul><xsl:apply-templates select="dependency"/></ul>
  197. </xsl:if>
  198. <xsl:if test="seealso">
  199. <h3>See Also</h3>
  200. <ul><xsl:apply-templates select="seealso"/></ul>
  201. </xsl:if>
  202. </xsl:when>
  203. </xsl:choose>
  204. </xsl:template>
  205. <xsl:template match="summary">
  206. <p><xsl:apply-templates/></p>
  207. </xsl:template>
  208. <xsl:template match="param">
  209. <tr>
  210. <td class="param"><xsl:value-of select="@name"/></td>
  211. <td><xsl:apply-templates/></td>
  212. </tr>
  213. </xsl:template>
  214. <xsl:template match="paraminfo">
  215. <span class="paraminfo">&lt;<xsl:apply-templates/>&gt;</span>
  216. </xsl:template>
  217. <xsl:template match="tagname">
  218. <p class="noindent"><table><tr>
  219. <td class="header inline">Tag</td>
  220. <td class="inline"><xsl:value-of select="@value"/></td>
  221. </tr></table></p>
  222. </xsl:template>
  223. <xsl:template match="size">
  224. <p class="noindent"><table><tr>
  225. <td class="header inline">Size</td>
  226. <td class="inline"><xsl:value-of select="@value"/></td>
  227. </tr></table></p>
  228. </xsl:template>
  229. <xsl:template match="returns">
  230. <h3>Returns</h3>
  231. <p><xsl:apply-templates/></p>
  232. </xsl:template>
  233. <xsl:template match="remarks">
  234. <p><xsl:apply-templates/></p>
  235. </xsl:template>
  236. <xsl:template match="example">
  237. <h3>Example</h3>
  238. <p><xsl:apply-templates/></p>
  239. </xsl:template>
  240. <xsl:template match="attribute">
  241. <li class="attribute"><xsl:value-of select="@name"/></li>
  242. </xsl:template>
  243. <xsl:template match="referrer">
  244. <li class="referrer"><a><xsl:attribute name="href">#<xsl:value-of select="@name"/></xsl:attribute><code><xsl:value-of select="@name"/></code></a></li>
  245. </xsl:template>
  246. <xsl:template match="dependency">
  247. <li class="dependency"><a><xsl:attribute name="href">#<xsl:value-of select="@name"/></xsl:attribute><code><xsl:value-of select="@name"/></code></a></li>
  248. </xsl:template>
  249. <xsl:template match="stacksize">
  250. <h3>Estimated stack usage</h3>
  251. <p><xsl:value-of select="@value"/> cells</p>
  252. </xsl:template>
  253. <xsl:template match="automaton">
  254. <h3>Automaton</h3>
  255. <p><xsl:value-of select="@name"/></p>
  256. </xsl:template>
  257. <xsl:template match="transition">
  258. <tr>
  259. <td class="transition"><xsl:value-of select="@source"/></td>
  260. <td class="transition"><xsl:value-of select="@target"/></td>
  261. <td><xsl:value-of select="@condition"/></td>
  262. </tr>
  263. </xsl:template>
  264. <xsl:template match="code">
  265. <pre><xsl:apply-templates/></pre>
  266. </xsl:template>
  267. <xsl:template match="seealso">
  268. <a><xsl:attribute name="href">#<xsl:value-of select="@name"/></xsl:attribute><code><xsl:value-of select="@name"/></code></a>
  269. </xsl:template>
  270. <xsl:template match="paramref">
  271. <i><xsl:value-of select="@name"/></i>
  272. </xsl:template>
  273. <xsl:template match="c"><code><xsl:apply-templates/></code></xsl:template>
  274. <xsl:template match="em"><em><xsl:apply-templates/></em></xsl:template>
  275. <xsl:template match="ul"><ul><xsl:apply-templates/></ul></xsl:template>
  276. <xsl:template match="ol"><ol><xsl:apply-templates/></ol></xsl:template>
  277. <xsl:template match="li"><li><xsl:apply-templates/></li></xsl:template>
  278. <xsl:template match="p"><hr class="para"/><xsl:apply-templates/></xsl:template>
  279. <xsl:template match="para"><hr class="para"/><xsl:apply-templates/></xsl:template>
  280. <xsl:template match="section"><h1 class="general"><xsl:apply-templates/></h1></xsl:template>
  281. <xsl:template match="subsection"><h2 class="general"><xsl:apply-templates/></h2></xsl:template>
  282. <xsl:template match="library">
  283. <div class="library">
  284. <span style="float:right; padding-right:2px; height: 6em"><h1 class="library">library</h1></span>
  285. <h1 class="library">
  286. <xsl:value-of select="@name"/>
  287. </h1>
  288. <xsl:if test="@description">
  289. <h2 class="library"><xsl:value-of select="@description"/></h2>
  290. </xsl:if>
  291. </div>
  292. <xsl:apply-templates/>
  293. </xsl:template>
  294. <xsl:template match="br"><br /></xsl:template>
  295. <xsl:template match="indent">&#160;&#160;&#160;&#160;</xsl:template>
  296. <xsl:template match="a">
  297. <xsl:choose>
  298. <xsl:when test="node()">
  299. <a>
  300. <xsl:attribute name="href"><xsl:value-of select="@href"/></xsl:attribute>
  301. <xsl:apply-templates/>
  302. </a>
  303. </xsl:when>
  304. <xsl:otherwise>
  305. <a>
  306. <xsl:attribute name="href"><xsl:value-of select="@href"/></xsl:attribute>
  307. <xsl:value-of select="@href"/>
  308. </a>
  309. </xsl:otherwise>
  310. </xsl:choose>
  311. </xsl:template>
  312. <xsl:template match="symbolref">
  313. <a><xsl:attribute name="href">#<xsl:value-of select="@name"/></xsl:attribute><code><xsl:value-of select="@name"/></code></a>
  314. </xsl:template>
  315. <xsl:template match="symbol">
  316. <li><span class="symbol"><a><xsl:attribute name="href">#<xsl:value-of select="@name"/></xsl:attribute><code><xsl:value-of select="@name"/></code></a>:</span><xsl:apply-templates/></li>
  317. </xsl:template>
  318. <xsl:template match="synonym">
  319. <li><span class="symbol"><code><xsl:value-of select="@name"/></code>:</span>Synonym for <a><xsl:attribute name="href">#<xsl:value-of select="@for"/></xsl:attribute><code><xsl:value-of select="@for"/></code></a><xsl:apply-templates/>.</li>
  320. </xsl:template>
  321. <xsl:template match="changelog">
  322. <li class="changelog"><h3 class="general"><xsl:value-of select="@date"/></h3>
  323. <ul><xsl:apply-templates/></ul></li>
  324. </xsl:template>
  325. <!-- fixes.inc -->
  326. <xsl:template match="fix">
  327. <a><xsl:attribute name="name">FIX_<xsl:value-of select="@name"/></xsl:attribute><h2><span style="float:right; padding-right:2px">fix</span><xsl:value-of select="@name"/></h2></a>
  328. <xsl:if test="@fixed">
  329. <p><b>Fixed in <xsl:value-of select="@fixed"/></b></p>
  330. </xsl:if>
  331. <xsl:if test="@disabled">
  332. <xsl:if test="@disabled='true'">
  333. <p><b>Disabled By Default</b></p>
  334. </xsl:if>
  335. </xsl:if>
  336. <h3>Problem</h3>
  337. <xsl:apply-templates select="problem"/>
  338. <h3>Solution</h3>
  339. <xsl:apply-templates select="solution"/>
  340. <xsl:if test="see">
  341. <h3>See</h3>
  342. <ul><xsl:apply-templates select="see"/></ul>
  343. </xsl:if>
  344. <xsl:if test="author">
  345. <h3>Author(s)</h3>
  346. <ul><xsl:apply-templates select="author"/></ul>
  347. </xsl:if>
  348. <xsl:if test="post">
  349. <h3>Post(s)</h3>
  350. <ul><xsl:apply-templates select="post"/></ul>
  351. </xsl:if>
  352. </xsl:template>
  353. <xsl:template match="post">
  354. <li class="post"><a><xsl:attribute name="href"><xsl:value-of select="@href"/></xsl:attribute><xsl:value-of select="@href"/></a></li>
  355. </xsl:template>
  356. <xsl:template match="see">
  357. <li class="see"><a><xsl:attribute name="href">#<xsl:apply-templates/></xsl:attribute><code><xsl:apply-templates/></code></a></li>
  358. </xsl:template>
  359. <xsl:template match="author">
  360. <li class="author">
  361. <xsl:choose>
  362. <xsl:when test="@href">
  363. <a><xsl:attribute name="href"><xsl:value-of select="@href"/></xsl:attribute><xsl:apply-templates/></a>
  364. </xsl:when>
  365. <xsl:otherwise>
  366. <xsl:apply-templates/>
  367. </xsl:otherwise>
  368. </xsl:choose>
  369. </li>
  370. </xsl:template>
  371. <xsl:template match="problem">
  372. <p><xsl:apply-templates/></p>
  373. </xsl:template>
  374. <xsl:template match="solution">
  375. <p><xsl:apply-templates/></p>
  376. </xsl:template>
  377. <xsl:template match="fixeslist"><xsl:apply-templates/></xsl:template>
  378. <xsl:template match="fixes">
  379. <li class="fixes"><a><xsl:attribute name="href">#FIX_<xsl:apply-templates/></xsl:attribute><xsl:apply-templates/></a></li>
  380. </xsl:template>
  381. </xsl:stylesheet>