1 |
kusanagi |
1.1 |
<?xml version="1.0" encoding="UTF-8"?> <!-- Prologo XML --> |
2 |
|
|
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <!-- Dichiarazione del documento XSLT --> |
3 |
|
|
<!-- <xsl:stylesheet version="1.0" |
4 |
|
|
xmlns:xsl="http://www.w3.org/TR/WD-xsl"> --> |
5 |
|
|
|
6 |
|
|
<!-- |
7 |
|
|
===================================================================================== |
8 |
|
|
Stylesheet: ArrDumpTemplate.xsl |
9 |
|
|
Version: 1.0 (2005-03-10) |
10 |
|
|
Author: Maurizio Nagni |
11 |
|
|
Descr.: Merge the output of the ArrDumpToXml.c script with the ArrDumpInfo.xml |
12 |
|
|
file to generate a human readble verion of the ArrDump packet |
13 |
|
|
===================================================================================== |
14 |
|
|
--> |
15 |
|
|
|
16 |
|
|
<!--Contains some utility to converts dec/hex/bin numbers--> |
17 |
|
|
<xsl:include href="numberutils_lib.xsl"/> |
18 |
|
|
|
19 |
|
|
<!--Contains all the customer specific parameters--> |
20 |
|
|
<!--<xsl:include href="Configure.xsl"/>--> |
21 |
|
|
|
22 |
|
|
<!-- Define which a key called "varDes" |
23 |
|
|
which will search inside the node "var" of the reference |
24 |
|
|
ArrDumpInfo.xml (or whatever file instead of the is used) |
25 |
|
|
all values values of the node "idx" matching the valued passed when |
26 |
|
|
the key "fileName" is called --> |
27 |
|
|
<!-- No xml file is defined here because the xsl:key is absolutely generic --> |
28 |
|
|
<xsl:key name="arrDes" match="arr" use="idx"/> |
29 |
|
|
|
30 |
|
|
<xsl:template match="/" name="ArrDumpReference"> |
31 |
|
|
<xsl:param name="code"/> |
32 |
|
|
<xsl:param name="arrval"/> |
33 |
|
|
<xsl:for-each select="document('./compilationInfo/PRH_ParamHandler_INFN_auto.arr.xml')"> |
34 |
|
|
<xsl:for-each select="key('arrDes', $code)"> |
35 |
|
|
<td><xsl:value-of select="name"/><xsl:text>(</xsl:text><xsl:value-of select="idx"/><xsl:text>)</xsl:text></td> |
36 |
|
|
<td><xsl:value-of select="comment"/></td> |
37 |
|
|
<xsl:copy-of select="$arrval"/> |
38 |
|
|
</xsl:for-each> |
39 |
|
|
</xsl:for-each> |
40 |
|
|
</xsl:template> |
41 |
|
|
|
42 |
|
|
<xsl:template match="/" name="ArrDumpTemplate"> |
43 |
|
|
<html> |
44 |
|
|
<body STYLE="font-family:Arial, helvetica, sans-serif; font-size:12pt"> |
45 |
|
|
<h2>ArrDump Event</h2> |
46 |
|
|
<table border="1"> |
47 |
|
|
<xsl:for-each select="//ARRDUMP_EVENT"> |
48 |
|
|
<tr bgcolor="#1acd32"> |
49 |
|
|
<th align="center">Packet OBT</th> |
50 |
|
|
<th align="center">Packet Num</th> |
51 |
|
|
</tr> |
52 |
|
|
<tr> |
53 |
|
|
<td><xsl:value-of select="PACKET_OBT"/></td> |
54 |
|
|
<td><xsl:value-of select="PACKET_NUM"/></td> |
55 |
|
|
</tr> |
56 |
|
|
<tr bgcolor="#9acd32"> |
57 |
|
|
<th align="left">Name (ID) </th> |
58 |
|
|
<th align="left">Description</th> |
59 |
|
|
<th align="left">Value </th> |
60 |
|
|
</tr> |
61 |
|
|
<!--<xsl:variable name="compTS" select="COMPILATION_TS"> </xsl:variable>--> |
62 |
|
|
<xsl:for-each select="ARRDUMP_RECORDS/ARRDUMP_RECORD"> |
63 |
|
|
|
64 |
|
|
<xsl:variable name="arrString"> |
65 |
|
|
<xsl:for-each select="ARR_VALUE"> |
66 |
|
|
<td> |
67 |
|
|
<xsl:text>0x</xsl:text> |
68 |
|
|
<xsl:call-template name="Dec2Hex"> |
69 |
|
|
<xsl:with-param name="value" select="."/> |
70 |
|
|
</xsl:call-template> |
71 |
|
|
</td> |
72 |
|
|
</xsl:for-each> |
73 |
|
|
</xsl:variable> |
74 |
|
|
|
75 |
|
|
<tr> |
76 |
|
|
<xsl:variable name="retTemplate"> |
77 |
|
|
<xsl:call-template name="ArrDumpReference"> |
78 |
|
|
<xsl:with-param name="code" select="ARR_ID"/> |
79 |
|
|
<xsl:with-param name="arrval" select="$arrString"/> |
80 |
|
|
</xsl:call-template> |
81 |
|
|
</xsl:variable> |
82 |
|
|
<xsl:if test='$retTemplate=""'> |
83 |
|
|
<td> <xsl:value-of select="ARR_ID"/> -- n.a. </td> |
84 |
|
|
<td> n.a. </td> |
85 |
|
|
<td> <xsl:copy-of select="$arrString"/> </td> |
86 |
|
|
</xsl:if> |
87 |
|
|
<xsl:if test='$retTemplate!=""'> |
88 |
|
|
<xsl:copy-of select="$retTemplate" /> |
89 |
|
|
</xsl:if> |
90 |
|
|
<!-- |
91 |
|
|
<td> |
92 |
|
|
0x |
93 |
|
|
<xsl:call-template name="Dec2Hex"> |
94 |
|
|
<xsl:with-param name="value" select="INFO1"/> |
95 |
|
|
</xsl:call-template> |
96 |
|
|
|
97 |
|
|
<xsl:value-of select="INFO1"/> |
98 |
|
|
</td> |
99 |
|
|
--> |
100 |
|
|
</tr> |
101 |
|
|
</xsl:for-each> |
102 |
|
|
</xsl:for-each> |
103 |
|
|
|
104 |
|
|
</table> |
105 |
|
|
</body> |
106 |
|
|
</html> |
107 |
|
|
</xsl:template> |
108 |
|
|
|
109 |
|
|
</xsl:stylesheet> |