1 | <?xml version="1.0" encoding="utf-8"?> |
---|
2 | <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> |
---|
3 | |
---|
4 | <!-- |
---|
5 | |
---|
6 | **************************************************************************************** |
---|
7 | Task result template 2.0 by SCDBob |
---|
8 | |
---|
9 | Changelog: |
---|
10 | -center align for competition name and title |
---|
11 | -red font for task status (i.e. Provisional) |
---|
12 | -result table width 100% |
---|
13 | -automatic HTML link to "Notes" and "Penalty" section is generated when pilot has notes or penalties |
---|
14 | -fix font red color for total points when pilots has absolute penalty points |
---|
15 | |
---|
16 | ***************************************************************************************** |
---|
17 | |
---|
18 | --> |
---|
19 | |
---|
20 | |
---|
21 | <!-- To see the input used for this xslt, check the "Create source.xml file |
---|
22 | when creating report" menu item under the "Reports" menu in FsComp. |
---|
23 | When checked a .source.xml file is created each time you create a report. |
---|
24 | It shows the actual xml input to the xslt processor. |
---|
25 | This is helpfull if you like to modify this file. |
---|
26 | --> |
---|
27 | |
---|
28 | <xsl:output method="html" encoding="utf-8" indent="yes" /> |
---|
29 | |
---|
30 | <!-- Set the decimal separator to be used (. or ,) when decimal data is displayed. |
---|
31 | All decimal data in the source is with . and will be displayed with . unless |
---|
32 | formated otherwise using format-number() function. |
---|
33 | --> |
---|
34 | <xsl:variable name="decimal_separator" select="','"/> |
---|
35 | <xsl:decimal-format decimal-separator=',' grouping-separator=' ' /> |
---|
36 | <!-- note! make sure both above use same, ie either . or ,!! --> |
---|
37 | |
---|
38 | <!-- All <xsl:param ... elements will show as a field in a report dialog in |
---|
39 | FS when creating reports. This means you can define param elements here |
---|
40 | with a default value and set the value from FS when creating report. |
---|
41 | Some is used simply to display text at the top of the report (ie status), |
---|
42 | others is used to filter the results. |
---|
43 | If you add "filter" params you must of course also change the "filter" |
---|
44 | definition below so that the filter params is applied. |
---|
45 | 20080518 FS 1.2.3: |
---|
46 | Removed all "filter" params. |
---|
47 | Moved filtering inside FS so the xml input to the xslt is already filtered. |
---|
48 | the filter_info attribute of FsTaskResults element shows what filter(s) is applied. |
---|
49 | --> |
---|
50 | <xsl:param name="title"></xsl:param> |
---|
51 | <xsl:param name="status">Provisional</xsl:param> |
---|
52 | <!-- filter params --> |
---|
53 | |
---|
54 | <!-- The node-set that this variable returns is what is used to create the result list. |
---|
55 | --> |
---|
56 | <xsl:variable name="filter" select="/Fs/FsCompetition/FsTaskResults[1]/FsParticipant"/> |
---|
57 | <xsl:variable name="task_id" select="/Fs/FsCompetition[1]/FsTaskResults/@id"/> |
---|
58 | <xsl:variable name="filter_info" select="/Fs/FsCompetition[1]/FsTaskResults/@filter_info"/> |
---|
59 | |
---|
60 | <!-- the FsTask element for the given task (lots of info under there that we need) --> |
---|
61 | <xsl:variable name="task" select="/Fs/FsCompetition[1]/FsTasks/FsTask[@id=$task_id]"/> |
---|
62 | <!-- all participants in the comp --> |
---|
63 | <xsl:variable name="comp_pilots" select="/Fs/FsCompetition[1]/FsParticipants[1]/FsParticipant"/> |
---|
64 | <!-- various stuff we need later ... --> |
---|
65 | <xsl:variable name="tp1_open" select="$task/FsTaskDefinition/FsTurnpoint/@open"/> |
---|
66 | <xsl:variable name="task_name" select="$task/@name"/> |
---|
67 | <xsl:variable name="use_leading_points" select="$task/FsScoreFormula/@use_leading_points"/> |
---|
68 | <xsl:variable name="use_departure_points" select="$task/FsScoreFormula/@use_departure_points"/> |
---|
69 | <xsl:variable name="use_arrival_position_points" select="$task/FsScoreFormula/@use_arrival_position_points"/> |
---|
70 | <xsl:variable name="use_arrival_time_points" select="$task/FsScoreFormula/@use_arrival_time_points"/> |
---|
71 | <xsl:variable name="ss" select="$task/FsTaskDefinition/@ss"/> |
---|
72 | <xsl:variable name="es" select="$task/FsTaskDefinition/@es"/> |
---|
73 | <xsl:variable name="task_distance" select="$task/FsTaskScoreParams/@task_distance"/> |
---|
74 | <xsl:variable name="ss_distance" select="$task/FsTaskScoreParams/@ss_distance"/> |
---|
75 | <xsl:variable name="FsTaskScoreParams" select="$task/FsTaskScoreParams"/> |
---|
76 | <xsl:variable name="FsScoreFormula" select="$task/FsScoreFormula"/> |
---|
77 | <xsl:variable name="no_of_startgates" select="count($task/FsTaskDefinition/FsStartGate)"/> |
---|
78 | |
---|
79 | <!-- Returns a ranking number based on the @points attribute in the element given by the item param. |
---|
80 | Will give same ranking to elements with equal points. |
---|
81 | NOTE! Likly to give wrong rank for some pilots when applied to a filtered node-list. |
---|
82 | NOTE! does NOT work when called inside a sorted node-list!!! |
---|
83 | --> |
---|
84 | <xsl:template name="calc_rank_from_points" > |
---|
85 | <xsl:param name="item"/> |
---|
86 | <xsl:param name="points"/> |
---|
87 | <xsl:param name="sub" select="0"/> |
---|
88 | <xsl:variable name="found" select="boolean($item/preceding-sibling::node()[1]/@points = $points)"/> |
---|
89 | <xsl:choose> |
---|
90 | <xsl:when test="$found = true()"> |
---|
91 | <xsl:call-template name="calc_rank_from_points"> |
---|
92 | <xsl:with-param name="item" select="$item/preceding-sibling::node()[1]"/> |
---|
93 | <xsl:with-param name="points" select="$points"/> |
---|
94 | <xsl:with-param name="sub" select="$sub+1"/> |
---|
95 | </xsl:call-template> |
---|
96 | </xsl:when> |
---|
97 | <xsl:otherwise> |
---|
98 | <xsl:value-of select="position()-$sub"/> |
---|
99 | </xsl:otherwise> |
---|
100 | </xsl:choose> |
---|
101 | </xsl:template> |
---|
102 | |
---|
103 | <!-- list of startgates --> |
---|
104 | <xsl:template name="FsStartGate_list"> |
---|
105 | <xsl:text>StartGate(s): </xsl:text> |
---|
106 | <xsl:value-of select="substring($task/FsTaskDefinition/FsStartGate[1]/@open, 12, 14)"/> |
---|
107 | <xsl:for-each select="$task/FsTaskDefinition/FsStartGate[position() > 1]"> |
---|
108 | <xsl:text>, </xsl:text> |
---|
109 | <xsl:value-of select="substring(@open, 12, 14)"/> |
---|
110 | </xsl:for-each> |
---|
111 | </xsl:template> |
---|
112 | |
---|
113 | <!-- list of scoring formula parameters --> |
---|
114 | <xsl:template name="FsScoreFormula_list"> |
---|
115 | <h3>Scoring formula settings</h3> |
---|
116 | <table class="fs_res"> |
---|
117 | <thead> |
---|
118 | <tr> |
---|
119 | <th class="fs_res">param</th> |
---|
120 | <th class="fs_res">value</th> |
---|
121 | </tr> |
---|
122 | </thead> |
---|
123 | <tbody> |
---|
124 | <xsl:for-each select="$FsScoreFormula/@*"> |
---|
125 | <tr> |
---|
126 | <td class="fs_res"> |
---|
127 | <xsl:value-of select="name()"/> |
---|
128 | </td> |
---|
129 | <td class="fs_res"> |
---|
130 | <xsl:value-of select="."/> |
---|
131 | </td> |
---|
132 | </tr> |
---|
133 | </xsl:for-each> |
---|
134 | </tbody> |
---|
135 | </table> |
---|
136 | </xsl:template> |
---|
137 | |
---|
138 | <!-- task statistics (all sort of intermediate values used to calculate the score of each pilot) --> |
---|
139 | <xsl:template name="FsTaskScoreParams_list"> |
---|
140 | <h3>Task statistics</h3> |
---|
141 | <table class="fs_res"> |
---|
142 | <thead> |
---|
143 | <tr> |
---|
144 | <th class="fs_res">param</th> |
---|
145 | <th class="fs_res">value</th> |
---|
146 | </tr> |
---|
147 | </thead> |
---|
148 | <tbody> |
---|
149 | <xsl:for-each select="$FsTaskScoreParams/@*"> |
---|
150 | <tr> |
---|
151 | <td class="fs_res"> |
---|
152 | <xsl:value-of select="name()"/> |
---|
153 | </td> |
---|
154 | <td class="fs_res"> |
---|
155 | <xsl:value-of select="."/> |
---|
156 | </td> |
---|
157 | </tr> |
---|
158 | </xsl:for-each> |
---|
159 | </tbody> |
---|
160 | </table> |
---|
161 | </xsl:template> |
---|
162 | |
---|
163 | <!-- list pilots with penalties applied to score --> |
---|
164 | <xsl:template name="Penalty_list"> |
---|
165 | <h3><a name="penalties">Penalties</a></h3> |
---|
166 | <i>Note: % penalty is used to calc penalty as a % of total score. Both types can be combined. None affect the scoring of other pilots.</i> |
---|
167 | <table class="fs_res"> |
---|
168 | <thead> |
---|
169 | <tr> |
---|
170 | <th class="fs_res">Id</th> |
---|
171 | <th class="fs_res">Name</th> |
---|
172 | <th class="fs_res">% penalty</th> |
---|
173 | <th class="fs_res">points penalty</th> |
---|
174 | <th class="fs_res">Reason</th> |
---|
175 | </tr> |
---|
176 | </thead> |
---|
177 | <tbody> |
---|
178 | <xsl:for-each select="$filter"> |
---|
179 | <xsl:variable name="pilot_id" select="@id"/> |
---|
180 | <xsl:variable name="penalty" select="$task/FsParticipants[1]/FsParticipant[@id=$pilot_id]/FsResultPenalty/@penalty"/> |
---|
181 | <xsl:variable name="penalty_points" select="$task/FsParticipants[1]/FsParticipant[@id=$pilot_id]/FsResultPenalty/@penalty_points"/> |
---|
182 | <xsl:if test="$penalty != 0 or $penalty_points != 0"> |
---|
183 | <tr> |
---|
184 | <td class="fs_res"> |
---|
185 | <xsl:value-of select="$pilot_id"/> |
---|
186 | </td> |
---|
187 | <td class="fs_res"> |
---|
188 | <xsl:value-of select="//FsCompetition[1]/FsParticipants[1]/FsParticipant[@id=$pilot_id]/@name"/> |
---|
189 | </td> |
---|
190 | <td class="fs_res"> |
---|
191 | <xsl:value-of select="$penalty * 100"/>% |
---|
192 | </td> |
---|
193 | <td class="fs_res"> |
---|
194 | <xsl:value-of select="$penalty_points"/> |
---|
195 | </td> |
---|
196 | <td class="fs_res"> |
---|
197 | <xsl:value-of select="$task/FsParticipants[1]/FsParticipant[@id=$pilot_id]/FsResultPenalty/@penalty_reason"/> |
---|
198 | </td> |
---|
199 | </tr> |
---|
200 | </xsl:if> |
---|
201 | </xsl:for-each> |
---|
202 | </tbody> |
---|
203 | </table> |
---|
204 | </xsl:template> |
---|
205 | |
---|
206 | <!-- NYP pilots --> |
---|
207 | <xsl:template name="NYP_pilots"> |
---|
208 | <h3>Pilots not yet processed (NYP)</h3> |
---|
209 | <table class="fs_res"> |
---|
210 | <thead> |
---|
211 | <tr> |
---|
212 | <th class="fs_res">Id</th> |
---|
213 | <th class="fs_res">Name</th> |
---|
214 | </tr> |
---|
215 | </thead> |
---|
216 | <tbody> |
---|
217 | <xsl:for-each select="//FsCompetition[1]/FsParticipants[1]/FsParticipant"> |
---|
218 | <xsl:sort select="@id" data-type="number" order="ascending"/> |
---|
219 | <xsl:variable name="pilot_id" select="@id"/> |
---|
220 | <xsl:if test="boolean($task/FsParticipants[1]/FsParticipant[@id=$pilot_id]) = false()"> |
---|
221 | <tr> |
---|
222 | <td class="fs_res" style="text-align:right"> |
---|
223 | <xsl:value-of select="$pilot_id"/> |
---|
224 | </td> |
---|
225 | <td class="fs_res"> |
---|
226 | <xsl:value-of select="//FsCompetition[1]/FsParticipants[1]/FsParticipant[@id=$pilot_id]/@name"/> |
---|
227 | </td> |
---|
228 | </tr> |
---|
229 | </xsl:if> |
---|
230 | </xsl:for-each> |
---|
231 | </tbody> |
---|
232 | </table> |
---|
233 | </xsl:template> |
---|
234 | |
---|
235 | <!-- ABS pilots --> |
---|
236 | <xsl:template name="ABS_pilots"> |
---|
237 | <h3>Pilots absent from task (ABS)</h3> |
---|
238 | <table class="fs_res"> |
---|
239 | <thead> |
---|
240 | <tr> |
---|
241 | <th class="fs_res">Id</th> |
---|
242 | <th class="fs_res">Name</th> |
---|
243 | </tr> |
---|
244 | </thead> |
---|
245 | <tbody> |
---|
246 | <xsl:for-each select="$task/FsParticipants[1]/FsParticipant"> |
---|
247 | <xsl:sort select="@id" data-type="number" order="ascending"/> |
---|
248 | <xsl:variable name="pilot_id" select="@id"/> |
---|
249 | <xsl:if test="boolean(FsResult) = false()"> |
---|
250 | <tr> |
---|
251 | <td class="fs_res" style="text-align:right"> |
---|
252 | <xsl:value-of select="$pilot_id"/> |
---|
253 | </td> |
---|
254 | <td class="fs_res"> |
---|
255 | <xsl:value-of select="//FsCompetition[1]/FsParticipants[1]/FsParticipant[@id=$pilot_id]/@name"/> |
---|
256 | </td> |
---|
257 | </tr> |
---|
258 | </xsl:if> |
---|
259 | </xsl:for-each> |
---|
260 | </tbody> |
---|
261 | </table> |
---|
262 | </xsl:template> |
---|
263 | |
---|
264 | |
---|
265 | <!-- list pilots with notes --> |
---|
266 | <xsl:template name="Notes_list"> |
---|
267 | <h3><a name="notes">Notes</a></h3> |
---|
268 | <table class="fs_res"> |
---|
269 | <thead> |
---|
270 | <tr> |
---|
271 | <th class="fs_res">Id</th> |
---|
272 | <th class="fs_res">Name</th> |
---|
273 | <th class="fs_res">Note</th> |
---|
274 | </tr> |
---|
275 | </thead> |
---|
276 | <tbody> |
---|
277 | <xsl:for-each select="$filter"> |
---|
278 | <xsl:sort select="@name" data-type="text" order="ascending"/> |
---|
279 | <xsl:variable name="pilot_id" select="@id"/> |
---|
280 | <xsl:variable name="note" select="$task/FsParticipants[1]/FsParticipant[@id=$pilot_id]/FsFlightDataNote/@note"/> |
---|
281 | <xsl:if test="$note != ''"> |
---|
282 | <tr> |
---|
283 | <td class="fs_res"> |
---|
284 | <xsl:value-of select="$pilot_id"/> |
---|
285 | </td> |
---|
286 | <td class="fs_res"> |
---|
287 | <xsl:value-of select="//FsCompetition[1]/FsParticipants[1]/FsParticipant[@id=$pilot_id]/@name"/> |
---|
288 | </td> |
---|
289 | <td class="fs_res"> |
---|
290 | <xsl:value-of select="$note"/> |
---|
291 | </td> |
---|
292 | </tr> |
---|
293 | </xsl:if> |
---|
294 | </xsl:for-each> |
---|
295 | </tbody> |
---|
296 | </table> |
---|
297 | </xsl:template> |
---|
298 | |
---|
299 | <xsl:template name="turnpointlist"> |
---|
300 | <table class="fs_res"> |
---|
301 | <thead> |
---|
302 | <tr> |
---|
303 | <th class="fs_res">No</th> |
---|
304 | <th class="fs_res">Dist.</th> |
---|
305 | <th class="fs_res">Id</th> |
---|
306 | <th class="fs_res"> |
---|
307 | Radius<br/>(meters) |
---|
308 | </th> |
---|
309 | <!--th>Type</th--> |
---|
310 | <th class="fs_res">Coordinates</th> |
---|
311 | <th class="fs_res">Open</th> |
---|
312 | <th class="fs_res">Close</th> |
---|
313 | </tr> |
---|
314 | </thead> |
---|
315 | <tbody> |
---|
316 | <xsl:for-each select="$task/FsTaskDefinition/FsTurnpoint"> |
---|
317 | <tr> |
---|
318 | <xsl:variable name="position" select="position()"/> |
---|
319 | <xsl:variable name="FsTaskDistToTp" |
---|
320 | select="$task/FsTaskScoreParams/FsTaskDistToTp[@tp_no=$position]"/> |
---|
321 | <td class="fs_res"> |
---|
322 | <xsl:value-of select="$FsTaskDistToTp/@tp_no"/> |
---|
323 | <xsl:if test="$FsTaskDistToTp/@tp_no=$ss"> |
---|
324 | <xsl:text> SS</xsl:text> |
---|
325 | </xsl:if> |
---|
326 | <xsl:if test="$FsTaskDistToTp/@tp_no=$es"> |
---|
327 | <xsl:text> ES</xsl:text> |
---|
328 | </xsl:if> |
---|
329 | </td> |
---|
330 | <td class="fs_res" align="right"> |
---|
331 | <xsl:value-of select="format-number($FsTaskDistToTp/@distance, concat('#0', $decimal_separator, '0'))"/> km |
---|
332 | <!--xsl:value-of select="$FsTaskDistToTp/@distance"/--> |
---|
333 | </td> |
---|
334 | <td class="fs_res"> |
---|
335 | <xsl:value-of select="@id"/> |
---|
336 | </td> |
---|
337 | <td class="fs_res" style="text-align:right"> |
---|
338 | <xsl:value-of select="@radius"/> |
---|
339 | </td> |
---|
340 | <!--td> |
---|
341 | <xsl:value-of select="@type"/> |
---|
342 | </td--> |
---|
343 | <td class="fs_res"> |
---|
344 | <xsl:choose> |
---|
345 | <xsl:when test="@utm_zone"> |
---|
346 | <xsl:text> </xsl:text> |
---|
347 | <xsl:value-of select="@utm_zone"/> |
---|
348 |  <xsl:value-of select="@lon"/> |
---|
349 |  <xsl:value-of select="@lat"/> |
---|
350 | </xsl:when> |
---|
351 | <xsl:otherwise> |
---|
352 | Lat: <xsl:value-of select="@lat"/> Lon: <xsl:value-of select="@lon"/> |
---|
353 | </xsl:otherwise> |
---|
354 | </xsl:choose> |
---|
355 | </td> |
---|
356 | <!-- |
---|
357 | @open and @close expected on the form: open="2007-05-17T14:00:00+02:00" close="2007-05-17T18:30:00+02:00" |
---|
358 | We only want to show the local time (no date) |
---|
359 | --> |
---|
360 | <td class="fs_res"> |
---|
361 | <xsl:value-of select="substring(@open, 12, 14)"/> |
---|
362 | </td> |
---|
363 | <td class="fs_res"> |
---|
364 | <xsl:value-of select="substring(@close, 12, 14)"/> |
---|
365 | </td> |
---|
366 | </tr> |
---|
367 | </xsl:for-each> |
---|
368 | </tbody> |
---|
369 | </table> |
---|
370 | </xsl:template> |
---|
371 | |
---|
372 | <!-- Result list heading row --> |
---|
373 | <xsl:template name="result_heading_row"> |
---|
374 | <tr> |
---|
375 | <th class="fs_res">#</th> |
---|
376 | <th class="fs_res">Id</th> |
---|
377 | <th class="fs_res">Name</th> |
---|
378 | <th class="fs_res"></th> |
---|
379 | <th class="fs_res">Nat</th> |
---|
380 | <th class="fs_res">Glider</th> |
---|
381 | <th class="fs_res">Sponsor</th> |
---|
382 | <!-- If Race or Elapsed time? --> |
---|
383 | <xsl:if test="$es != ''"> |
---|
384 | <th class="fs_res">SS</th> |
---|
385 | <th class="fs_res">ES</th> |
---|
386 | <th class="fs_res">Time</th> |
---|
387 | <th class="fs_res">km/h</th> |
---|
388 | </xsl:if> |
---|
389 | <th class="fs_res">Dist.</th> |
---|
390 | <th class="fs_res"> |
---|
391 | Dist.<br/>Points |
---|
392 | </th> |
---|
393 | <xsl:if test="$use_leading_points=1"> |
---|
394 | <th class="fs_res"> |
---|
395 | Lead.<br/>Points |
---|
396 | </th> |
---|
397 | </xsl:if> |
---|
398 | <xsl:if test="$use_departure_points=1"> |
---|
399 | <th class="fs_res"> |
---|
400 | Dept.<br/>Points |
---|
401 | </th> |
---|
402 | </xsl:if> |
---|
403 | <th class="fs_res"> |
---|
404 | Time<br/>Points |
---|
405 | </th> |
---|
406 | <xsl:if test="$use_arrival_time_points=1"> |
---|
407 | <th class="fs_res"> |
---|
408 | Arr.<br/>Time<br/>Points |
---|
409 | </th> |
---|
410 | </xsl:if> |
---|
411 | <xsl:if test="$use_arrival_position_points=1"> |
---|
412 | <th class="fs_res"> |
---|
413 | Arr.<br/>Pos<br/>Points |
---|
414 | </th> |
---|
415 | </xsl:if> |
---|
416 | <th class="fs_res">Total</th> |
---|
417 | </tr> |
---|
418 | </xsl:template> |
---|
419 | |
---|
420 | <!-- Result list row. |
---|
421 | node-set elements must have @id and @points attributes and be sorted descending on @points. |
---|
422 | Gets other data from the $comp_pilots and $task variables. |
---|
423 | --> |
---|
424 | <xsl:template name="result_row"> |
---|
425 | <tr class="fs_res_res_row" onmouseover="this.className = 'hover'" onmouseout="this.className='fs_res_res_row'" > |
---|
426 | <xsl:variable name="pilot_id" select="@id"/> |
---|
427 | <!-- General pilot info (name, nation, etc ...) --> |
---|
428 | <xsl:variable name="comp_pilot" select="$comp_pilots[@id=$pilot_id]"/> |
---|
429 | <!-- Info about the pilot's task performance (distance, time, etc ...) given by the scoring program. --> |
---|
430 | <xsl:variable name="task_pilot_result" select="$task/FsParticipants[1]/FsParticipant[@id=$pilot_id]/FsResult"/> |
---|
431 | <td class="fs_res" align="right"> |
---|
432 | <xsl:call-template name="calc_rank_from_points"> |
---|
433 | <xsl:with-param name="item" select="."/> |
---|
434 | <xsl:with-param name="points" select="@points"/> |
---|
435 | </xsl:call-template> |
---|
436 | </td> |
---|
437 | <td class="fs_res"> |
---|
438 | <xsl:value-of select="@id"/> |
---|
439 | </td> |
---|
440 | <td class="fs_res"> |
---|
441 | <xsl:choose> |
---|
442 | <xsl:when test="count($filter[@id=$pilot_id and @has_note=1]) > 0"> |
---|
443 | <a href="#notes"><xsl:value-of select="$comp_pilot/@name"/>*</a> |
---|
444 | </xsl:when> |
---|
445 | <xsl:when test="count($filter[@id=$pilot_id and @has_penalty=1]) > 0"> |
---|
446 | <a href="#penalties"><xsl:value-of select="$comp_pilot/@name"/>*</a> |
---|
447 | </xsl:when> |
---|
448 | <xsl:otherwise> |
---|
449 | <xsl:value-of select="$comp_pilot/@name"/> |
---|
450 | </xsl:otherwise> |
---|
451 | </xsl:choose> |
---|
452 | |
---|
453 | </td> |
---|
454 | <td class="fs_res"> |
---|
455 | <xsl:choose> |
---|
456 | <xsl:when test="$comp_pilot/@female=1">F</xsl:when> |
---|
457 | <xsl:otherwise>M</xsl:otherwise> |
---|
458 | </xsl:choose> |
---|
459 | </td> |
---|
460 | <td class="fs_res"> |
---|
461 | <xsl:value-of select="$comp_pilot/@nat_code_3166_a3"/> |
---|
462 | </td> |
---|
463 | <td class="fs_res"> |
---|
464 | <xsl:value-of select="$comp_pilot/@glider"/> |
---|
465 | </td> |
---|
466 | <td class="fs_res"> |
---|
467 | <xsl:value-of select="$comp_pilot/@sponsor"/> |
---|
468 | </td> |
---|
469 | <!-- If Race or Elapsed time? --> |
---|
470 | <xsl:if test="$es != ''"> |
---|
471 | <td class="fs_res"> |
---|
472 | <xsl:value-of select="substring($task_pilot_result/@started_ss, 12, 8)"/> |
---|
473 | </td> |
---|
474 | <td class="fs_res"> |
---|
475 | <xsl:value-of select="substring($task_pilot_result/@finished_ss, 12, 8)"/> |
---|
476 | </td> |
---|
477 | <td class="fs_res"> |
---|
478 | <xsl:if test="$task_pilot_result/@finished_ss != ''"> |
---|
479 | <xsl:value-of select="$task_pilot_result/@ss_time"/> |
---|
480 | </xsl:if> |
---|
481 | </td> |
---|
482 | <td class="fs_res"> |
---|
483 | <xsl:if test="$task_pilot_result/@finished_ss != ''"> |
---|
484 | <xsl:value-of select="format-number($ss_distance div $task_pilot_result/@ss_time_dec_hours, concat('#0', $decimal_separator, '0'))"/> |
---|
485 | </xsl:if> |
---|
486 | </td> |
---|
487 | </xsl:if> |
---|
488 | <td class="fs_res" align="right"> |
---|
489 | <xsl:choose> |
---|
490 | <xsl:when test="@no_distance != ''"> |
---|
491 | <xsl:value-of select="@no_distance"/> |
---|
492 | </xsl:when> |
---|
493 | <xsl:otherwise> |
---|
494 | <xsl:value-of select="format-number($task_pilot_result/@distance, concat('#0', $decimal_separator, '00'))"/> |
---|
495 | </xsl:otherwise> |
---|
496 | </xsl:choose> |
---|
497 | </td> |
---|
498 | <td class="fs_res" align="right"> |
---|
499 | <xsl:value-of select="format-number($task_pilot_result/@distance_points, concat('#0', $decimal_separator, '0'))"/> |
---|
500 | </td> |
---|
501 | <xsl:if test="$use_leading_points=1"> |
---|
502 | <td class="fs_res" align="right"> |
---|
503 | <xsl:if test="$task_pilot_result/@leading_points != 0"> |
---|
504 | <xsl:value-of select="format-number($task_pilot_result/@leading_points, concat('#0', $decimal_separator, '0'))"/> |
---|
505 | </xsl:if> |
---|
506 | </td> |
---|
507 | </xsl:if> |
---|
508 | <xsl:if test="$use_departure_points=1"> |
---|
509 | <td class="fs_res" align="right"> |
---|
510 | <xsl:if test="$task_pilot_result/@departure_points != 0"> |
---|
511 | <xsl:value-of select="format-number($task_pilot_result/@departure_points, concat('#0', $decimal_separator, '0'))"/> |
---|
512 | </xsl:if> |
---|
513 | </td> |
---|
514 | </xsl:if> |
---|
515 | <td class="fs_res" align="right"> |
---|
516 | <xsl:if test="$task_pilot_result/@time_points != 0"> |
---|
517 | <xsl:value-of select="format-number($task_pilot_result/@time_points, concat('#0', $decimal_separator, '0'))"/> |
---|
518 | </xsl:if> |
---|
519 | </td> |
---|
520 | <xsl:if test="$use_arrival_time_points=1"> |
---|
521 | <td class="fs_res" align="right"> |
---|
522 | <xsl:if test="$task_pilot_result/@arrival_points != 0"> |
---|
523 | <xsl:value-of select="format-number($task_pilot_result/@arrival_points, concat('#0', $decimal_separator, '0'))"/> |
---|
524 | </xsl:if> |
---|
525 | </td> |
---|
526 | </xsl:if> |
---|
527 | <xsl:if test="$use_arrival_position_points=1"> |
---|
528 | <td class="fs_res" align="right"> |
---|
529 | <xsl:if test="$task_pilot_result/@arrival_points != 0"> |
---|
530 | <xsl:value-of select="format-number($task_pilot_result/@arrival_points, concat('#0', $decimal_separator, '0'))"/> |
---|
531 | </xsl:if> |
---|
532 | </td> |
---|
533 | </xsl:if> |
---|
534 | <td class="fs_res" align="right"> |
---|
535 | <xsl:choose> |
---|
536 | <xsl:when test="$task/FsParticipants[1]/FsParticipant[@id=$pilot_id]/FsResultPenalty/@penalty > 0 or $task/FsParticipants[1]/FsParticipant[@id=$pilot_id]/FsResultPenalty/@penalty_points > 0"> |
---|
537 | <span style="color:red"> |
---|
538 | <xsl:value-of select="format-number(@points, '#0')"/> |
---|
539 | </span> |
---|
540 | </xsl:when> |
---|
541 | <xsl:otherwise> |
---|
542 | <xsl:value-of select="format-number(@points, '#0')"/> |
---|
543 | </xsl:otherwise> |
---|
544 | </xsl:choose> |
---|
545 | </td> |
---|
546 | </tr> |
---|
547 | </xsl:template> |
---|
548 | |
---|
549 | <!-- Main template. This is where it all starts. --> |
---|
550 | <xsl:template match="/"> |
---|
551 | <html> |
---|
552 | <head> |
---|
553 | <style> |
---|
554 | .hover |
---|
555 | { /* for IE using onmouseover and onmouseout */ |
---|
556 | background: yellow; |
---|
557 | } |
---|
558 | tr.fs_res_res_row:hover |
---|
559 | { |
---|
560 | background: yellow; |
---|
561 | } |
---|
562 | div.fs_res |
---|
563 | { |
---|
564 | font-family: Verdana, Arial, Helvetica, sans-serif; |
---|
565 | font-size: xx-small; |
---|
566 | } |
---|
567 | table.fs_res |
---|
568 | { |
---|
569 | border:solid 1px gray; |
---|
570 | border-collapse:collapse; |
---|
571 | font-size: xx-small; |
---|
572 | } |
---|
573 | td.fs_res |
---|
574 | { |
---|
575 | border:solid 1px gray; |
---|
576 | vertical-align:top; |
---|
577 | padding:5px; |
---|
578 | } |
---|
579 | th.fs_res |
---|
580 | { |
---|
581 | border:solid 1px gray; |
---|
582 | vertical-align:center; |
---|
583 | } |
---|
584 | </style> |
---|
585 | </head> |
---|
586 | <body> |
---|
587 | <div> |
---|
588 | <div class="fs_res"> |
---|
589 | <div class="fs_res" style="width:100%;font-size: xx-small;text-align:right;" > |
---|
590 | <i> |
---|
591 | Report created: <xsl:value-of select="/Fs/FsCompetition[1]/FsTaskResults/@ts"/> |
---|
592 | </i> |
---|
593 | </div> |
---|
594 | <div style="text-align:center;"> |
---|
595 | <h1> |
---|
596 | <xsl:value-of select="/Fs/FsCompetition[1]/@name"/> |
---|
597 | </h1> |
---|
598 | <p style="font-size:xx-small"> |
---|
599 | <xsl:value-of select="/Fs/FsCompetition[1]/@from"/> to <xsl:value-of select="/Fs/FsCompetition[1]/@to"/> |
---|
600 | </p> |
---|
601 | |
---|
602 | <xsl:if test="string-length($title) > 0"> |
---|
603 | <h2> |
---|
604 | <xsl:value-of select="$title"/> |
---|
605 | </h2> |
---|
606 | </xsl:if> |
---|
607 | <h2> |
---|
608 | <xsl:value-of select="substring($tp1_open, 1, 10)"/> <xsl:value-of select="$task_name"/> |
---|
609 | </h2> |
---|
610 | <p> |
---|
611 | <strong style="color:red;"><xsl:value-of select="$status"/></strong> |
---|
612 | </p> |
---|
613 | </div> |
---|
614 | <h4> |
---|
615 | <xsl:choose> |
---|
616 | <xsl:when test="$es and $no_of_startgates > 0"> |
---|
617 | <xsl:text>Race to Goal</xsl:text> |
---|
618 | </xsl:when> |
---|
619 | <xsl:when test="$es and $no_of_startgates = 0"> |
---|
620 | <xsl:text>Elapsed time</xsl:text> |
---|
621 | </xsl:when> |
---|
622 | <xsl:otherwise> |
---|
623 | <xsl:text>Open Distance</xsl:text> |
---|
624 | </xsl:otherwise> |
---|
625 | </xsl:choose> |
---|
626 | <xsl:if test="$es != ''"> |
---|
627 | <xsl:text> </xsl:text> |
---|
628 | <xsl:value-of select="format-number($task_distance, concat('#0', $decimal_separator, '0'))"/> |
---|
629 | <xsl:text> km</xsl:text> |
---|
630 | </xsl:if> |
---|
631 | </h4> |
---|
632 | <xsl:if test="string-length($filter_info) > 0"> |
---|
633 | <p> |
---|
634 | <b> |
---|
635 | Results includes only those pilots where <xsl:value-of select="$filter_info"/> |
---|
636 | </b> |
---|
637 | </p> |
---|
638 | </xsl:if> |
---|
639 | <xsl:call-template name="turnpointlist"/> |
---|
640 | <xsl:if test="$no_of_startgates > 0"> |
---|
641 | <xsl:call-template name="FsStartGate_list"/> |
---|
642 | </xsl:if> |
---|
643 | <br/> |
---|
644 | <br/> |
---|
645 | <!-- result list --> |
---|
646 | <table class="fs_res" style="width:100%"> |
---|
647 | <!-- headings --> |
---|
648 | <thead> |
---|
649 | <xsl:call-template name="result_heading_row"/> |
---|
650 | </thead> |
---|
651 | <!-- loop through the filtered list of pilots --> |
---|
652 | <xsl:for-each select="$filter"> |
---|
653 | <xsl:call-template name="result_row"/> |
---|
654 | </xsl:for-each> |
---|
655 | </table> |
---|
656 | <!-- List of pilots with notes --> |
---|
657 | <xsl:if test="count($filter[@has_note=1]) > 0"> |
---|
658 | <xsl:call-template name="Notes_list"/> |
---|
659 | </xsl:if> |
---|
660 | <!-- List of pilots with penalties --> |
---|
661 | <xsl:if test="count($filter[@has_penalty=1]) > 0"> |
---|
662 | <xsl:call-template name="Penalty_list"/> |
---|
663 | </xsl:if> |
---|
664 | |
---|
665 | <div class="fs_res" style="page-break-before: always;"> |
---|
666 | <!-- List ABS pilots --> |
---|
667 | <xsl:call-template name="ABS_pilots"/> |
---|
668 | |
---|
669 | <!-- List NYP pilots --> |
---|
670 | <xsl:call-template name="NYP_pilots"/> |
---|
671 | </div> |
---|
672 | |
---|
673 | <!-- task statistics and scoring formula on a new page --> |
---|
674 | <div class="fs_res" style="page-break-before: always;"> |
---|
675 | <xsl:call-template name="FsTaskScoreParams_list"/> |
---|
676 | <xsl:call-template name="FsScoreFormula_list"/> |
---|
677 | </div> |
---|
678 | |
---|
679 | <p> |
---|
680 | <div style="text-align:center; font-size:xxxx-small;"> |
---|
681 | Competition scored with <a href="http://fs.fai.org/">FS</a><br/> |
---|
682 | Template powered by SCDBob |
---|
683 | </div> |
---|
684 | </p> |
---|
685 | </div> |
---|
686 | </div> |
---|
687 | </body> |
---|
688 | </html> |
---|
689 | </xsl:template> |
---|
690 | |
---|
691 | </xsl:stylesheet> |
---|