ndai | a5b2766 | 2005-07-09 19:41:27 +0000 | [diff] [blame] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?> |
| 2 | <xsl:stylesheet version="1.0" |
| 3 | xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> |
| 4 | |
| 5 | <xsl:template match="/"> |
| 6 | <html> |
| 7 | <script language="javascript"> |
| 8 | function showComponentsOnly() |
| 9 | { |
| 10 | toggleDiv("component::", false); |
| 11 | toggleDiv("class::", false); |
| 12 | } |
| 13 | function showClassesOnly() |
| 14 | { |
| 15 | toggleDiv("component::", true); |
| 16 | toggleDiv("class::", false); |
| 17 | } |
| 18 | function showAll() |
| 19 | { |
| 20 | toggleDiv("component::", true); |
| 21 | toggleDiv("class::", true); |
| 22 | } |
| 23 | function toggleDiv(prefix, show) |
| 24 | { |
| 25 | var divs = document.getElementsByTagName("div"); |
| 26 | for (var i = 0; i < divs.length; i++) |
| 27 | { |
| 28 | if (divs[i].id.indexOf(prefix) == 0) |
| 29 | { |
| 30 | var img = document.getElementById(divs[i].id + "::twist"); |
| 31 | if (show) |
| 32 | { |
| 33 | if (img != null) |
| 34 | { |
| 35 | img.src = "twistopened.gif"; |
| 36 | } |
| 37 | divs[i].style.display = ""; |
| 38 | } |
| 39 | else |
| 40 | { |
| 41 | if (img != null) |
| 42 | { |
| 43 | img.src = "twistclosed.gif"; |
| 44 | } |
| 45 | divs[i].style.display = "none"; |
| 46 | } |
| 47 | } |
| 48 | } |
| 49 | } |
| 50 | function toggle(id) |
| 51 | { |
| 52 | var div = document.getElementById(id); |
| 53 | var img = document.getElementById(id + "::twist"); |
| 54 | if (div.style.display == "") |
| 55 | { |
| 56 | img.src = "twistclosed.gif"; |
| 57 | div.style.display = "none"; |
| 58 | } |
| 59 | else |
| 60 | { |
| 61 | img.src = "twistopened.gif"; |
| 62 | div.style.display = ""; |
| 63 | } |
| 64 | } |
| 65 | </script> |
| 66 | <body> |
| 67 | <table width="100%" cellspacing="5" cellpadding="2" border="0"> |
| 68 | <tbody> |
| 69 | <tr> |
| 70 | <td width="60%" align="left"> |
| 71 | <font style="font-size: x-large;; font-family: Verdana, Arial, Helvetica, sans-serif; font-weight: bold">Eclipse WTP Component API Violation Report</font> |
| 72 | </td> |
| 73 | <td width="40%"> |
| 74 | <img width="120" hspace="50" height="86" align="middle" src="Idea.jpg"/> |
| 75 | </td> |
| 76 | </tr> |
| 77 | </tbody> |
| 78 | </table> |
| 79 | <table WIDTH="100%" CELLPADDING="2" CELLSPACING="5" BORDER="0"> |
| 80 | <tr> |
| 81 | <td BGCOLOR="#0080C0" COLSPAN="2" VALIGN="TOP" ALIGN="LEFT"><b><font face="Arial,Helvetica" color="#FFFFFF">Component API violation report</font></b></td> |
| 82 | </tr> |
| 83 | </table> |
| 84 | <table border="0"> |
| 85 | <tr><td><a href="javascript:showComponentsOnly()">Show components only</a></td></tr> |
| 86 | <tr><td><a href="javascript:showClassesOnly()">Show classes only</a></td></tr> |
| 87 | <tr><td><a href="javascript:showAll()">Show all</a></td></tr> |
| 88 | <tr><td> </td></tr> |
| 89 | </table> |
| 90 | <font face="Arial,Helvetica"> |
| 91 | <xsl:for-each select="component-summary/component"> |
| 92 | <xsl:sort select="@name"/> |
| 93 | <xsl:variable name="report" select="document(@ref)/component-api-violation"/> |
| 94 | <xsl:if test="$report/class"> |
| 95 | <xsl:apply-templates select="$report"/> |
| 96 | </xsl:if> |
| 97 | </xsl:for-each> |
| 98 | </font> |
| 99 | </body> |
| 100 | </html> |
| 101 | </xsl:template> |
| 102 | |
| 103 | <xsl:template match="component-api-violation"> |
| 104 | <table border="0"> |
| 105 | <tr> |
| 106 | <td> |
| 107 | <a href="javascript:toggle('component::{@name}')"><img id="component::{@name}::twist" border="0" src="twistopened.gif"/></a>  |
| 108 | <xsl:value-of select="@name"/>  |
| 109 | </td> |
| 110 | </tr> |
| 111 | <tr> |
| 112 | <td> |
| 113 | <div id="component::{@name}"> |
| 114 | <table border="0"> |
| 115 | <xsl:for-each select="class"> |
| 116 | <xsl:sort select="@name"/> |
| 117 | <xsl:apply-templates select="."/> |
| 118 | </xsl:for-each> |
| 119 | </table> |
| 120 | </div> |
| 121 | </td> |
| 122 | </tr> |
| 123 | </table> |
| 124 | </xsl:template> |
| 125 | |
| 126 | <xsl:template match="class"> |
| 127 | <tr> |
| 128 | <td> |
| 129 | <img border="0" src="space.gif"/> |
| 130 | <a href="javascript:toggle('class::{@name}')"><img id="class::{@name}::twist" border="0" src="twistopened.gif"/></a>  |
| 131 | <xsl:value-of select="@name"/>  |
| 132 | <div id="class::{@name}"> |
| 133 | <ol> |
| 134 | <xsl:if test="super"> |
| 135 | <li><b>Super class</b> <xsl:value-of select="super/@name"/> is not an API</li> |
| 136 | </xsl:if> |
| 137 | <xsl:for-each select="method"> |
| 138 | <xsl:sort select="@name"/> |
| 139 | <li> |
| 140 | <b>Method</b> <xsl:value-of select="@name"/> |
| 141 | <ul> |
| 142 | <xsl:for-each select="param"> |
| 143 | <li><b>Param type</b> <xsl:value-of select="@name"/> is not an API</li> |
| 144 | </xsl:for-each> |
| 145 | <xsl:if test="return"> |
| 146 | <li><b>Return type</b> <xsl:value-of select="return/@name"/> is not an API</li> |
| 147 | </xsl:if> |
| 148 | <xsl:for-each select="throw"> |
| 149 | <li><b>Throw type</b> <xsl:value-of select="@name"/> is not an API</li> |
| 150 | </xsl:for-each> |
| 151 | </ul> |
| 152 | </li> |
| 153 | </xsl:for-each> |
| 154 | <xsl:for-each select="field"> |
| 155 | <xsl:sort select="@name"/> |
| 156 | <li><b>Field</b> <xsl:value-of select="@name"/>: <xsl:value-of select="@type"/> is not an API</li> |
| 157 | </xsl:for-each> |
| 158 | </ol> |
| 159 | </div> |
| 160 | </td> |
| 161 | </tr> |
| 162 | </xsl:template> |
| 163 | |
| 164 | </xsl:stylesheet> |