| 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:otherwise> <xsl:value-of select="'#00ff00'"/> </xsl:otherwise> |
| 44 |
</xsl:choose> |
| 45 |
</xsl:variable> |
| 46 |
<tr bgcolor="{$bgcolor}"> |
| 47 |
<td><xsl:value-of select="$obt"/></td> |
| 48 |
<td><xsl:value-of select="type"/></td> |
| 49 |
<td> |
| 50 |
<A> |
| 51 |
<xsl:attribute name="href"> |
| 52 |
<xsl:value-of select="concat($CPUcode, fullfilename)"/> |
| 53 |
</xsl:attribute> |
| 54 |
<xsl:value-of select="fullfilename"/> |
| 55 |
<div></div> |
| 56 |
<xsl:value-of select="description"/> |
| 57 |
</A> |
| 58 |
</td> |
| 59 |
<td> |
| 60 |
0x |
| 61 |
<xsl:call-template name="Dec2Hex"> |
| 62 |
<xsl:with-param name="value" select="$info"/> |
| 63 |
</xsl:call-template> |
| 64 |
---- |
| 65 |
<xsl:value-of select="$info"/> |
| 66 |
</td> |
| 67 |
</tr> |
| 68 |
</xsl:if> |
| 69 |
</xsl:for-each> |
| 70 |
</xsl:for-each> |
| 71 |
</xsl:template> |
| 72 |
|
| 73 |
<xsl:template match="/" name="LogTemplate"> |
| 74 |
<html> |
| 75 |
<body STYLE="font-family:Arial, helvetica, sans-serif; font-size:12pt"> |
| 76 |
<h2>Log Records</h2> |
| 77 |
<table border="1"> |
| 78 |
<xsl:for-each select="//LOG_EVENT"> |
| 79 |
<tr bgcolor="#1acd32"> |
| 80 |
<th align="center">Packet OBT</th> |
| 81 |
<th align="center">Packet Num</th> |
| 82 |
</tr> |
| 83 |
<tr> |
| 84 |
<th align="left"><xsl:value-of select="PACKET_OBT"/></th> |
| 85 |
<th align="left"><xsl:value-of select="PACKET_NUM"/></th> |
| 86 |
</tr> |
| 87 |
<tr bgcolor="#9acd32"> |
| 88 |
<xsl:for-each select="//COL"> |
| 89 |
<th align="left"><xsl:value-of select="."/></th> |
| 90 |
</xsl:for-each> |
| 91 |
</tr> |
| 92 |
<xsl:for-each select="LOG_RECORDS/LOG_RECORD"> |
| 93 |
<xsl:variable name="retTemplate"> |
| 94 |
<xsl:call-template name="LogReference"> |
| 95 |
<xsl:with-param name="code" select="FILE_ID"/> |
| 96 |
<xsl:with-param name="line_no" select="LINE_NO"/> |
| 97 |
<xsl:with-param name="obt" select="RECORD_OBT"/> |
| 98 |
<xsl:with-param name="info" select="INFO1"/> |
| 99 |
</xsl:call-template> |
| 100 |
</xsl:variable> |
| 101 |
<xsl:if test='$retTemplate=""'> |
| 102 |
<tr> |
| 103 |
<td><xsl:value-of select="RECORD_OBT"/></td> |
| 104 |
<td><xsl:value-of select="MASKTYPE"/></td> |
| 105 |
<td><xsl:value-of select="FILE_ID"/> -- <xsl:value-of select="LINE_NO"/></td> |
| 106 |
<td> |
| 107 |
0x |
| 108 |
<xsl:call-template name="Dec2Hex"> |
| 109 |
<xsl:with-param name="value" select="INFO1"/> |
| 110 |
</xsl:call-template> |
| 111 |
---- |
| 112 |
<xsl:value-of select="INFO1"/> |
| 113 |
</td> |
| 114 |
</tr> |
| 115 |
</xsl:if> |
| 116 |
<xsl:if test='$retTemplate!=""'> |
| 117 |
<xsl:copy-of select="$retTemplate" /> |
| 118 |
</xsl:if> |
| 119 |
</xsl:for-each> |
| 120 |
</xsl:for-each> |
| 121 |
|
| 122 |
</table> |
| 123 |
</body> |
| 124 |
</html> |
| 125 |
</xsl:template> |
| 126 |
|
| 127 |
</xsl:stylesheet> |