atomictemplate.xsl 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349
  1. <?xml version="1.0"?>
  2. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  3. <xsl:output
  4. encoding="UTF-8"
  5. indent="yes"
  6. method="xml"
  7. omit-xml-declaration="yes"
  8. />
  9. <xsl:template match="Page">
  10. <html>
  11. <head>
  12. <title>
  13. <xsl:value-of select="Title" />
  14. </title>
  15. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  16. <xsl:call-template name="create-default-style" />
  17. <xsl:call-template name="create-default-script" />
  18. </head>
  19. <body>
  20. <!-- HEADER -->
  21. <xsl:call-template name="create-default-collection-title" />
  22. <xsl:call-template name="create-index" />
  23. <xsl:call-template name="create-default-title" />
  24. <xsl:call-template name="create-default-summary" />
  25. <xsl:call-template name="create-default-signature" />
  26. <xsl:call-template name="create-default-remarks" />
  27. <xsl:call-template name="create-default-members" />
  28. <hr size="1" />
  29. <xsl:call-template name="create-default-copyright" />
  30. </body>
  31. </html>
  32. </xsl:template>
  33. <!-- IDENTITY TRANSFORMATION -->
  34. <xsl:template match="@*|node()">
  35. <xsl:copy>
  36. <xsl:apply-templates select="@*|node()" />
  37. </xsl:copy>
  38. </xsl:template>
  39. <xsl:template name="create-default-style">
  40. <style>
  41. a { text-decoration: none }
  42. div.SideBar {
  43. padding-left: 1em;
  44. padding-right: 1em;
  45. right: 0;
  46. float: right;
  47. border: thin solid black;
  48. background-color: #f2f2f2;
  49. }
  50. .CollectionTitle { font-weight: bold }
  51. .PageTitle { font-size: 150%; font-weight: bold }
  52. .Summary { }
  53. .Signature { }
  54. .Remarks { }
  55. .Members { }
  56. .Copyright { }
  57. .Section { font-size: 125%; font-weight: bold }
  58. p.Summary {
  59. margin-left: 1em;
  60. }
  61. .SectionBox { margin-left: 2em }
  62. .NamespaceName { font-size: 105%; font-weight: bold }
  63. .NamespaceSumary { }
  64. .MemberName { font-size: 115%; font-weight: bold; margin-top: 1em }
  65. .Subsection { font-size: 105%; font-weight: bold }
  66. .SubsectionBox { margin-left: 2em; margin-bottom: 1em }
  67. .CodeExampleTable { background-color: #f5f5dd; border: thin solid black; padding: .25em; }
  68. .TypesListing {
  69. border-collapse: collapse;
  70. }
  71. td {
  72. vertical-align: top;
  73. }
  74. th {
  75. text-align: left;
  76. }
  77. .TypesListing td {
  78. margin: 0px;
  79. padding: .25em;
  80. border: solid gray 1px;
  81. }
  82. .TypesListing th {
  83. margin: 0px;
  84. padding: .25em;
  85. background-color: #f2f2f2;
  86. border: solid gray 1px;
  87. }
  88. div.Footer {
  89. border-top: 1px solid gray;
  90. margin-top: 1.5em;
  91. padding-top: 0.6em;
  92. text-align: center;
  93. color: gray;
  94. }
  95. span.NotEntered /* Documentation for this section has not yet been entered */ {
  96. font-style: italic;
  97. color: red;
  98. display: none;
  99. }
  100. div.Header {
  101. background: #B0C4DE;
  102. border: double;
  103. border-color: white;
  104. border-width: 7px;
  105. padding: 0.5em;
  106. }
  107. div.Header * {
  108. font-size: smaller;
  109. }
  110. div.Note {
  111. }
  112. i.ParamRef {
  113. }
  114. i.subtitle {
  115. }
  116. ul.TypeMembersIndex {
  117. text-align: left;
  118. background: #F8F8F8;
  119. }
  120. ul.TypeMembersIndex li {
  121. display: inline;
  122. margin: 0.5em;
  123. }
  124. table.HeaderTable {
  125. }
  126. table.SignatureTable {
  127. }
  128. table.Documentation, table.Enumeration, table.TypeDocumentation {
  129. border-collapse: collapse;
  130. width: 100%;
  131. }
  132. table.Documentation tr th, table.TypeMembers tr th, table.Enumeration tr th, table.TypeDocumentation tr th {
  133. background: whitesmoke;
  134. padding: 0.8em;
  135. border: 1px solid gray;
  136. text-align: left;
  137. vertical-align: bottom;
  138. }
  139. table.Documentation tr td, table.TypeMembers tr td, table.Enumeration tr td, table.TypeDocumentation tr td {
  140. padding: 0.5em;
  141. border: 1px solid gray;
  142. text-align: left;
  143. vertical-align: top;
  144. }
  145. table.TypeMembers {
  146. border: 1px solid #C0C0C0;
  147. width: 100%;
  148. }
  149. table.TypeMembers tr td {
  150. background: #F8F8F8;
  151. border: white;
  152. }
  153. table.Documentation {
  154. }
  155. table.TypeMembers {
  156. }
  157. div.CodeExample {
  158. width: 100%;
  159. border: 1px solid #DDDDDD;
  160. background-color: #F8F8F8;
  161. }
  162. div.CodeExample p {
  163. margin: 0.5em;
  164. border-bottom: 1px solid #DDDDDD;
  165. }
  166. div.CodeExample div {
  167. margin: 0.5em;
  168. }
  169. h4 {
  170. margin-bottom: 0;
  171. }
  172. div.Signature {
  173. border: 1px solid #C0C0C0;
  174. background: #F2F2F2;
  175. padding: 1em;
  176. }
  177. </style>
  178. </xsl:template>
  179. <xsl:template name="create-default-script">
  180. <script type="text/JavaScript">
  181. function toggle_display (block) {
  182. var w = document.getElementById (block);
  183. var t = document.getElementById (block + ":toggle");
  184. if (w.style.display == "none") {
  185. w.style.display = "block";
  186. t.innerHTML = "⊟";
  187. } else {
  188. w.style.display = "none";
  189. t.innerHTML = "⊞";
  190. }
  191. }
  192. </script>
  193. </xsl:template>
  194. <xsl:template name="create-index">
  195. <xsl:if test="
  196. count(PageTitle/@id) &gt; 0 and
  197. (count(Signature/@id) &gt; 0 or count(Signature/div/@id) &gt; 0) and
  198. count(Remarks/@id) &gt; 0 and
  199. count(Members/@id) &gt; 0
  200. ">
  201. <div class="SideBar">
  202. <p>
  203. <a>
  204. <xsl:attribute name="href">
  205. <xsl:text>#</xsl:text>
  206. <xsl:value-of select="PageTitle/@id" />
  207. </xsl:attribute>
  208. <xsl:text>Overview</xsl:text>
  209. </a>
  210. </p>
  211. <p>
  212. <a>
  213. <xsl:attribute name="href">
  214. <xsl:text>#</xsl:text>
  215. <xsl:value-of select="Signature/@id" />
  216. <xsl:value-of select="Signature/div/@id" />
  217. </xsl:attribute>
  218. <xsl:text>Signature</xsl:text>
  219. </a>
  220. </p>
  221. <p>
  222. <a>
  223. <xsl:attribute name="href">
  224. <xsl:text>#</xsl:text>
  225. <xsl:value-of select="Remarks/@id" />
  226. </xsl:attribute>
  227. <xsl:text>Remarks</xsl:text>
  228. </a>
  229. </p>
  230. <p>
  231. <a href="#Members">Members</a>
  232. </p>
  233. <p>
  234. <a>
  235. <xsl:attribute name="href">
  236. <xsl:text>#</xsl:text>
  237. <xsl:value-of select="Members/@id" />
  238. </xsl:attribute>
  239. <xsl:text>Member Details</xsl:text>
  240. </a>
  241. </p>
  242. </div>
  243. </xsl:if>
  244. </xsl:template>
  245. <xsl:template name="create-default-collection-title">
  246. <div class="CollectionTitle">
  247. <xsl:apply-templates select="CollectionTitle/node()" />
  248. </div>
  249. </xsl:template>
  250. <xsl:template name="create-default-title">
  251. <h1 class="PageTitle">
  252. <xsl:if test="count(PageTitle/@id) &gt; 0">
  253. <xsl:attribute name="id">
  254. <xsl:value-of select="PageTitle/@id" />
  255. </xsl:attribute>
  256. </xsl:if>
  257. <xsl:apply-templates select="PageTitle/node()" />
  258. </h1>
  259. </xsl:template>
  260. <xsl:template name="create-default-summary">
  261. <p class="Summary">
  262. <xsl:if test="count(Summary/@id) &gt; 0">
  263. <xsl:attribute name="id">
  264. <xsl:value-of select="Summary/@id" />
  265. </xsl:attribute>
  266. </xsl:if>
  267. <xsl:apply-templates select="Summary/node()" />
  268. </p>
  269. </xsl:template>
  270. <xsl:template name="create-default-signature">
  271. <div>
  272. <xsl:if test="count(Signature/@id) &gt; 0">
  273. <xsl:attribute name="id">
  274. <xsl:value-of select="Signature/@id" />
  275. </xsl:attribute>
  276. </xsl:if>
  277. <xsl:apply-templates select="Signature/node()" />
  278. </div>
  279. </xsl:template>
  280. <xsl:template name="create-default-remarks">
  281. <div class="Remarks">
  282. <xsl:if test="count(Remarks/@id) &gt; 0">
  283. <xsl:attribute name="id">
  284. <xsl:value-of select="Remarks/@id" />
  285. </xsl:attribute>
  286. </xsl:if>
  287. <xsl:apply-templates select="Remarks/node()" />
  288. </div>
  289. </xsl:template>
  290. <xsl:template name="create-default-members">
  291. <div class="Members">
  292. <xsl:if test="count(Members/@id) &gt; 0">
  293. <xsl:attribute name="id">
  294. <xsl:value-of select="Members/@id" />
  295. </xsl:attribute>
  296. </xsl:if>
  297. <xsl:apply-templates select="Members/node()" />
  298. </div>
  299. </xsl:template>
  300. <xsl:template name="create-default-copyright">
  301. <div class="Copyright">
  302. <xsl:apply-templates select="Copyright/node()" />
  303. </div>
  304. </xsl:template>
  305. </xsl:stylesheet>