2 <xsl:stylesheet version=
"1.0"
3 xmlns:
xsl=
"http://www.w3.org/1999/XSL/Transform"
4 xmlns=
"http://www.w3.org/TR/xhtml1/strict">
5 <xsl:output method=
"html"/>
7 <xsl:variable name=
"fxcop.root" select=
"//FxCopReport"/>
9 <xsl:template match=
"/">
11 <head><title>Analysis Report
</title></head>
13 #Title {font-family: Verdana; font-size:
14pt; color: black; font-weight: bold}
14 .ColumnHeader {font-family: Verdana; font-size:
8pt; background-color:white; color: black}
15 .CriticalError {font-family: Verdana; font-size:
8pt; color: darkred; font-weight: bold; text-align: center}
16 .Error {font-family: Verdana; font-size:
8pt; color: royalblue; font-weight: bold; text-align: center}
17 .CriticalWarning {font-family: Verdana; font-size:
8pt; color: green; font-weight: bold; text-align: center}
18 .Warning {font-family: Verdana; font-size:
8pt; color: darkgray; font-weight: bold; text-align: center}
19 .Information {font-family: Verdana; font-size:
8pt; color: black; font-weight: bold; text-align: center}
21 .PropertyName {font-family: Verdana; font-size:
8pt; color: black; font-weight: bold}
22 .PropertyContent {font-family: Verdana; font-size:
8pt; color: black}
23 .NodeIcon { font-family: WebDings; font-size:
12pt; color: navy; padding-right:
5;}
24 .MessagesIcon { font-family: WebDings; font-size:
12pt; color: red;}
25 .RuleDetails { padding-top:
10;}
26 .SourceCode { background-color:#DDDDFF; }
27 .RuleBlock { background-color:#EEEEFF; }
28 .MessageNumber { font-family: Verdana; font-size:
10pt; color: darkred; }
29 .MessageBlock { font-family: Verdana; font-size:
10pt; color: darkred; }
30 .Resolution {font-family: Verdana; font-size:
8pt; color: black; }
31 .NodeLine { font-family: Verdana; font-size:
9pt;}
32 .Note { font-family: Verdana; font-size:
9pt; color:black; background-color: #DDDDFF; }
33 .NoteUser { font-family: Verdana; font-size:
9pt; font-weight: bold; }
34 .NoteTime { font-family: Verdana; font-size:
8pt; font-style: italic; }
35 .Button { font-family: Verdana; font-size:
9pt; color: blue; background-color: #EEEEEE; }
38 function ViewState(blockId)
40 var block = document.getElementById(blockId);
41 if (block.style.display=='none')
43 block.style.display='block';
47 block.style.display='none';
51 function SwitchAll(how)
53 var nodes = document.getElementsByTagName(
"div");
54 for (i =
0; i != nodes.length;i++)
59 if (block.className == 'NodeDiv'
60 || block.className == 'MessageBlockDiv'
61 || block.className == 'MessageDiv')
63 block.style.display=how;
74 function CollapseAll()
79 <body bgcolor=
"white" alink=
"Black" vlink=
"Black" link=
"Black">
80 <xsl:apply-templates select=
"$fxcop.root"/>
86 <xsl:template match=
"FxCopReport">
89 FxCop
<xsl:value-of select=
"@Version"/> Analysis Report
95 <a onClick=
"ExpandAll();">Expand All
</a>
98 <a onClick=
"CollapseAll();">Collapse All
</a>
103 <xsl:apply-templates select=
"Namespaces"/>
105 <xsl:when test=
"Namespaces">
109 <xsl:apply-templates select=
"Targets"/>
112 <xsl:template match=
"*">
114 <xsl:when test=
"@Name or name()='Resources'">
115 <xsl:variable name=
"MessageCount" select=
"count(.//Message[@Status='Active'])"/>
117 <xsl:when test=
"$MessageCount > 0">
118 <xsl:variable name=
"nodeId" select=
"generate-id()"/>
119 <div class=
"NodeLine">
121 <xsl:attribute name=
"onClick">
122 javascript:ViewState('
<xsl:value-of select=
"$nodeId"/>');
125 <!-- Display Icon -->
127 <xsl:when test=
"name()='Member' and @Kind='Method'">
128 <nobr class=
"NodeIcon">a</nobr>
130 <xsl:when test=
"name()='Member' and @Kind='Constructor'">
131 <nobr class=
"NodeIcon">=</nobr>
133 <xsl:when test=
"name()='Member' and @Kind='Property'">
134 <nobr class=
"NodeIcon">˜</nobr>
136 <xsl:when test=
"name()='Member' and @Kind='Event'">
137 <nobr class=
"NodeIcon">~</nobr>
139 <xsl:when test=
"name()='Member' and @Kind='Field'">
140 <nobr class=
"NodeIcon">ë</nobr>
142 <xsl:when test=
"name()='Type' and @Kind='Class'">
143 <nobr class=
"NodeIcon"><</nobr>
145 <xsl:when test=
"name()='Type' and @Kind='Interface'">
146 <nobr class=
"NodeIcon"><</nobr>
148 <xsl:when test=
"name()='Type' and @Kind='Delegate'">
149 <nobr class=
"NodeIcon"><</nobr>
151 <xsl:when test=
"name()='Type' and @Kind='Enum'">
152 <nobr class=
"NodeIcon"><</nobr>
154 <xsl:when test=
"name()='Type' and @Kind='Struct'">
155 <nobr class=
"NodeIcon"><</nobr>
157 <xsl:when test=
"name()='Namespace'">
158 <nobr style=
"color: navy;">{}
</nobr>
160 <xsl:when test=
"name()='Target'">
161 <nobr class=
"NodeIcon">2</nobr>
163 <xsl:when test=
"name()='Module'">
164 <nobr class=
"NodeIcon">1</nobr>
166 <xsl:when test=
"name()='Resource'">
167 <nobr class=
"NodeIcon"></nobr>
169 <xsl:when test=
"name()='Resources'">
170 <nobr class=
"NodeIcon">Ì</nobr>
173 [
<xsl:value-of select=
"name()"/>]
178 <xsl:when test=
"name()='Resources'">
179 <xsl:value-of select=
"name()"/>
182 <xsl:value-of select=
"@Name"/>
185 <nobr class=
"MessageNumber">
186 (
<xsl:value-of select=
"$MessageCount"/>)
190 <div class=
"NodeDiv" style=
"display: none; position: relative; padding-left: 11;">
191 <xsl:attribute name=
"id">
192 <xsl:value-of select=
"$nodeId"/>
195 <xsl:apply-templates />
202 <xsl:apply-templates />
207 <xsl:template match=
"Messages">
208 <xsl:variable name=
"MessageBlockId" select=
"generate-id()"/>
209 <div class=
"MessageBlock">
210 <xsl:attribute name=
"onClick">
211 javascript:ViewState('
<xsl:value-of select=
"$MessageBlockId"/>');
213 <nobr class=
"MessagesIcon">@</nobr>
214 <xsl:variable name=
"MessageCount" select=
"count(Message[@Status='Active'])"/>
215 <xsl:value-of select=
"$MessageCount"/>
216 Message
<xsl:choose><xsl:when test=
"$MessageCount > 1">s
</xsl:when></xsl:choose>
218 <xsl:value-of select=
"../@Name"/>
220 <div class=
"MessageBlockDiv" style=
"display: none; position: relative; padding-left: 5;">
221 <xsl:attribute name=
"id">
222 <xsl:value-of select=
"$MessageBlockId"/>
227 <td class=
"ColumnHeader">Message Level
</td>
228 <td class=
"ColumnHeader">Certainty
</td>
229 <td class=
"ColumnHeader" width=
"100%">Resolution
</td>
231 <xsl:apply-templates select=
"Message[@Status='Active']"/>
237 <xsl:template match=
"Message">
241 <xsl:variable name=
"messageId" select=
"generate-id()"/>
242 <xsl:variable name=
"rulename" select=
"TypeName"/>
244 <xsl:apply-templates select=
"Issue" >
245 <xsl:with-param name=
"messageId"><xsl:value-of select=
"$messageId"/></xsl:with-param>
246 </xsl:apply-templates>
250 <div class=
"MessageDiv" style=
"display: none">
251 <xsl:attribute name=
"id">
252 <xsl:value-of select=
"$messageId"/>
255 <!--- Rule Details -->
256 <table width=
"100%" class=
"RuleBlock">
257 <xsl:apply-templates select=
"Notes" mode=
"notes"/>
258 <xsl:apply-templates select=
"/FxCopReport/Rules/Rule[@TypeName=$rulename]" mode=
"ruledetails" />
265 <xsl:template match=
"Issue">
266 <xsl:param name=
"messageId"></xsl:param>
268 <xsl:attribute name=
"onClick">
269 javascript:ViewState('
<xsl:value-of select=
"$messageId"/>');
272 <xsl:attribute name=
"bgcolor">
274 <xsl:when test=
"position() mod 2 = 1">#EEEEEE
</xsl:when>
275 <xsl:otherwise>white
</xsl:otherwise>
280 <xsl:attribute name=
"class"><xsl:value-of select=
"@Level" /></xsl:attribute>
281 <xsl:value-of select=
"@Level" />
284 <xsl:attribute name=
"class"><xsl:value-of select=
"@Level" /></xsl:attribute>
285 <xsl:value-of select=
"@Certainty" />
287 <td class=
"Resolution" valign=
"top">
288 <xsl:value-of select=
"text()" />
291 <xsl:if test=
"@Path">
292 <tr class=
"SourceCode">
293 <td class=
"PropertyName">Source:
</td>
294 <td class=
"PropertyContent" colspan=
"2">
296 <xsl:attribute name=
"href">
297 <xsl:value-of select=
"@Path"/>\
<xsl:value-of select=
"@File"/>
299 <xsl:value-of select=
"@Path"/>\
<xsl:value-of select=
"@File"/>
301 (Line
<xsl:value-of select=
"@Line"/>)
307 <xsl:template match=
"Notes" mode=
"notes">
308 <xsl:apply-templates select=
"User" mode=
"notes" />
311 <xsl:template match=
"User" mode=
"notes">
314 <nobr class=
"NoteUser"><xsl:value-of select=
"@Name"/></nobr>
316 <xsl:apply-templates select=
"Note" mode=
"notes">
317 <xsl:with-param name=
"username"><xsl:value-of select=
"@Name"/></xsl:with-param>
318 </xsl:apply-templates>
323 <xsl:template match=
"Note" mode=
"notes">
324 <xsl:param name=
"username"></xsl:param>
325 <xsl:variable name=
"id" select=
"@Id"/>
326 <xsl:apply-templates select=
"/FxCopReport/Notes/User[@Name=$username]/Note[@Id=$id]" mode=
"notesPointer"/>
331 <xsl:template match=
"Note" mode=
"notesPointer">
332 <td colspan=
"2" class=
"Note">
333 <nobr class=
"NoteTime">[
<xsl:value-of select=
"@Modified"/>]
</nobr>:
334 <xsl:value-of select=
"."/>
338 <xsl:template match=
"Description" mode=
"ruledetails">
340 <td class=
"PropertyName">Rule Description:
</td>
341 <td class=
"PropertyContent"><xsl:value-of select=
"text()" /></td>
345 <xsl:template match=
"LongDescription" mode=
"ruledetails">
346 <!-- Test, don't display line if no data present -->
348 <xsl:when test=
"text()">
350 <td class=
"PropertyName">Long Description:
</td>
351 <td class=
"PropertyContent"><xsl:value-of select=
"text()" /></td>
357 <xsl:template match=
"File" mode=
"ruledetails">
359 <td class=
"PropertyName">Rule File:
</td>
360 <td class=
"PropertyContent"><xsl:value-of select=
"@Name"/> [
<xsl:value-of select=
"@Version"/>]
</td>
364 <xsl:template match=
"Rule" mode=
"ruledetails">
366 <td class=
"PropertyName">Rule:
</td>
367 <td class=
"PropertyContent"><xsl:value-of select=
"Name" /></td>
370 <td class=
"PropertyName">Category:
</td>
371 <td class=
"PropertyContent"><xsl:value-of select=
"Category" /></td>
374 <td class=
"PropertyName">Check Id:
</td>
375 <td class=
"PropertyContent"><xsl:value-of select=
"CheckId" /></td>
377 <xsl:apply-templates select=
"Description" mode=
"ruledetails" />
378 <xsl:apply-templates select=
"File" mode=
"ruledetails" />
381 <!-- End Rule Details -->