blob: ffc790565e6fe8fbf4ee337001f08c4fd98cd0ae [file] [log] [blame]
david_williamsea862da2009-05-20 04:01:39 +00001<?xml version="1.0" encoding="ISO-8859-1"?>
2<xsl:stylesheet
3 version="1.0"
4 xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
5 <xsl:output
6 method="html"
7 indent="yes"/>
8 <xsl:template
9 match="/">
10 <html>
11 <body>
12 <xsl:apply-templates
13 select="compiler"/>
14 </body>
15 </html>
16 </xsl:template>
17 <xsl:template
18 match="compiler">
19 <h2>Compiler Report</h2>
20 <p>
21 Compiler:
22 <xsl:value-of
23 select="@name"/>
24 <xsl:text> </xsl:text>
25 Version:
26 <xsl:value-of
27 select="@version"/>
28 </p>
29 <xsl:apply-templates
30 select="stats"/>
31 <xsl:apply-templates
32 select="sources"/>
33 </xsl:template>
34 <xsl:template
35 name="stats"
36 match="stats">
37 <p>
38 Number of source files:
39 <xsl:value-of
40 select="count(..//source)"/>
41 Number of classfiles:
42 <xsl:value-of
43 select="number_of_classfiles/@value"/>
44 </p>
45 <p>
46 Problems:
47 <xsl:value-of
48 select="problem_summary/@problems"/>
49 (Errors:
50 <xsl:value-of
51 select="problem_summary/@errors"/>
52 Warnings:
53 <xsl:value-of
54 select="problem_summary/@warnings"/>
55 )
56 </p>
57 </xsl:template>
58 <xsl:template
59 name="sources"
60 match="sources">
61 <xsl:if
62 test="count(source) > 0">
63 <dl>
64 <xsl:for-each
65 select="source">
66 <xsl:variable
67 name="package"
68 select="normalize-space(@package)">
69 </xsl:variable>
70 <xsl:variable
71 name="path"
72 select="normalize-space(@path)">
73 </xsl:variable>
74 <xsl:variable
75 name="classname"
76 select="substring-after($path, $package)">
77 </xsl:variable>
78 <xsl:if
79 test="count(problems) > 0">
80 <dt
81 style="font-weight: bold; color: black">
82 Source File:
83 <xsl:value-of
84 select="$package"/>
85 <xsl:value-of
86 select="$classname"/>
87 </dt>
88 <xsl:apply-templates
89 select="problems">
90 <xsl:with-param
91 name="classname">
92 <xsl:value-of
93 select="$classname"/>
94 </xsl:with-param>
95 </xsl:apply-templates>
96 </xsl:if>
97 </xsl:for-each>
98 </dl>
99 </xsl:if>
100 </xsl:template>
101 <xsl:template
102 match="problems">
103 <xsl:param
104 name="classname"/>
105 <xsl:for-each
106 select="problem">
107 <dd
108 style="font-weight: normal; color: black">
109 <xsl:value-of
110 select="position()"/>
111 <xsl:text>. </xsl:text>
112 <xsl:value-of
113 select="@severity"/>
114 <xsl:text>: </xsl:text>
115 <xsl:value-of
116 select="@id"/>
117 <xsl:variable
118 name="lineNumber"
119 select="@line">
120 </xsl:variable>
121 <xsl:for-each
122 select="message">
123 <p
124 style="margin-left: +.5in; font-size: -1; margin-top: 0;margin-bottom:0;">
125 <small>
126 <xsl:value-of
127 select="@value"/>
128 </small>
129 </p>
130 </xsl:for-each>
131 <xsl:for-each
132 select="source_context">
133 <xsl:variable
134 name="pre"
135 select="substring(@value,0,(@sourceStart + 1))">
136 </xsl:variable>
137 <xsl:variable
138 name="main"
139 select="substring(@value,(@sourceStart + 1),(((@sourceEnd + 1) - (@sourceStart + 1)) + 1))">
140 </xsl:variable>
141 <xsl:variable
142 name="end"
143 select="substring(@value,(@sourceEnd + 2))">
144 </xsl:variable>
145 <p
146 style="margin-left: +.5in; font-size: -2; margin-top: 0;margin-bottom:0;">
147 <xsl:value-of
148 select="substring($classname,2)"/>
149 :
150 </p>
151 <p
152 style="margin-left: +.5in; font-size: -2;font-family: monospace; margin-top: 0;margin-bottom:0;">
153 <xsl:value-of
154 select="$lineNumber"/>
155 :
156 <xsl:value-of
157 select="$pre"/>
158 <b>
159 <u>
160 <xsl:value-of
161 select="$main"/>
162 </u>
163 </b>
164 <xsl:value-of
165 select="$end"/>
166 </p>
167 </xsl:for-each>
168 </dd>
169 </xsl:for-each>
170 </xsl:template>
171</xsl:stylesheet>