-
Notifications
You must be signed in to change notification settings - Fork 0
/
OBNT-CRF.XSL
204 lines (193 loc) · 6.39 KB
/
OBNT-CRF.XSL
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">
<!--
style-sheet de présentation des messages OBNT
-->
<!-- Subroutine that replaces a leading space or tab -->
<!-- with a hard (non-breaking) space -->
<!-- Input: parameter "str", a string -->
<!-- Returns: value of "str" w/ leading space replaced -->
<xsl:template name="replace-leading-space">
<xsl:param name="str"/>
<xsl:variable name="first" select="substring( $str, 1, 1 )"/>
<xsl:choose>
<xsl:when test="$first=' ' or $first='	'">
<xsl:value-of select="concat(' ', substring( $str, 2 ))"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$str"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:output method="html" version="1.0" encoding="ISO-8859-1" indent="yes"/>
<xsl:template match="/">
<html>
<head>
<style type="text/css">
table.msg {
width: 700px;
font-family: Arial, Helvetica, sans-serif;
border-style: solid;
border-width: 1;
}
table.title {
width: 100%;
font-weight: bold;
text-align: center;
}
th.title {
font-size: 1.2em;
color: red
}
td.title {
font-size: 2em;
}
td.mode {
color: lime;
}
table.pgh {
width: 100%;
border-width: 0;
}
th.pgh {
text-align: center;
background-color: red;
color: white;
}
td.lib {
width: 25%;
}
</style>
</head>
<body align="center" width="700px">
<table class="msg">
<tr>
<td>
<table class="title">
<tr>
<th class="title">CROIX-ROUGE FRANCAISE - DDUS DU MORBIHAN</th>
</tr>
<tr>
<th class="title">DELEGATION LOCALE DE VANNES</th>
</tr>
<tr>
<td>
<hr size="3" color="red" />
<hr size="3" color="red" />
</td>
</tr>
<tr>
<td class="title">MESSAGE</td>
</tr>
<tr>
<td class="mode">
<xsl:if test="msg/mode = 'Exercice'">- EXERCICE - EXERCICE - EXERCICE -</xsl:if>
</td>
</tr>
</table>
<br/>
<table class="pgh">
<tr>
<th class="pgh" colspan="2">Informations transmission</th>
</tr>
<tr>
<td class="lib">Groupe Date/Heure</td>
<td><xsl:value-of select="msg/trans/gdh"/> </td>
</tr>
<tr>
<td class="lib">Emis par</td>
<td><xsl:value-of select="msg/trans/emis"/> </td>
</tr>
<tr>
<td class="lib">Reçu par</td>
<td><xsl:value-of select="msg/trans/recu"/> </td>
</tr>
<tr>
<td>Instructions particulières</td>
<td><xsl:value-of select="msg/trans/instr"/> </td>
</tr>
</table>
<br/>
<table class="pgh">
<tr>
<th class="pgh" colspan="2">Message OBNT</th>
</tr>
<tr>
<td class="lib">Origine</td>
<td><xsl:value-of select="msg/top/from"/> </td>
</tr>
<tr>
<td class="lib">Dest. Action</td>
<td><xsl:value-of select="msg/top/to"/> </td>
</tr>
<tr>
<td class="lib">Dest. Info</td>
<td><xsl:value-of select="msg/top/info"/> </td>
</tr>
<tr>
<td class="lib">Urgence</td>
<td><xsl:value-of select="msg/top/urg"/> </td>
</tr>
<tr>
<td colspan = "3">
<hr size="3" color="red" />
</td>
</tr>
<tr>
<td class="lib">Objet</td>
<td><xsl:value-of select="msg/corps/obj"/> </td>
</tr>
<tr>
<td class="lib">Référence</td>
<td><xsl:value-of select="msg/corps/ref"/> </td>
</tr>
<tr>
<td class="lib" valign="top">Message</td>
<td >
<xsl:for-each select="msg/corps/txt">
<xsl:value-of select="."/><br/>
</xsl:for-each>
</td>
</tr>
</table>
<br/>
<table class="pgh">
<tr>
<th class="pgh" colspan="2">Fin message</th>
</tr>
<tr>
<td class="lib">GDH Dépôt</td>
<td><xsl:value-of select="msg/bot/gdh"/> </td>
</tr>
<tr>
<td class="lib">Demande A.R.</td>
<td><xsl:value-of select="msg/bot/ack"/> </td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<table class="title">
<tr>
<td class="mode">
<xsl:if test="msg/mode = 'Exercice'">- EXERCICE - EXERCICE - EXERCICE -</xsl:if>
</td>
</tr>
<tr>
<td align="right">
<font size="1.5px">
Message OBNT
<br/>
<xsl:value-of select="msg/soft"/> <xsl:value-of select="msg/vers"/>
</font>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>