| 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: VarDumpTemplate.xsl |
| 9 |
Version: 1.0 (2005-03-01) |
| 10 |
Author: Maurizio Nagni |
| 11 |
Descr.: Merge the output of the VarDumpToXml.c script with the VarDumpInfo.xml |
| 12 |
file to generate a human readble verion of the VarDump 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 |
VarDumpInfo.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="varDes" match="var" use="idx"/> |
| 29 |
|
| 30 |
<xsl:template match="/" name="VarDumpReference"> |
| 31 |
<xsl:param name="code"/> |
| 32 |
<xsl:param name="varval"/> |
| 33 |
<xsl:for-each select="document('./compilationInfo/PRH_ParamHandler_INFN_auto.var.xml')"> |
| 34 |
<xsl:for-each select="key('varDes', $code)"> |
| 35 |
<td><xsl:value-of select="name"/> -- <xsl:value-of select="idx"/></td> |
| 36 |
<td><xsl:value-of select="comment"/></td> |
| 37 |
<td> |
| 38 |
<xsl:call-template name="Dec2Hex"> |
| 39 |
<xsl:with-param name="value" select="$varval"/> |
| 40 |
</xsl:call-template> |
| 41 |
</td> |
| 42 |
</xsl:for-each> |
| 43 |
</xsl:for-each> |
| 44 |
</xsl:template> |
| 45 |
|
| 46 |
<xsl:template match="/" name="VarDumpTemplate"> |
| 47 |
<html> |
| 48 |
<body STYLE="font-family:Arial, helvetica, sans-serif; font-size:12pt"> |
| 49 |
<h2>VarDump Event</h2> |
| 50 |
<table border="1"> |
| 51 |
<xsl:for-each select="//VARDUMP_EVENT"> |
| 52 |
<tr bgcolor="#1acd32"> |
| 53 |
<th align="center">Packet OBT</th> |
| 54 |
<th align="center">Packet Num</th> |
| 55 |
</tr> |
| 56 |
<tr> |
| 57 |
<td><xsl:value-of select="PACKET_OBT"/></td> |
| 58 |
<td><xsl:value-of select="PACKET_NUM"/></td> |
| 59 |
</tr> |
| 60 |
<tr bgcolor="#9acd32"> |
| 61 |
<th align="left">Name (ID) </th> |
| 62 |
<th align="left">Description</th> |
| 63 |
<th align="left">Value </th> |
| 64 |
</tr> |
| 65 |
<!--<xsl:variable name="compTS" select="COMPILATION_TS"> </xsl:variable>--> |
| 66 |
<xsl:for-each select="VARDUMP_RECORDS/VARDUMP_RECORD"> |
| 67 |
<tr> |
| 68 |
<xsl:variable name="retTemplate"> |
| 69 |
<xsl:call-template name="VarDumpReference"> |
| 70 |
<xsl:with-param name="code" select="VAR_ID"/> |
| 71 |
<xsl:with-param name="varval" select="VAR_VALUE"/> |
| 72 |
</xsl:call-template> |
| 73 |
</xsl:variable> |
| 74 |
<xsl:if test='$retTemplate=""'> |
| 75 |
<td><xsl:value-of select="VAR_ID"/> -- n.a.</td> |
| 76 |
<td> n.a. </td> |
| 77 |
<td> |
| 78 |
<xsl:call-template name="Dec2Hex"> |
| 79 |
<xsl:with-param name="value" select="VAR_VALUE"/> |
| 80 |
</xsl:call-template> |
| 81 |
</td> |
| 82 |
|
| 83 |
</xsl:if> |
| 84 |
<xsl:if test='$retTemplate!=""'> |
| 85 |
<xsl:copy-of select="$retTemplate" /> |
| 86 |
</xsl:if> |
| 87 |
<!-- |
| 88 |
<td> |
| 89 |
0x |
| 90 |
<xsl:call-template name="Dec2Hex"> |
| 91 |
<xsl:with-param name="value" select="INFO1"/> |
| 92 |
</xsl:call-template> |
| 93 |
|
| 94 |
<xsl:value-of select="INFO1"/> |
| 95 |
</td> |
| 96 |
--> |
| 97 |
</tr> |
| 98 |
</xsl:for-each> |
| 99 |
</xsl:for-each> |
| 100 |
|
| 101 |
</table> |
| 102 |
</body> |
| 103 |
</html> |
| 104 |
</xsl:template> |
| 105 |
|
| 106 |
</xsl:stylesheet> |