/[PAMELA software]/quicklook/dataToXML/Data/LogTemplate.xsl
ViewVC logotype

Contents of /quicklook/dataToXML/Data/LogTemplate.xsl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download) (as text)
Tue May 30 21:54:35 2006 UTC (18 years, 6 months ago) by kusanagi
Branch: MAIN
CVS Tags: dataToXML1_02/01, dataToXML1_02/00, dataToXML1_03/00, dataToXML1_01/00
Changes since 1.1: +10 -2 lines
File MIME type: application/xml
Update by Elena Vannuccini

1 <?xml version="1.0" encoding='ISO-8859-1'?>
2 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
3 <!-- Dichiarazione del documento XSLT -->
4 <!-- <xsl:stylesheet version="1.0"
5 xmlns:xsl="http://www.w3.org/TR/WD-xsl"> -->
6
7 <!--
8 =====================================================================================
9 Stylesheet: LogTemplate.xsl
10 Version: 1.0 (2005-01-01)
11 Author: Maurizio Nagni
12 Descr.: Merge the output of the LogToXml.c script with the loginfo.xml
13 file to generate a human readble verion of the Log packet
14 Note : Needs customization of the CPUcode parameter into the Configure.xml file
15 =====================================================================================
16 -->
17
18 <!--Contains some utility to converts dec/hex/bin numbers-->
19 <xsl:include href="numberutils_lib.xsl"/>
20
21 <!--Contains all the customer specific parameters-->
22 <xsl:include href="Configure.xsl"/>
23
24 <!-- Define which a key called "fileName"
25 which will search inside the node "log"
26 all values values of the node "fileid" matching the valued passed when
27 the key "fileName" is called -->
28 <!-- No xml file is defined here because the xsl:key is absolutely generic -->
29 <xsl:key name="fileName" match="log" use="fileid"/>
30
31 <xsl:template match="/" name="LogReference">
32 <xsl:param name="code"/>
33 <xsl:param name="line_no"/>
34 <xsl:param name="obt"/>
35 <xsl:param name="info"/>
36 <xsl:for-each select="document('./compilationInfo/loginfo.xml')">
37 <xsl:for-each select="key('fileName', $code)">
38 <xsl:if test="line=$line_no">
39 <xsl:variable name="bgcolor">
40 <xsl:choose>
41 <xsl:when test="alarm='yes'"> <xsl:value-of select="'#ff0000'"/> </xsl:when>
42 <xsl:when test="alarm='no'"> <xsl:value-of select="'#ffffff'"/> </xsl:when>
43 <xsl:when test="alarm='yes1'"> <xsl:value-of select="'#ff8000'"/> </xsl:when>
44 <xsl:when test="alarm='yes2'"> <xsl:value-of select="'#ffcc99'"/> </xsl:when>
45 <xsl:when test="alarm='mcalib'"> <xsl:value-of select="'#b3ff66'"/> </xsl:when>
46 <xsl:when test="alarm='macq'"> <xsl:value-of select="'#99ffff'"/> </xsl:when>
47 <xsl:when test="alarm='minit'"> <xsl:value-of select="'#ffff66'"/> </xsl:when>
48 <xsl:when test="alarm='calib'"> <xsl:value-of select="'#e6ffcc'"/> </xsl:when>
49 <xsl:when test="alarm='acq'"> <xsl:value-of select="'#ccffff'"/> </xsl:when>
50 <xsl:when test="alarm='init'"> <xsl:value-of select="'#ffffcc'"/> </xsl:when>
51 <xsl:otherwise> <xsl:value-of select="'#00ff00'"/> </xsl:otherwise>
52 </xsl:choose>
53 </xsl:variable>
54 <tr bgcolor="{$bgcolor}">
55 <td><xsl:value-of select="$obt"/></td>
56 <td><xsl:value-of select="type"/></td>
57 <td>
58 <A>
59 <xsl:attribute name="href">
60 <xsl:value-of select="concat($CPUcode, fullfilename)"/>
61 </xsl:attribute>
62 <xsl:value-of select="fullfilename"/>
63 <div></div>
64 <xsl:value-of select="description"/>
65 </A>
66 </td>
67 <td>
68 0x
69 <xsl:call-template name="Dec2Hex">
70 <xsl:with-param name="value" select="$info"/>
71 </xsl:call-template>
72 ----
73 <xsl:value-of select="$info"/>
74 </td>
75 </tr>
76 </xsl:if>
77 </xsl:for-each>
78 </xsl:for-each>
79 </xsl:template>
80
81 <xsl:template match="/" name="LogTemplate">
82 <html>
83 <body STYLE="font-family:Arial, helvetica, sans-serif; font-size:12pt">
84 <h2>Log Records</h2>
85 <table border="1">
86 <xsl:for-each select="//LOG_EVENT">
87 <tr bgcolor="#1acd32">
88 <th align="center">Packet OBT</th>
89 <th align="center">Packet Num</th>
90 </tr>
91 <tr>
92 <th align="left"><xsl:value-of select="PACKET_OBT"/></th>
93 <th align="left"><xsl:value-of select="PACKET_NUM"/></th>
94 </tr>
95 <tr bgcolor="#9acd32">
96 <xsl:for-each select="//COL">
97 <th align="left"><xsl:value-of select="."/></th>
98 </xsl:for-each>
99 </tr>
100 <xsl:for-each select="LOG_RECORDS/LOG_RECORD">
101 <xsl:variable name="retTemplate">
102 <xsl:call-template name="LogReference">
103 <xsl:with-param name="code" select="FILE_ID"/>
104 <xsl:with-param name="line_no" select="LINE_NO"/>
105 <xsl:with-param name="obt" select="RECORD_OBT"/>
106 <xsl:with-param name="info" select="INFO1"/>
107 </xsl:call-template>
108 </xsl:variable>
109 <xsl:if test='$retTemplate=""'>
110 <tr>
111 <td><xsl:value-of select="RECORD_OBT"/></td>
112 <td><xsl:value-of select="MASKTYPE"/></td>
113 <td><xsl:value-of select="FILE_ID"/> -- <xsl:value-of select="LINE_NO"/></td>
114 <td>
115 0x
116 <xsl:call-template name="Dec2Hex">
117 <xsl:with-param name="value" select="INFO1"/>
118 </xsl:call-template>
119 ----
120 <xsl:value-of select="INFO1"/>
121 </td>
122 </tr>
123 </xsl:if>
124 <xsl:if test='$retTemplate!=""'>
125 <xsl:copy-of select="$retTemplate" />
126 </xsl:if>
127 </xsl:for-each>
128 </xsl:for-each>
129
130 </table>
131 </body>
132 </html>
133 </xsl:template>
134
135 </xsl:stylesheet>

  ViewVC Help
Powered by ViewVC 1.1.23