1+ <?xml version =" 1.0" ?>
2+
3+ <xsl : stylesheet version =" 1.0" xmlns : xsl =" http://www.w3.org/1999/XSL/Transform" >
4+
5+ <xsl : template match =" /" >
6+ <html >
7+ <head >
8+ <title >Sun Coding Style Violations</title >
9+ </head >
10+ <body bgcolor =" #FFFFEF" >
11+ <p ><b >Coding Style Check Results</b ></p >
12+ <table border =" 1" cellspacing =" 0" cellpadding =" 2" >
13+ <tr bgcolor =" #CC9966" >
14+ <th colspan =" 2" ><b >Summary</b ></th >
15+ </tr >
16+ <tr bgcolor =" #CCF3D0" >
17+ <td >Total files checked</td >
18+ <td ><xsl : number level =" any" value =" count(descendant::file)" /></td >
19+ </tr >
20+ <tr bgcolor =" #F3F3E1" >
21+ <td >Files with errors</td >
22+ <td ><xsl : number level =" any" value =" count(descendant::file[error])" /></td >
23+ </tr >
24+ <tr bgcolor =" #CCF3D0" >
25+ <td >Total errors</td >
26+ <td ><xsl : number level =" any" value =" count(descendant::error)" /></td >
27+ </tr >
28+ <tr bgcolor =" #F3F3E1" >
29+ <td >Errors per file</td >
30+ <td ><xsl : number level =" any" value =" count(descendant::error) div count(descendant::file)" /></td >
31+ </tr >
32+ </table >
33+ <hr align =" left" width =" 95%" size =" 1" />
34+ <p >The following are violations of the Sun Coding-Style Standards:</p >
35+ <p />
36+ <xsl : apply-templates />
37+ </body >
38+ </html >
39+ </xsl : template >
40+
41+ <xsl : template match =" file[error]" >
42+ <table bgcolor =" #AFFFFF" width =" 95%" border =" 1" cellspacing =" 0" cellpadding =" 2" >
43+ <tr >
44+ <th > File: </th >
45+ <td >
46+ <xsl : value-of select =" @name" />
47+ </td >
48+ </tr >
49+ </table >
50+ <table bgcolor =" #DFFFFF" width =" 95%" border =" 1" cellspacing =" 0" cellpadding =" 2" >
51+ <tr >
52+ <th > Line Number </th >
53+ <th > Error Message </th >
54+ </tr >
55+ <xsl : apply-templates select =" error" />
56+ </table >
57+ <p />
58+ </xsl : template >
59+
60+ <xsl : template match =" error" >
61+ <tr >
62+ <td >
63+ <xsl : value-of select =" @line" />
64+ </td >
65+ <td >
66+ <xsl : value-of select =" @message" />
67+ </td >
68+ </tr >
69+ </xsl : template >
70+
71+ </xsl : stylesheet >
0 commit comments