DiffToHTML.xsl 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304
  1. <?xml version="1.0"?>
  2. <!--
  3. Copyright (c) 2001-2009, Jean Tessier
  4. All rights reserved.
  5. Redistribution and use in source and binary forms, with or without
  6. modification, are permitted provided that the following conditions
  7. are met:
  8. * Redistributions of source code must retain the above copyright
  9. notice, this list of conditions and the following disclaimer.
  10. * Redistributions in binary form must reproduce the above copyright
  11. notice, this list of conditions and the following disclaimer in the
  12. documentation and/or other materials provided with the distribution.
  13. * Neither the name of Jean Tessier nor the names of his contributors
  14. may be used to endorse or promote products derived from this software
  15. without specific prior written permission.
  16. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  17. "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  18. LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  19. A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR
  20. CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  21. EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  22. PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  23. PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
  24. LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  25. NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  26. SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  27. -->
  28. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  29. <xsl:strip-space elements="*"/>
  30. <xsl:template match="differences">
  31. <html>
  32. <head>
  33. <title><xsl:if test="name/text()"><xsl:value-of select="name"/> - </xsl:if>API Change History</title>
  34. </head>
  35. <body bgcolor="#ffffff">
  36. <h1><xsl:if test="name/text()"><xsl:value-of select="name"/> - </xsl:if>API Change History</h1>
  37. <ul>
  38. <li><a href="#{new}"><xsl:value-of select="old"/> to <xsl:value-of select="new"/></a></li>
  39. </ul>
  40. <hr />
  41. <a name="{new}" />
  42. <h2><xsl:value-of select="old"/> to <xsl:value-of select="new"/></h2>
  43. <xsl:apply-templates/>
  44. <hr />
  45. </body>
  46. </html>
  47. </xsl:template>
  48. <xsl:template match="differences/name | old | new"/>
  49. <xsl:template match="removed-packages">
  50. <h3>Removed Packages:</h3>
  51. <ul>
  52. <xsl:apply-templates/>
  53. </ul>
  54. </xsl:template>
  55. <xsl:template match="removed-interfaces">
  56. <h3>Removed Interfaces:</h3>
  57. <ul>
  58. <xsl:apply-templates/>
  59. </ul>
  60. </xsl:template>
  61. <xsl:template match="removed-classes">
  62. <h3>Removed Classes:</h3>
  63. <ul>
  64. <xsl:apply-templates/>
  65. </ul>
  66. </xsl:template>
  67. <xsl:template match="deprecated-interfaces">
  68. <h3>Newly Deprecated Interfaces:</h3>
  69. <ul>
  70. <xsl:apply-templates/>
  71. </ul>
  72. </xsl:template>
  73. <xsl:template match="deprecated-classes">
  74. <h3>Newly Deprecated Classes:</h3>
  75. <ul>
  76. <xsl:apply-templates/>
  77. </ul>
  78. </xsl:template>
  79. <xsl:template match="modified-interfaces">
  80. <h3>Modified Interfaces:</h3>
  81. <blockquote>
  82. <xsl:apply-templates/>
  83. </blockquote>
  84. </xsl:template>
  85. <xsl:template match="modified-classes">
  86. <h3>Modified Classes:</h3>
  87. <blockquote>
  88. <xsl:apply-templates/>
  89. </blockquote>
  90. </xsl:template>
  91. <xsl:template match="undeprecated-interfaces">
  92. <h3>Formerly Deprecated Interfaces:</h3>
  93. <ul>
  94. <xsl:apply-templates/>
  95. </ul>
  96. </xsl:template>
  97. <xsl:template match="undeprecated-classes">
  98. <h3>Formerly Deprecated Classes:</h3>
  99. <ul>
  100. <xsl:apply-templates/>
  101. </ul>
  102. </xsl:template>
  103. <xsl:template match="new-packages">
  104. <h3>New Packages:</h3>
  105. <ul>
  106. <xsl:apply-templates/>
  107. </ul>
  108. </xsl:template>
  109. <xsl:template match="new-interfaces">
  110. <h3>New Interfaces:</h3>
  111. <ul>
  112. <xsl:apply-templates/>
  113. </ul>
  114. </xsl:template>
  115. <xsl:template match="new-classes">
  116. <h3>New Classes:</h3>
  117. <ul>
  118. <xsl:apply-templates/>
  119. </ul>
  120. </xsl:template>
  121. <xsl:template match="class">
  122. <h4><code><xsl:value-of select="name"/></code></h4>
  123. <blockquote>
  124. <xsl:apply-templates/>
  125. </blockquote>
  126. </xsl:template>
  127. <xsl:template match="removed-fields">
  128. <h5>Removed Fields:</h5>
  129. <ul>
  130. <xsl:apply-templates/>
  131. </ul>
  132. </xsl:template>
  133. <xsl:template match="removed-constructors">
  134. <h5>Removed Constructors:</h5>
  135. <ul>
  136. <xsl:apply-templates/>
  137. </ul>
  138. </xsl:template>
  139. <xsl:template match="removed-methods">
  140. <h5>Removed Methods:</h5>
  141. <ul>
  142. <xsl:apply-templates/>
  143. </ul>
  144. </xsl:template>
  145. <xsl:template match="deprecated-fields">
  146. <h5>Newly Deprecated Fields:</h5>
  147. <ul>
  148. <xsl:apply-templates/>
  149. </ul>
  150. </xsl:template>
  151. <xsl:template match="deprecated-constructors">
  152. <h5>Newly Deprecated Constructors:</h5>
  153. <ul>
  154. <xsl:apply-templates/>
  155. </ul>
  156. </xsl:template>
  157. <xsl:template match="deprecated-methods">
  158. <h5>Newly Deprecated Methods:</h5>
  159. <ul>
  160. <xsl:apply-templates/>
  161. </ul>
  162. </xsl:template>
  163. <xsl:template match="modified-fields">
  164. <h5>Field Declaration Changes:</h5>
  165. <xsl:apply-templates/>
  166. </xsl:template>
  167. <xsl:template match="modified-constructors">
  168. <h5>Constructor Changes:</h5>
  169. <xsl:apply-templates/>
  170. </xsl:template>
  171. <xsl:template match="modified-methods">
  172. <h5>Method Changes:</h5>
  173. <xsl:apply-templates/>
  174. </xsl:template>
  175. <xsl:template match="feature">
  176. <blockquote>
  177. <p><nobr><code>
  178. <xsl:apply-templates/>
  179. </code></nobr></p>
  180. </blockquote>
  181. </xsl:template>
  182. <xsl:template match="modified-code">
  183. <b>code:</b> <xsl:value-of select="."/>
  184. </xsl:template>
  185. <xsl:template match="modified-declaration">
  186. <b>old:</b> <xsl:value-of select="old-declaration"/>
  187. <xsl:if test="old-declaration[@deprecated='yes']"> <b>[deprecated]</b></xsl:if>
  188. <br/>
  189. <b>new:</b> <xsl:value-of select="new-declaration"/>
  190. <xsl:if test="new-declaration[@deprecated='yes']"> <b>[deprecated]</b></xsl:if>
  191. <xsl:if test="../modified-code"><br/></xsl:if>
  192. </xsl:template>
  193. <xsl:template match="undeprecated-fields">
  194. <h5>Formerly Deprecated Fields:</h5>
  195. <ul>
  196. <xsl:apply-templates/>
  197. </ul>
  198. </xsl:template>
  199. <xsl:template match="undeprecated-constructors">
  200. <h5>Formerly Deprecated Constructors:</h5>
  201. <ul>
  202. <xsl:apply-templates/>
  203. </ul>
  204. </xsl:template>
  205. <xsl:template match="undeprecated-methods">
  206. <h5>Formerly Deprecated Methods:</h5>
  207. <ul>
  208. <xsl:apply-templates/>
  209. </ul>
  210. </xsl:template>
  211. <xsl:template match="new-fields">
  212. <h5>New Fields:</h5>
  213. <ul>
  214. <xsl:apply-templates/>
  215. </ul>
  216. </xsl:template>
  217. <xsl:template match="new-constructors">
  218. <h5>New Constructors:</h5>
  219. <ul>
  220. <xsl:apply-templates/>
  221. </ul>
  222. </xsl:template>
  223. <xsl:template match="new-methods">
  224. <h5>New Methods:</h5>
  225. <ul>
  226. <xsl:apply-templates/>
  227. </ul>
  228. </xsl:template>
  229. <xsl:template match="class/name | feature/name"/>
  230. <xsl:template match="class/modified-declaration">
  231. <h5>Declaration Changes:</h5>
  232. <blockquote>
  233. <p><nobr><code>
  234. <b>old:</b> <xsl:value-of select="old-declaration"/>
  235. <xsl:if test="old-declaration[@deprecated='yes']"> <b>[deprecated]</b></xsl:if>
  236. <br/>
  237. <b>new:</b> <xsl:value-of select="new-declaration"/>
  238. <xsl:if test="new-declaration[@deprecated='yes']"> <b>[deprecated]</b></xsl:if>
  239. </code></nobr></p>
  240. </blockquote>
  241. </xsl:template>
  242. <xsl:template match="new-packages/name[@deprecated='yes'] | new-interfaces/name[@deprecated='yes'] | new-classes/name[@deprecated='yes'] | new-fields/declaration[@deprecated='yes'] | new-constructors/declaration[@deprecated='yes'] | new-methods/declaration[@deprecated='yes']">
  243. <li><nobr><code><xsl:value-of select="."/> <b>[deprecated]</b></code></nobr></li>
  244. </xsl:template>
  245. <xsl:template match="name | declaration">
  246. <li><nobr><code><xsl:value-of select="."/></code></nobr></li>
  247. </xsl:template>
  248. </xsl:stylesheet>