Debian Codegraph @

xsl/missfits.xsl

raw symbols SCIP
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!DOCTYPE xsl:stylesheet [
3 <!ENTITY nbsp "&#160;">
4 <!ENTITY deg "&#176;">
5 <!ENTITY amin "&#180;">
6 <!ENTITY asec "&#168;">
7 <!ENTITY copy "&#169;">
8 <!ENTITY darr "&#8595;">
9 ]>
10 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
11 <!--
12 # missfits.xsl
13 #
14 # Global XSL template
15 #
16 #%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
17 #
18 # This file part of: MissFITS
19 #
20 # Copyright: (C) 2006-2010 Chiara Marmo -- IAP/CNRS
21 # & Emmanuel Bertin -- IAP/CNRS/UPMC
22 #
23 # License: GNU General Public License
24 #
25 # MissFITS is free software: you can redistribute it and/or modify
26 # it under the terms of the GNU General Public License as published by
27 # the Free Software Foundation, either version 3 of the License, or
28 # (at your option) any later version.
29 # MissFITS is distributed in the hope that it will be useful,
30 # but WITHOUT ANY WARRANTY; without even the implied warranty of
31 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
32 # GNU General Public License for more details.
33 # You should have received a copy of the GNU General Public License
34 # along with MissFITS. If not, see <http://www.gnu.org/licenses/>.
35 #
36 # Last modified: 10/10/2010
37 #
38 #%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
39
40 <xsl:template match="/">
41 <xsl:variable name="date" select="/VOTABLE/RESOURCE/RESOURCE[@name='MetaData']/PARAM[@name='Date']/@value"/>
42 <xsl:variable name="time" select="/VOTABLE/RESOURCE/RESOURCE[@name='MetaData']/PARAM[@name='Time']/@value"/>
43 <HTML>
44 <HEAD>
45 <link rel="shortcut icon" type="image/x-icon" href="http://astromatic.iap.fr/xsl/favicon.ico" />
46 <script type="text/javascript" src="http://astromatic.iap.fr/xsl/sorttable.js"/>
47
48 <style type="text/css">
49 p {
50 font-family: sans-serif;
51 }
52 p.italic {font-style: italic}
53 body {
54 margin: 10px;
55 background-color: #e0e0e0;
56 background-image: url("http://astromatic.iap.fr/xsl/body_bg.jpg");
57 background-repeat: repeat-x;
58 background-position: top;
59 min-width:662px;
60 }
61 mono {font-family: monospace}
62 elen {
63 font-family: monospace;
64 font-weight: bold;
65 color: green
66 }
67 elep {
68 font-family: monospace;
69 font-weight: bold;
70 color: red
71 }
72 el {
73 font-family: monospace;
74 font-size: 100%;
75 color: black;
76 }
77 elm {
78 font-family: monospace;
79 font-size: 67%;
80 white-space: nowrap;
81 }
82 a {text-decoration: none; font-style: bold; color: #476674}
83 a:hover {text-decoration: underline;}
84 #header {
85 padding: 5px;
86 min-width: 662px;
87 background-image: url("http://astromatic.iap.fr/xsl/astromaticleft.png");
88 background-repeat: repeat-x;
89 background-position: left top;
90 text-align: left;
91 font-size: 1.2em;
92 margin: 0 0 30px 0;
93 color:#d3e7f0;
94 font-weight: bold;
95 }
96 th {
97 background-color:#d3e7f0;
98 border-top: 1px solid white;
99 border-left: 1px solid white;
100 border-right: 1px solid #476674;
101 border-bottom: 1px solid #476674;
102 -moz-border-radius: 3px;
103 -khtml-border-radius: 3px;
104 -webkit-border-radius: 3px;
105 border-radius: 3px;
106 padding: 2px;
107 line-height: 12px;
108 }
109 td {
110 background-color:#f2f4f4;
111 padding-left: 2px;
112 padding-right: 2px;
113 }
114 table.sortable {
115 border-top: 1px solid #476674;
116 border-left: 1px solid #476674;
117 border-right: 1px solid white;
118 border-bottom: 1px solid white;
119 -moz-border-radius: 3px;
120 -khtml-border-radius: 3px;
121 -webkit-border-radius: 3px;
122 border-radius: 3px;
123 }
124 table.sortable a.sortheader {
125 background-color:#d3e7f0;
126 font-weight: bold;
127 font-size: 80%;
128 text-decoration: none;
129 display: button;
130 }
131
132 table.sortable span.sortarrow {
133 color: black;
134 font-weight: bold;
135 text-decoration: blink;
136 }
137 table.sortable a.sortheader.sub {vertical-align: sub}
138 </style>
139
140 <title>
141 Processing summary on <xsl:value-of select="$date"/> at <xsl:value-of select="$time"/>
142 </title>
143 </HEAD>
144 <BODY>
145 <div id="header">
146 <a href="/"><img style="vertical-align: middle; border:0px" src="http://astromatic.iap.fr/xsl/astromatic.png" title="Astromatic home" alt="Astromatic.net" /></a> Processing summary
147 </div>
148 <xsl:call-template name="VOTable"/>
149 </BODY>
150 </HTML>
151 </xsl:template>
152
153
154 <!-- **************** Generic XSL template for VOTables ****************** -->
155 <xsl:template name="VOTable">
156 <xsl:for-each select="/VOTABLE">
157 <xsl:call-template name="Resource"/>
158 </xsl:for-each>
159 </xsl:template>
160
161 <!-- *************** Generic XSL template for Resources ****************** -->
162 <xsl:template name="Resource">
163 <xsl:for-each select="RESOURCE">
164 <xsl:choose>
165 <xsl:when test="@ID='MissFITS'">
166 <xsl:call-template name="missfits"/>
167 </xsl:when>
168 </xsl:choose>
169 </xsl:for-each>
170 </xsl:template>
171
172 <!-- ******************* XSL template for MissFITS *********************** -->
173 <xsl:template name="missfits">
174 <xsl:for-each select="RESOURCE[@ID='MetaData']">
175 <xsl:call-template name="RunInfo"/>
176 <xsl:for-each select="TABLE[@ID='OutFields']">
177 <xsl:call-template name="outfields"/>
178 </xsl:for-each>
179 <xsl:for-each select="RESOURCE[@ID='Config']">
180 <xsl:call-template name="Config"/>
181 </xsl:for-each>
182 <xsl:for-each select="TABLE[@ID='Warnings']">
183 <xsl:call-template name="Warnings"/>
184 </xsl:for-each>
185 </xsl:for-each>
186 </xsl:template>
187
188 <!-- ************* Generic XSL RunInfo template for MetaData ************* -->
189 <xsl:template name="RunInfo">
190 <p>
191 <!-- Software name, version, date, time and number of threads -->
192 <a>
193 <xsl:attribute name="href">
194 <xsl:value-of select="PARAM[@name='Soft_URL']/@value"/>
195 </xsl:attribute>
196 <b>
197 <xsl:value-of select="PARAM[@name='Software']/@value"/>&nbsp;<xsl:value-of select="PARAM[@name='Version']/@value"/>
198 </b>
199 </a>
200 started on
201 <b><xsl:value-of select="PARAM[@name='Date']/@value"/></b>
202 at
203 <b><xsl:value-of select="PARAM[@name='Time']/@value"/></b>
204 with
205 <b><xsl:value-of select="PARAM[@name='NThreads']/@value"/></b>
206 thread<xsl:if test="PARAM[@name='NThreads']/@value &gt; 1">s</xsl:if>
207
208 <!-- Run time -->
209 <xsl:variable name="duration" select="PARAM[@name='Duration']/@value"/>
210 (run time:
211 <b>
212 <xsl:choose>
213 <xsl:when test="$duration &gt; 3600.0">
214 <xsl:value-of
215 select='concat(string(floor($duration div 3600)),
216 " h ", format-number(floor(($duration div 60) mod 60.0), "00"),
217 " min")'/>
218 </xsl:when>
219 <xsl:otherwise>
220 <xsl:choose>
221 <xsl:when test="$duration &gt; 60.0">
222 <xsl:value-of
223 select='concat(format-number(floor($duration div 60),"##"),
224 " min ", format-number(floor($duration mod 60.0), "00")," s")'/>
225 </xsl:when>
226 <xsl:otherwise>
227 <xsl:value-of select='concat(string($duration), " s")'/>
228 </xsl:otherwise>
229 </xsl:choose>
230 </xsl:otherwise>
231 </xsl:choose>
232 </b>)
233 <br />
234 by user <b><xsl:value-of select="PARAM[@name='User']/@value"/></b>
235 from <b><xsl:value-of select="PARAM[@name='Host']/@value"/></b>
236 in <b><mono><xsl:value-of select="PARAM[@name='Path']/@value"/></mono></b>
237 </p>
238 <p>
239 <b style="color: red"><xsl:if test="PARAM[@name='Error_Msg']/@value &gt; 0">
240 An Error occured!!! </xsl:if>
241 <xsl:value-of select="PARAM[@name='Error_Msg']/@value"/></b>
242 </p>
243 </xsl:template>
244
245 <!-- ********************* XSL template for OutFields ******************** -->
246 <xsl:template name="outfields">
247 <xsl:variable name="imname" select="count(FIELD[@name='Output_Image_Name']/preceding-sibling::FIELD)+1"/>
248 <xsl:variable name="inimtype" select="count(FIELD[@name='Input_Image_Type']/preceding-sibling::FIELD)+1"/>
249 <xsl:variable name="inext" select="count(FIELD[@name='Input_Extensions']/preceding-sibling::FIELD)+1"/>
250 <xsl:variable name="innaxis3" select="count(FIELD[@name='Input_Naxis3']/preceding-sibling::FIELD)+1"/>
251 <xsl:variable name="outimtype" select="count(FIELD[@name='Output_Image_Type']/preceding-sibling::FIELD)+1"/>
252 <xsl:variable name="outext" select="count(FIELD[@name='Output_Extensions']/preceding-sibling::FIELD)+1"/>
253 <xsl:variable name="outnaxis3" select="count(FIELD[@name='Output_Naxis3']/preceding-sibling::FIELD)+1"/>
254 <xsl:variable name="hflag" select="count(FIELD[@name='HeadFlag']/preceding-sibling::FIELD)+1"/>
255 <p>
256 <BUTTON type="button" title="click to expand" onclick="showhideTable('missout')">
257 Summary Table on <xsl:value-of select="PARAM[@name='NImages']/@value"/>
258 Output File<xsl:if test="PARAM[@name='NImages']/@value &gt; 1">s</xsl:if>
259 &darr;
260 </BUTTON>
261 <TABLE class="sortable" id="missout" style="display: none">
262 <TR>
263 <TH>Output Image Name</TH>
264 <TH>Input Image Type</TH>
265 <TH>Output Image Type</TH>
266 <TH>Input Extensions</TH>
267 <TH>Output Extensions</TH>
268 <TH>Input Naxis3</TH>
269 <TH>Output Naxis3</TH>
270 <TH>External Header</TH>
271 <xsl:for-each select="FIELD[position()>$hflag]">
272 <TH><xsl:value-of select="@name"/></TH>
273 </xsl:for-each>
274 </TR>
275 <xsl:for-each select="DATA/TABLEDATA">
276 <xsl:for-each select="TR">
277 <tr>
278 <td align="left">
279 <el><xsl:value-of select="TD[$imname]"/></el>
280 </td>
281 <td align="center">
282 <elen><xsl:value-of select="TD[$inimtype]"/></elen>
283 </td>
284 <td align="center">
285 <elen><xsl:value-of select="TD[$outimtype]"/></elen>
286 </td>
287 <td align="center">
288 <el><xsl:value-of select="TD[$inext]"/></el>
289 </td>
290 <td align="center">
291 <el><xsl:value-of select="TD[$outext]"/></el>
292 </td>
293 <td align="center">
294 <el><xsl:value-of select="TD[$innaxis3]"/></el>
295 </td>
296 <td align="center">
297 <el><xsl:value-of select="TD[$outnaxis3]"/></el>
298 </td>
299 <td align="center">
300 <xsl:choose>
301 <xsl:when test="TD[$hflag] = 'T'">
302 <elen>Y</elen>
303 </xsl:when>
304 <xsl:otherwise>
305 <elen>N</elen>
306 </xsl:otherwise>
307 </xsl:choose>
308 </td>
309 <xsl:for-each select="TD[position()>$hflag]">
310 <td align="center">
311 <el><xsl:value-of select="self::TD"/></el>
312 </td>
313 </xsl:for-each>
314 </tr>
315 </xsl:for-each>
316 </xsl:for-each>
317 </TABLE>
318 </p>
319 </xsl:template>
320
321 <!-- ********************** XSL template for Config File ********************** -->
322 <xsl:template name="Config">
323 <p>
324 <BUTTON type="button" title="click to expand" onclick="showhideTable('config')">
325 Configuration File:
326 <B><xsl:value-of select="PARAM[@name='Prefs_Name']/@value"/></B>
327 &darr;
328 </BUTTON>
329 <TABLE id="config" class="sortable" style="display: none">
330 <TR>
331 <TH>Config Parameter</TH>
332 <TH>Value</TH>
333 </TR>
334 <xsl:for-each select="PARAM[position()>2]">
335 <tr>
336 <td><el><xsl:value-of select="@name"/></el></td>
337 <td><el><xsl:value-of select="@value"/></el></td>
338 </tr>
339 </xsl:for-each>
340 </TABLE>
341 </p>
342 <p>
343 <BUTTON type="button" title="click to expand" onclick="showhideTable('commandline')">
344 Command Line&nbsp;&darr;
345 </BUTTON>
346 <TABLE id="commandline" style="display: none">
347 <TR>
348 <TD style="font-size: 80%;"><el><xsl:value-of select="PARAM[@name='Command_Line']/@value"/></el></TD>
349 </TR>
350 </TABLE>
351 </p>
352 </xsl:template>
353
354 <!-- ********************** XSL template for Warnings ********************** -->
355 <xsl:template name="Warnings">
356 <xsl:variable name="date" select="count(FIELD[@name='Date']/preceding-sibling::FIELD)+1"/>
357 <xsl:variable name="time" select="count(FIELD[@name='Time']/preceding-sibling::FIELD)+1"/>
358 <xsl:variable name="msg" select="count(FIELD[@name='Msg']/preceding-sibling::FIELD)+1"/>
359 <p>
360 <BUTTON type="button" title="click to expand" onclick="showhideTable('warnings')">
361 Warnings (limited to the last 100)&nbsp;&darr;
362 </BUTTON>
363 <TABLE id="warnings" class="sortable" style="display: none">
364 <TR style="font-size: 80%;">
365 <TH>Date</TH>
366 <TH>Time</TH>
367 <TH>Message</TH>
368 </TR>
369 <xsl:for-each select="DATA/TABLEDATA">
370 <xsl:for-each select="TR">
371 <tr>
372 <td >
373 <el><xsl:value-of select="TD[$date]"/></el>
374 </td>
375 <td>
376 <el><xsl:value-of select="TD[$time]"/></el>
377 </td>
378 <td align="center">
379 <el><xsl:value-of select="TD[$msg]"/></el>
380 </td>
381 </tr>
382 </xsl:for-each>
383 </xsl:for-each>
384 </TABLE>
385 </p>
386 </xsl:template>
387
388 <xsl:template name="Rest">
389 </xsl:template>
390 </xsl:stylesheet>