| 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: McmdTemplate.xsl |
| 9 |
Version: 1.0 (2005-03-01) |
| 10 |
Author: Maurizio Nagni |
| 11 |
Descr.: Merge the output of the McmdToXML.c script with the McmdInfo.xml |
| 12 |
file to generate a human readble verion of the Mcmd packet. |
| 13 |
The McmdReference Template build the header for the table that will |
| 14 |
contain the several types of MCMDs. |
| 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 "varDes" |
| 25 |
which will search inside the node "param" of the reference |
| 26 |
McmdInfo.xml (or whatever file instead of the is used) |
| 27 |
all values values of the node "@id" matching the valued passed when |
| 28 |
the key "param" is called --> |
| 29 |
<!-- No xml file is defined here because the xsl:key is absolutely generic --> |
| 30 |
<xsl:key name="varDes" match="mcmd" use="@id"/> |
| 31 |
|
| 32 |
<xsl:template match="/" name="McmdReference"> |
| 33 |
<xsl:param name="code"/> |
| 34 |
<xsl:for-each select="document('McmdInfo.xml')"> |
| 35 |
<xsl:for-each select="key('varDes', $code)"> |
| 36 |
<tr bgcolor="#FF0000"><td align="center" colspan='99'><th><xsl:value-of select="@name"/></th></td></tr> |
| 37 |
<tr> |
| 38 |
<xsl:for-each select="param"> |
| 39 |
<td bgcolor="#FF7700" align="left"><th><xsl:value-of select="@name"/></th></td> |
| 40 |
</xsl:for-each> |
| 41 |
</tr> |
| 42 |
</xsl:for-each> |
| 43 |
</xsl:for-each> |
| 44 |
</xsl:template> |
| 45 |
|
| 46 |
<xsl:template match="/" name="McmdTemplate"> |
| 47 |
<html> |
| 48 |
<body STYLE="font-family:Arial, helvetica, sans-serif; font-size:10pt"> |
| 49 |
<h2>Mcmd Event</h2> |
| 50 |
<table border='1'> |
| 51 |
<xsl:for-each select="//McmdEvent"> |
| 52 |
<tr bgcolor="#1acd32"> |
| 53 |
<th align="center" width='10%'>Packet OBT</th> |
| 54 |
<th align="center" width='10%'>Packet Num</th> |
| 55 |
</tr> |
| 56 |
<tr> |
| 57 |
<th align="left"><xsl:value-of select="@PacketOBT"/></th> |
| 58 |
<th align="left"><xsl:value-of select="@PacketNum"/></th> |
| 59 |
</tr> |
| 60 |
<xsl:for-each select="McmdRecord"> |
| 61 |
<tr bgcolor="#7777FF"> |
| 62 |
<th align="center">Mcmd OBT</th> |
| 63 |
<th align="center">SeqId</th> |
| 64 |
<th align="center">Type</th> |
| 65 |
<td rowspan = '2' width='100%'> |
| 66 |
<table bgcolor="#FFFFFF" width='100%' heigth='4'> |
| 67 |
<!--Here I fill the table header names --> |
| 68 |
<xsl:variable name="mcmd"> |
| 69 |
<xsl:value-of select="@ID1"/> |
| 70 |
</xsl:variable> |
| 71 |
|
| 72 |
<xsl:variable name="retTemplate"> |
| 73 |
<xsl:call-template name="McmdReference"> |
| 74 |
<xsl:with-param name="code" select="@ID1"/> |
| 75 |
</xsl:call-template> |
| 76 |
</xsl:variable> |
| 77 |
|
| 78 |
<xsl:if test='$mcmd!="e2"'> |
| 79 |
<xsl:if test='$retTemplate=""'> |
| 80 |
<tr><td><th align="left"><xsl:value-of select="ID1"/> - n.a.</th></td></tr> |
| 81 |
</xsl:if> |
| 82 |
<xsl:if test='$retTemplate!=""'> |
| 83 |
<xsl:copy-of select="$retTemplate" /> |
| 84 |
</xsl:if> |
| 85 |
</xsl:if> |
| 86 |
|
| 87 |
<!-- Here I fill the table values (take care of order!) --> |
| 88 |
<tr rowspan='2'> |
| 89 |
<xsl:if test='$mcmd!="e2"'> |
| 90 |
<xsl:for-each select="param"> |
| 91 |
<td><th align="left"><xsl:value-of select="."/></th></td> |
| 92 |
</xsl:for-each> |
| 93 |
</xsl:if> |
| 94 |
<xsl:if test='$mcmd="e2"'> |
| 95 |
<table bgcolor="#FFFFFF" width='100%'> |
| 96 |
<xsl:if test='$retTemplate=""'> |
| 97 |
<tr><td><th align="left"><xsl:value-of select="ID1"/> - n.a.</th></td></tr> |
| 98 |
</xsl:if> |
| 99 |
<xsl:if test='$retTemplate!=""'> |
| 100 |
<xsl:copy-of select="$retTemplate" /> |
| 101 |
</xsl:if> |
| 102 |
<xsl:for-each select="QUATERNION"> |
| 103 |
<tr> |
| 104 |
<xsl:for-each select="param"> |
| 105 |
<td><th align="left"><xsl:value-of select="."/></th></td> |
| 106 |
</xsl:for-each> |
| 107 |
</tr> |
| 108 |
</xsl:for-each> |
| 109 |
</table> |
| 110 |
</xsl:if> |
| 111 |
</tr> |
| 112 |
</table> |
| 113 |
</td> |
| 114 |
</tr> |
| 115 |
<tr> |
| 116 |
<th align="left"> |
| 117 |
<xsl:value-of select="@McmdOBT"/> |
| 118 |
</th> |
| 119 |
<th align="left"><xsl:value-of select="@SeqID"/></th> |
| 120 |
<th align="left"><xsl:value-of select="@ID1"/></th> |
| 121 |
</tr> |
| 122 |
</xsl:for-each> |
| 123 |
</xsl:for-each> |
| 124 |
|
| 125 |
</table> |
| 126 |
<!-- |
| 127 |
<td> |
| 128 |
0x |
| 129 |
<xsl:call-template name="Dec2Hex"> |
| 130 |
<xsl:with-param name="value" select="INFO1"/> |
| 131 |
</xsl:call-template> |
| 132 |
|
| 133 |
<xsl:value-of select="INFO1"/> |
| 134 |
</td> |
| 135 |
--> |
| 136 |
|
| 137 |
</body> |
| 138 |
</html> |
| 139 |
</xsl:template> |
| 140 |
|
| 141 |
</xsl:stylesheet> |