1
0

pawndoc.xsl 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286
  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: x-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. OL { MARGIN-TOP: 0.5em; }
  39. SPAN.paraminfo { FONT-WEIGHT:Bold; COLOR: #336699; }
  40. H1 { COLOR: #336699; FONT-SIZE: x-large; MARGIN-BOTTOM: 0.5em; MARGIN-TOP: 1em; PADDING-LEFT: 4px }
  41. H2 { BORDER-RIGHT: #4e4887 8px solid; BORDER-TOP: #4e4887 2px solid; COLOR: #4e4887; MARGIN-BOTTOM: 0.5em; MARGIN-TOP: 1em; }
  42. H2.general { BORDER: none; }
  43. H3 { COLOR: #4e4887; FONT-SIZE: x-small; MARGIN-BOTTOM: 0.5em }
  44. H4 { COLOR: #4e4887; FONT-SIZE: x-small; FONT-STYLE: italic; MARGIN-BOTTOM: 0.5em }
  45. H5 { COLOR: #4e4887; FONT-SIZE: xx-small; MARGIN-BOTTOM: 0.5em }
  46. H6 { COLOR: #4e4887; FONT-SIZE: xx-small; FONT-STYLE: italic; MARGIN-BOTTOM: 0.5em }
  47. </STYLE>
  48. </HEAD>
  49. <BODY>
  50. <h1><xsl:value-of select="doc/assembly/name"/></h1>
  51. <xsl:apply-templates select="doc/general"/>
  52. <xsl:apply-templates select="doc/members/member"/>
  53. </BODY>
  54. </HTML>
  55. </xsl:template>
  56. <xsl:template match="general">
  57. <xsl:apply-templates/>
  58. <br/>
  59. </xsl:template>
  60. <xsl:template match="member">
  61. <xsl:choose>
  62. <xsl:when test="substring(@name,1,2) = 'T:'">
  63. <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>
  64. <xsl:apply-templates select="summary"/>
  65. <xsl:if test="remarks">
  66. <h3>Remarks</h3>
  67. <xsl:apply-templates select="remarks"/>
  68. </xsl:if>
  69. <xsl:if test="member">
  70. <h3>Members</h3>
  71. <blockquote>
  72. <xsl:apply-templates select="member"/>
  73. </blockquote>
  74. </xsl:if>
  75. <xsl:apply-templates select="example"/>
  76. <xsl:if test="referrer">
  77. <h3>Used by</h3>
  78. <ul><xsl:apply-templates select="referrer"/></ul>
  79. </xsl:if>
  80. <xsl:if test="dependency">
  81. <h3>Depends on</h3>
  82. <ul><xsl:apply-templates select="dependency"/></ul>
  83. </xsl:if>
  84. <xsl:if test="seealso">
  85. <h3>See Also</h3>
  86. <ul><xsl:apply-templates select="seealso"/></ul>
  87. </xsl:if>
  88. </xsl:when>
  89. <xsl:when test="substring(@name,1,2) = 'C:'">
  90. <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>
  91. <p class="noindent"><table><tr><td class="header inline">Value</td><td class="inline"><xsl:value-of select="@value"/></td></tr></table></p>
  92. <xsl:apply-templates select="summary"/>
  93. <xsl:apply-templates select="tagname"/>
  94. <xsl:apply-templates select="size"/>
  95. <xsl:if test="remarks">
  96. <h3>Remarks</h3>
  97. <xsl:apply-templates select="remarks"/>
  98. </xsl:if>
  99. <xsl:apply-templates select="example"/>
  100. <xsl:if test="referrer">
  101. <h3>Used by</h3>
  102. <ul><xsl:apply-templates select="referrer"/></ul>
  103. </xsl:if>
  104. <xsl:if test="dependency">
  105. <h3>Depends on</h3>
  106. <ul><xsl:apply-templates select="dependency"/></ul>
  107. </xsl:if>
  108. <xsl:if test="seealso">
  109. <h3>See Also</h3>
  110. <ul><xsl:apply-templates select="seealso"/></ul>
  111. </xsl:if>
  112. </xsl:when>
  113. <xsl:when test="substring(@name,1,2) = 'M:'">
  114. <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>
  115. <xsl:apply-templates select="summary"/>
  116. <h3>Syntax</h3><p class="syntax"><xsl:value-of select="@syntax"/></p>
  117. <xsl:if test="param">
  118. <p><table class="param"><xsl:apply-templates select="param"/></table></p>
  119. </xsl:if>
  120. <xsl:apply-templates select="tagname"/>
  121. <xsl:apply-templates select="returns"/>
  122. <xsl:if test="remarks">
  123. <h3>Remarks</h3>
  124. <xsl:apply-templates select="remarks"/>
  125. </xsl:if>
  126. <xsl:apply-templates select="example"/>
  127. <xsl:if test="referrer">
  128. <h3>Used by</h3>
  129. <ul><xsl:apply-templates select="referrer"/></ul>
  130. </xsl:if>
  131. <xsl:if test="dependency">
  132. <h3>Depends on</h3>
  133. <ul><xsl:apply-templates select="dependency"/></ul>
  134. </xsl:if>
  135. <xsl:if test="attribute">
  136. <h3>Attributes</h3>
  137. <ul><xsl:apply-templates select="attribute"/></ul>
  138. </xsl:if>
  139. <xsl:apply-templates select="automaton"/>
  140. <xsl:if test="transition">
  141. <h3>Transition table</h3>
  142. <p>
  143. <table class="transition">
  144. <tr><th>Source</th><th>Target</th><th>Condition</th></tr>
  145. <xsl:apply-templates select="transition"/>
  146. </table>
  147. </p>
  148. </xsl:if>
  149. <xsl:apply-templates select="stacksize"/>
  150. <xsl:if test="seealso">
  151. <h3>See Also</h3>
  152. <ul><xsl:apply-templates select="seealso"/></ul>
  153. </xsl:if>
  154. </xsl:when>
  155. <xsl:when test="substring(@name,1,2) = 'F:'">
  156. <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>
  157. <xsl:apply-templates select="summary"/>
  158. <xsl:apply-templates select="tagname"/>
  159. <xsl:if test="remarks">
  160. <h3>Remarks</h3>
  161. <xsl:apply-templates select="remarks"/>
  162. </xsl:if>
  163. <xsl:apply-templates select="example"/>
  164. <xsl:if test="referrer">
  165. <h3>Used by</h3>
  166. <ul><xsl:apply-templates select="referrer"/></ul>
  167. </xsl:if>
  168. <xsl:if test="dependency">
  169. <h3>Depends on</h3>
  170. <ul><xsl:apply-templates select="dependency"/></ul>
  171. </xsl:if>
  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:choose>
  178. </xsl:template>
  179. <xsl:template match="summary">
  180. <p><xsl:apply-templates/></p>
  181. </xsl:template>
  182. <xsl:template match="param">
  183. <tr>
  184. <td class="param"><xsl:value-of select="@name"/></td>
  185. <td><xsl:apply-templates/></td>
  186. </tr>
  187. </xsl:template>
  188. <xsl:template match="paraminfo">
  189. <span class="paraminfo">&lt;<xsl:apply-templates/>&gt;</span>
  190. </xsl:template>
  191. <xsl:template match="tagname">
  192. <p class="noindent"><table><tr>
  193. <td class="header inline">Tag</td>
  194. <td class="inline"><xsl:value-of select="@value"/></td>
  195. </tr></table></p>
  196. </xsl:template>
  197. <xsl:template match="size">
  198. <p class="noindent"><table><tr>
  199. <td class="header inline">Size</td>
  200. <td class="inline"><xsl:value-of select="@value"/></td>
  201. </tr></table></p>
  202. </xsl:template>
  203. <xsl:template match="returns">
  204. <h3>Returns</h3>
  205. <p><xsl:apply-templates/></p>
  206. </xsl:template>
  207. <xsl:template match="remarks">
  208. <p><xsl:apply-templates/></p>
  209. </xsl:template>
  210. <xsl:template match="example">
  211. <h3>Example</h3>
  212. <p><xsl:apply-templates/></p>
  213. </xsl:template>
  214. <xsl:template match="attribute">
  215. <li class="attribute"><xsl:value-of select="@name"/></li>
  216. </xsl:template>
  217. <xsl:template match="referrer">
  218. <li class="referrer"><a><xsl:attribute name="href">#<xsl:value-of select="@name"/></xsl:attribute><xsl:value-of select="@name"/>()</a></li>
  219. </xsl:template>
  220. <xsl:template match="dependency">
  221. <li class="dependency"><a><xsl:attribute name="href">#<xsl:value-of select="@name"/></xsl:attribute><xsl:value-of select="@name"/>()</a></li>
  222. </xsl:template>
  223. <xsl:template match="stacksize">
  224. <h3>Estimated stack usage</h3>
  225. <p><xsl:value-of select="@value"/> cells</p>
  226. </xsl:template>
  227. <xsl:template match="automaton">
  228. <h3>Automaton</h3>
  229. <p><xsl:value-of select="@name"/></p>
  230. </xsl:template>
  231. <xsl:template match="transition">
  232. <tr>
  233. <td class="transition"><xsl:value-of select="@source"/></td>
  234. <td class="transition"><xsl:value-of select="@target"/></td>
  235. <td><xsl:value-of select="@condition"/></td>
  236. </tr>
  237. </xsl:template>
  238. <xsl:template match="code">
  239. <pre><xsl:apply-templates/></pre>
  240. </xsl:template>
  241. <xsl:template match="seealso">
  242. <li class="seealso"><a><xsl:attribute name="href">#<xsl:value-of select="@name"/></xsl:attribute><xsl:value-of select="@name"/>()</a></li>
  243. </xsl:template>
  244. <xsl:template match="paramref">
  245. <i><xsl:value-of select="@name"/></i>
  246. </xsl:template>
  247. <xsl:template match="c"><code><xsl:apply-templates/></code></xsl:template>
  248. <xsl:template match="em"><em><xsl:apply-templates/></em></xsl:template>
  249. <xsl:template match="ul"><ul><xsl:apply-templates/></ul></xsl:template>
  250. <xsl:template match="ol"><ol><xsl:apply-templates/></ol></xsl:template>
  251. <xsl:template match="li"><li><xsl:apply-templates/></li></xsl:template>
  252. <xsl:template match="p"><hr class="para"/><xsl:apply-templates/></xsl:template>
  253. <xsl:template match="para"><hr class="para"/><xsl:apply-templates/></xsl:template>
  254. <xsl:template match="section"><h2 class="general"><xsl:apply-templates/></h2></xsl:template>
  255. <xsl:template match="subsection"><h3 class="general"><xsl:apply-templates/></h3></xsl:template>
  256. </xsl:stylesheet>