IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

XSL/XSLT/XPATH XML Discussion :

[XSLT]Problème de formatage XSL


Sujet :

XSL/XSLT/XPATH XML

  1. #1
    Nouveau Candidat au Club
    Profil pro
    Inscrit en
    Février 2003
    Messages
    5
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Février 2003
    Messages : 5
    Points : 1
    Points
    1
    Par défaut [XSLT]Problème de formatage XSL
    Bonjour,

    Je débute en XSL, et je suis en train de travailler sur un miniprojet de reformatage HTML de logs issues de Rational TestManager.

    J'ai un soucis de formatage conditionnel.

    Voici mon source XML:

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    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
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    305
    306
    307
    308
    309
    <TestLog>
    	<LogEvent ID="Computer Start">
    		<LogEventProperty ID="Event Type" Name="Event Type">Computer Start</LogEventProperty>
    		<LogEventProperty ID="Start Date" Name="Start Date">09/04/2006</LogEventProperty>
    		<LogEventProperty ID="Start Time" Name="Start Time">17:47:12</LogEventProperty>
    		<LogEventProperty ID="End Date" Name="End Date">09/04/2006</LogEventProperty>
    		<LogEventProperty ID="End Time" Name="End Time">17:47:12</LogEventProperty>
    		<LogEventProperty ID="Result" Name="Result"> </LogEventProperty>
    		<LogEventProperty ID="Failure Reason" Name="Failure Reason"> </LogEventProperty>
    		<LogEventProperty ID="Failure Description" Name="Failure Description"></LogEventProperty>
    		<LogEventProperty ID="Error File" Name="Error File">e000</LogEventProperty>
    		<LogEventProperty ID="Output File" Name="Output File">o000</LogEventProperty>
    		<LogEventProperty ID="Operating System" Name="Operating System">Windows</LogEventProperty>
    		<LogEventProperty ID="OS Version" Name="OS Version">2000</LogEventProperty>
    		<LogEventProperty ID="Processor" Name="Processor">Pentium</LogEventProperty>
    		<LogEventProperty ID="Display Resolution" Name="Display Resolution">1024x768</LogEventProperty>
    		<LogEventProperty ID="Display Color Bits" Name="Display Color Bits">32</LogEventProperty>
    		<LogEventProperty ID="OS Service Pack" Name="OS Service Pack">Service Pack 4</LogEventProperty>
    		<LogEventProperty ID="Memory Size" Name="Memory Size">248</LogEventProperty>
    		<LogEventProperty ID="Processor Number" Name="Processor Number">1</LogEventProperty>
    	</LogEvent>
    		<LogEvent ID="Log Message">
    			<LogEventProperty ID="Event Type" Name="Event Type">Log Message</LogEventProperty>
    			<LogEventProperty ID="Start Date" Name="Start Date">09/04/2006</LogEventProperty>
    			<LogEventProperty ID="Start Time" Name="Start Time">17:47:15</LogEventProperty>
    			<LogEventProperty ID="End Date" Name="End Date">09/04/2006</LogEventProperty>
    			<LogEventProperty ID="End Time" Name="End Time">17:47:15</LogEventProperty>
    			<LogEventProperty ID="Result" Name="Result"> </LogEventProperty>
    			<LogEventProperty ID="Failure Reason" Name="Failure Reason"> </LogEventProperty>
    			<LogEventProperty ID="Failure Description" Name="Failure Description"></LogEventProperty>
    			<LogEventProperty ID="Additional Information" Name="Additional Information">Nombre de lignes dans le datapool Protocole: 1</LogEventProperty>
    			<LogEventProperty ID="Additional Output" Name="Additional Output"></LogEventProperty>
    			<LogEventProperty ID="Script Line Number" Name="Script Line Number">245</LogEventProperty>
    			<LogEventProperty ID="Script Name" Name="Script Name">_PAR_Paramatrage2</LogEventProperty>
    			<LogEventProperty ID="Operating System" Name="Operating System">Windows</LogEventProperty>
    			<LogEventProperty ID="OS Version" Name="OS Version">2000</LogEventProperty>
    			<LogEventProperty ID="Processor" Name="Processor">Pentium</LogEventProperty>
    			<LogEventProperty ID="Display Resolution" Name="Display Resolution">1024x768</LogEventProperty>
    			<LogEventProperty ID="Display Color Bits" Name="Display Color Bits">32</LogEventProperty>
    			<LogEventProperty ID="OS Service Pack" Name="OS Service Pack">Service Pack 4</LogEventProperty>
    			<LogEventProperty ID="Memory Size" Name="Memory Size">248</LogEventProperty>
    			<LogEventProperty ID="Processor Number" Name="Processor Number">1</LogEventProperty>
    		</LogEvent>
    		<LogEvent ID="Log Message">
    			<LogEventProperty ID="Event Type" Name="Event Type">Log Message</LogEventProperty>
    			<LogEventProperty ID="Start Date" Name="Start Date">09/04/2006</LogEventProperty>
    			<LogEventProperty ID="Start Time" Name="Start Time">17:47:15</LogEventProperty>
    			<LogEventProperty ID="End Date" Name="End Date">09/04/2006</LogEventProperty>
    			<LogEventProperty ID="End Time" Name="End Time">17:47:15</LogEventProperty>
    			<LogEventProperty ID="Result" Name="Result">Informational</LogEventProperty>
    			<LogEventProperty ID="Failure Reason" Name="Failure Reason"> </LogEventProperty>
    			<LogEventProperty ID="Failure Description" Name="Failure Description"></LogEventProperty>
    			<LogEventProperty ID="Additional Information" Name="Additional Information">Code Produit : I045 - (ligne n° 2,colonne n° 1)</LogEventProperty>
    			<LogEventProperty ID="Additional Output" Name="Additional Output"></LogEventProperty>
    			<LogEventProperty ID="Script Line Number" Name="Script Line Number">0</LogEventProperty>
    			<LogEventProperty ID="Script Name" Name="Script Name">_PAR_Paramatrage2</LogEventProperty>
    			<LogEventProperty ID="Operating System" Name="Operating System">Windows</LogEventProperty>
    			<LogEventProperty ID="OS Version" Name="OS Version">2000</LogEventProperty>
    			<LogEventProperty ID="Processor" Name="Processor">Pentium</LogEventProperty>
    			<LogEventProperty ID="Display Resolution" Name="Display Resolution">1024x768</LogEventProperty>
    			<LogEventProperty ID="Display Color Bits" Name="Display Color Bits">32</LogEventProperty>
    			<LogEventProperty ID="OS Service Pack" Name="OS Service Pack">Service Pack 4</LogEventProperty>
    			<LogEventProperty ID="Memory Size" Name="Memory Size">248</LogEventProperty>
    			<LogEventProperty ID="Processor Number" Name="Processor Number">1</LogEventProperty>
    		</LogEvent>
    		<LogEvent ID="Log Message">
    			<LogEventProperty ID="Event Type" Name="Event Type">Log Message</LogEventProperty>
    			<LogEventProperty ID="Start Date" Name="Start Date">09/04/2006</LogEventProperty>
    			<LogEventProperty ID="Start Time" Name="Start Time">17:47:15</LogEventProperty>
    			<LogEventProperty ID="End Date" Name="End Date">09/04/2006</LogEventProperty>
    			<LogEventProperty ID="End Time" Name="End Time">17:47:15</LogEventProperty>
    			<LogEventProperty ID="Result" Name="Result"> </LogEventProperty>
    			<LogEventProperty ID="Failure Reason" Name="Failure Reason"> </LogEventProperty>
    			<LogEventProperty ID="Failure Description" Name="Failure Description"></LogEventProperty>
    			<LogEventProperty ID="Additional Information" Name="Additional Information">Code Tiers : 3 - (ligne n° 2,colonne n° 2)</LogEventProperty>
    			<LogEventProperty ID="Additional Output" Name="Additional Output"></LogEventProperty>
    			<LogEventProperty ID="Script Line Number" Name="Script Line Number">0</LogEventProperty>
    			<LogEventProperty ID="Script Name" Name="Script Name">_PAR_Paramatrage2</LogEventProperty>
    			<LogEventProperty ID="Operating System" Name="Operating System">Windows</LogEventProperty>
    			<LogEventProperty ID="OS Version" Name="OS Version">2000</LogEventProperty>
    			<LogEventProperty ID="Processor" Name="Processor">Pentium</LogEventProperty>
    			<LogEventProperty ID="Display Resolution" Name="Display Resolution">1024x768</LogEventProperty>
    			<LogEventProperty ID="Display Color Bits" Name="Display Color Bits">32</LogEventProperty>
    			<LogEventProperty ID="OS Service Pack" Name="OS Service Pack">Service Pack 4</LogEventProperty>
    			<LogEventProperty ID="Memory Size" Name="Memory Size">248</LogEventProperty>
    			<LogEventProperty ID="Processor Number" Name="Processor Number">1</LogEventProperty>
    		</LogEvent>
    		<LogEvent ID="Log Message">
    			<LogEventProperty ID="Event Type" Name="Event Type">Log Message</LogEventProperty>
    			<LogEventProperty ID="Start Date" Name="Start Date">09/04/2006</LogEventProperty>
    			<LogEventProperty ID="Start Time" Name="Start Time">17:47:16</LogEventProperty>
    			<LogEventProperty ID="End Date" Name="End Date">09/04/2006</LogEventProperty>
    			<LogEventProperty ID="End Time" Name="End Time">17:47:16</LogEventProperty>
    			<LogEventProperty ID="Result" Name="Result"> </LogEventProperty>
    			<LogEventProperty ID="Failure Reason" Name="Failure Reason"> </LogEventProperty>
    			<LogEventProperty ID="Failure Description" Name="Failure Description"></LogEventProperty>
    			<LogEventProperty ID="Additional Information" Name="Additional Information">Code gestion : I045/3 - (ligne n° 2,colonne n° 3)</LogEventProperty>
    			<LogEventProperty ID="Additional Output" Name="Additional Output"></LogEventProperty>
    			<LogEventProperty ID="Script Line Number" Name="Script Line Number">0</LogEventProperty>
    			<LogEventProperty ID="Script Name" Name="Script Name">_PAR_Paramatrage2</LogEventProperty>
    			<LogEventProperty ID="Operating System" Name="Operating System">Windows</LogEventProperty>
    			<LogEventProperty ID="OS Version" Name="OS Version">2000</LogEventProperty>
    			<LogEventProperty ID="Processor" Name="Processor">Pentium</LogEventProperty>
    			<LogEventProperty ID="Display Resolution" Name="Display Resolution">1024x768</LogEventProperty>
    			<LogEventProperty ID="Display Color Bits" Name="Display Color Bits">32</LogEventProperty>
    			<LogEventProperty ID="OS Service Pack" Name="OS Service Pack">Service Pack 4</LogEventProperty>
    			<LogEventProperty ID="Memory Size" Name="Memory Size">248</LogEventProperty>
    			<LogEventProperty ID="Processor Number" Name="Processor Number">1</LogEventProperty>
    		</LogEvent>
    		<LogEvent ID="Log Message">
    			<LogEventProperty ID="Event Type" Name="Event Type">Log Message</LogEventProperty>
    			<LogEventProperty ID="Start Date" Name="Start Date">09/04/2006</LogEventProperty>
    			<LogEventProperty ID="Start Time" Name="Start Time">17:47:16</LogEventProperty>
    			<LogEventProperty ID="End Date" Name="End Date">09/04/2006</LogEventProperty>
    			<LogEventProperty ID="End Time" Name="End Time">17:47:16</LogEventProperty>
    			<LogEventProperty ID="Result" Name="Result"> </LogEventProperty>
    			<LogEventProperty ID="Failure Reason" Name="Failure Reason"> </LogEventProperty>
    			<LogEventProperty ID="Failure Description" Name="Failure Description"></LogEventProperty>
    			<LogEventProperty ID="Additional Information" Name="Additional Information">Code confiement : 045 - (ligne n° 2,colonne n° 4)</LogEventProperty>
    			<LogEventProperty ID="Additional Output" Name="Additional Output"></LogEventProperty>
    			<LogEventProperty ID="Script Line Number" Name="Script Line Number">0</LogEventProperty>
    			<LogEventProperty ID="Script Name" Name="Script Name">_PAR_Paramatrage2</LogEventProperty>
    			<LogEventProperty ID="Operating System" Name="Operating System">Windows</LogEventProperty>
    			<LogEventProperty ID="OS Version" Name="OS Version">2000</LogEventProperty>
    			<LogEventProperty ID="Processor" Name="Processor">Pentium</LogEventProperty>
    			<LogEventProperty ID="Display Resolution" Name="Display Resolution">1024x768</LogEventProperty>
    			<LogEventProperty ID="Display Color Bits" Name="Display Color Bits">32</LogEventProperty>
    			<LogEventProperty ID="OS Service Pack" Name="OS Service Pack">Service Pack 4</LogEventProperty>
    			<LogEventProperty ID="Memory Size" Name="Memory Size">248</LogEventProperty>
    			<LogEventProperty ID="Processor Number" Name="Processor Number">1</LogEventProperty>
    		</LogEvent>
    		<LogEvent ID="Log Message">
    			<LogEventProperty ID="Event Type" Name="Event Type">Log Message</LogEventProperty>
    			<LogEventProperty ID="Start Date" Name="Start Date">09/04/2006</LogEventProperty>
    			<LogEventProperty ID="Start Time" Name="Start Time">17:47:16</LogEventProperty>
    			<LogEventProperty ID="End Date" Name="End Date">09/04/2006</LogEventProperty>
    			<LogEventProperty ID="End Time" Name="End Time">17:47:16</LogEventProperty>
    			<LogEventProperty ID="Result" Name="Result"> </LogEventProperty>
    			<LogEventProperty ID="Failure Reason" Name="Failure Reason"> </LogEventProperty>
    			<LogEventProperty ID="Failure Description" Name="Failure Description"></LogEventProperty>
    			<LogEventProperty ID="Additional Information" Name="Additional Information">Libéllé court : ST HONORE EVOLUTION - (ligne n° 2,colonne n° 5)</LogEventProperty>
    			<LogEventProperty ID="Additional Output" Name="Additional Output"></LogEventProperty>
    			<LogEventProperty ID="Script Line Number" Name="Script Line Number">0</LogEventProperty>
    			<LogEventProperty ID="Script Name" Name="Script Name">_PAR_Paramatrage2</LogEventProperty>
    			<LogEventProperty ID="Operating System" Name="Operating System">Windows</LogEventProperty>
    			<LogEventProperty ID="OS Version" Name="OS Version">2000</LogEventProperty>
    			<LogEventProperty ID="Processor" Name="Processor">Pentium</LogEventProperty>
    			<LogEventProperty ID="Display Resolution" Name="Display Resolution">1024x768</LogEventProperty>
    			<LogEventProperty ID="Display Color Bits" Name="Display Color Bits">32</LogEventProperty>
    			<LogEventProperty ID="OS Service Pack" Name="OS Service Pack">Service Pack 4</LogEventProperty>
    			<LogEventProperty ID="Memory Size" Name="Memory Size">248</LogEventProperty>
    			<LogEventProperty ID="Processor Number" Name="Processor Number">1</LogEventProperty>
    		</LogEvent>
    		<LogEvent ID="Log Message">
    			<LogEventProperty ID="Event Type" Name="Event Type">Log Message</LogEventProperty>
    			<LogEventProperty ID="Start Date" Name="Start Date">09/04/2006</LogEventProperty>
    			<LogEventProperty ID="Start Time" Name="Start Time">17:47:16</LogEventProperty>
    			<LogEventProperty ID="End Date" Name="End Date">09/04/2006</LogEventProperty>
    			<LogEventProperty ID="End Time" Name="End Time">17:47:16</LogEventProperty>
    			<LogEventProperty ID="Result" Name="Result"> </LogEventProperty>
    			<LogEventProperty ID="Failure Reason" Name="Failure Reason"> </LogEventProperty>
    			<LogEventProperty ID="Failure Description" Name="Failure Description"></LogEventProperty>
    			<LogEventProperty ID="Additional Information" Name="Additional Information">Libellé long : SAINT HONORE EVOLUTION - (ligne n° 2,colonne n° 6)</LogEventProperty>
    			<LogEventProperty ID="Additional Output" Name="Additional Output"></LogEventProperty>
    			<LogEventProperty ID="Script Line Number" Name="Script Line Number">0</LogEventProperty>
    			<LogEventProperty ID="Script Name" Name="Script Name">_PAR_Paramatrage2</LogEventProperty>
    			<LogEventProperty ID="Operating System" Name="Operating System">Windows</LogEventProperty>
    			<LogEventProperty ID="OS Version" Name="OS Version">2000</LogEventProperty>
    			<LogEventProperty ID="Processor" Name="Processor">Pentium</LogEventProperty>
    			<LogEventProperty ID="Display Resolution" Name="Display Resolution">1024x768</LogEventProperty>
    			<LogEventProperty ID="Display Color Bits" Name="Display Color Bits">32</LogEventProperty>
    			<LogEventProperty ID="OS Service Pack" Name="OS Service Pack">Service Pack 4</LogEventProperty>
    			<LogEventProperty ID="Memory Size" Name="Memory Size">248</LogEventProperty>
    			<LogEventProperty ID="Processor Number" Name="Processor Number">1</LogEventProperty>
    		</LogEvent>
    		<LogEvent ID="Log Message">
    			<LogEventProperty ID="Event Type" Name="Event Type">Log Message</LogEventProperty>
    			<LogEventProperty ID="Start Date" Name="Start Date">09/04/2006</LogEventProperty>
    			<LogEventProperty ID="Start Time" Name="Start Time">17:47:16</LogEventProperty>
    			<LogEventProperty ID="End Date" Name="End Date">09/04/2006</LogEventProperty>
    			<LogEventProperty ID="End Time" Name="End Time">17:47:16</LogEventProperty>
    			<LogEventProperty ID="Result" Name="Result"> </LogEventProperty>
    			<LogEventProperty ID="Failure Reason" Name="Failure Reason"> </LogEventProperty>
    			<LogEventProperty ID="Failure Description" Name="Failure Description"></LogEventProperty>
    			<LogEventProperty ID="Additional Information" Name="Additional Information">Code Confiement Garantie (1) : EPAR_RET - (ligne n° 2,colonne n° 7)</LogEventProperty>
    			<LogEventProperty ID="Additional Output" Name="Additional Output"></LogEventProperty>
    			<LogEventProperty ID="Script Line Number" Name="Script Line Number">0</LogEventProperty>
    			<LogEventProperty ID="Script Name" Name="Script Name">_PAR_Paramatrage2</LogEventProperty>
    			<LogEventProperty ID="Operating System" Name="Operating System">Windows</LogEventProperty>
    			<LogEventProperty ID="OS Version" Name="OS Version">2000</LogEventProperty>
    			<LogEventProperty ID="Processor" Name="Processor">Pentium</LogEventProperty>
    			<LogEventProperty ID="Display Resolution" Name="Display Resolution">1024x768</LogEventProperty>
    			<LogEventProperty ID="Display Color Bits" Name="Display Color Bits">32</LogEventProperty>
    			<LogEventProperty ID="OS Service Pack" Name="OS Service Pack">Service Pack 4</LogEventProperty>
    			<LogEventProperty ID="Memory Size" Name="Memory Size">248</LogEventProperty>
    			<LogEventProperty ID="Processor Number" Name="Processor Number">1</LogEventProperty>
    		</LogEvent>
    		<LogEvent ID="Log Message">
    			<LogEventProperty ID="Event Type" Name="Event Type">Log Message</LogEventProperty>
    			<LogEventProperty ID="Start Date" Name="Start Date">09/04/2006</LogEventProperty>
    			<LogEventProperty ID="Start Time" Name="Start Time">17:47:16</LogEventProperty>
    			<LogEventProperty ID="End Date" Name="End Date">09/04/2006</LogEventProperty>
    			<LogEventProperty ID="End Time" Name="End Time">17:47:16</LogEventProperty>
    			<LogEventProperty ID="Result" Name="Result"> </LogEventProperty>
    			<LogEventProperty ID="Failure Reason" Name="Failure Reason"> </LogEventProperty>
    			<LogEventProperty ID="Failure Description" Name="Failure Description"></LogEventProperty>
    			<LogEventProperty ID="Additional Information" Name="Additional Information">Insertion garanties (1) : EPARGNE RETRAITE - (ligne n° 2,colonne n° 8)</LogEventProperty>
    			<LogEventProperty ID="Additional Output" Name="Additional Output"></LogEventProperty>
    			<LogEventProperty ID="Script Line Number" Name="Script Line Number">0</LogEventProperty>
    			<LogEventProperty ID="Script Name" Name="Script Name">_PAR_Paramatrage2</LogEventProperty>
    			<LogEventProperty ID="Operating System" Name="Operating System">Windows</LogEventProperty>
    			<LogEventProperty ID="OS Version" Name="OS Version">2000</LogEventProperty>
    			<LogEventProperty ID="Processor" Name="Processor">Pentium</LogEventProperty>
    			<LogEventProperty ID="Display Resolution" Name="Display Resolution">1024x768</LogEventProperty>
    			<LogEventProperty ID="Display Color Bits" Name="Display Color Bits">32</LogEventProperty>
    			<LogEventProperty ID="OS Service Pack" Name="OS Service Pack">Service Pack 4</LogEventProperty>
    			<LogEventProperty ID="Memory Size" Name="Memory Size">248</LogEventProperty>
    			<LogEventProperty ID="Processor Number" Name="Processor Number">1</LogEventProperty>
    		</LogEvent>
    		<LogEvent ID="Log Message">
    			<LogEventProperty ID="Event Type" Name="Event Type">Log Message</LogEventProperty>
    			<LogEventProperty ID="Start Date" Name="Start Date">09/04/2006</LogEventProperty>
    			<LogEventProperty ID="Start Time" Name="Start Time">17:47:16</LogEventProperty>
    			<LogEventProperty ID="End Date" Name="End Date">09/04/2006</LogEventProperty>
    			<LogEventProperty ID="End Time" Name="End Time">17:47:16</LogEventProperty>
    			<LogEventProperty ID="Result" Name="Result"> </LogEventProperty>
    			<LogEventProperty ID="Failure Reason" Name="Failure Reason"> </LogEventProperty>
    			<LogEventProperty ID="Failure Description" Name="Failure Description"></LogEventProperty>
    			<LogEventProperty ID="Additional Information" Name="Additional Information">Code Confiement Garantie (2) : LIBRE - (ligne n° 2,colonne n° 9)</LogEventProperty>
    			<LogEventProperty ID="Additional Output" Name="Additional Output"></LogEventProperty>
    			<LogEventProperty ID="Script Line Number" Name="Script Line Number">0</LogEventProperty>
    			<LogEventProperty ID="Script Name" Name="Script Name">_PAR_Paramatrage2</LogEventProperty>
    			<LogEventProperty ID="Operating System" Name="Operating System">Windows</LogEventProperty>
    			<LogEventProperty ID="OS Version" Name="OS Version">2000</LogEventProperty>
    			<LogEventProperty ID="Processor" Name="Processor">Pentium</LogEventProperty>
    			<LogEventProperty ID="Display Resolution" Name="Display Resolution">1024x768</LogEventProperty>
    			<LogEventProperty ID="Display Color Bits" Name="Display Color Bits">32</LogEventProperty>
    			<LogEventProperty ID="OS Service Pack" Name="OS Service Pack">Service Pack 4</LogEventProperty>
    			<LogEventProperty ID="Memory Size" Name="Memory Size">248</LogEventProperty>
    			<LogEventProperty ID="Processor Number" Name="Processor Number">1</LogEventProperty>
    		</LogEvent>
    		<LogEvent ID="Log Message">
    			<LogEventProperty ID="Event Type" Name="Event Type">Log Message</LogEventProperty>
    			<LogEventProperty ID="Start Date" Name="Start Date">09/04/2006</LogEventProperty>
    			<LogEventProperty ID="Start Time" Name="Start Time">17:47:17</LogEventProperty>
    			<LogEventProperty ID="End Date" Name="End Date">09/04/2006</LogEventProperty>
    			<LogEventProperty ID="End Time" Name="End Time">17:47:17</LogEventProperty>
    			<LogEventProperty ID="Result" Name="Result"> </LogEventProperty>
    			<LogEventProperty ID="Failure Reason" Name="Failure Reason"> </LogEventProperty>
    			<LogEventProperty ID="Failure Description" Name="Failure Description"></LogEventProperty>
    			<LogEventProperty ID="Additional Information" Name="Additional Information">Insertion garanties (2) : Orientation libre - (ligne n° 2,colonne n° 10)</LogEventProperty>
    			<LogEventProperty ID="Additional Output" Name="Additional Output"></LogEventProperty>
    			<LogEventProperty ID="Script Line Number" Name="Script Line Number">0</LogEventProperty>
    			<LogEventProperty ID="Script Name" Name="Script Name">_PAR_Paramatrage2</LogEventProperty>
    			<LogEventProperty ID="Operating System" Name="Operating System">Windows</LogEventProperty>
    			<LogEventProperty ID="OS Version" Name="OS Version">2000</LogEventProperty>
    			<LogEventProperty ID="Processor" Name="Processor">Pentium</LogEventProperty>
    			<LogEventProperty ID="Display Resolution" Name="Display Resolution">1024x768</LogEventProperty>
    			<LogEventProperty ID="Display Color Bits" Name="Display Color Bits">32</LogEventProperty>
    			<LogEventProperty ID="OS Service Pack" Name="OS Service Pack">Service Pack 4</LogEventProperty>
    			<LogEventProperty ID="Memory Size" Name="Memory Size">248</LogEventProperty>
    			<LogEventProperty ID="Processor Number" Name="Processor Number">1</LogEventProperty>
    		</LogEvent>
    		<LogEvent ID="Log Message">
    			<LogEventProperty ID="Event Type" Name="Event Type">Log Message</LogEventProperty>
    			<LogEventProperty ID="Start Date" Name="Start Date">09/04/2006</LogEventProperty>
    			<LogEventProperty ID="Start Time" Name="Start Time">17:47:17</LogEventProperty>
    			<LogEventProperty ID="End Date" Name="End Date">09/04/2006</LogEventProperty>
    			<LogEventProperty ID="End Time" Name="End Time">17:47:17</LogEventProperty>
    			<LogEventProperty ID="Result" Name="Result"> </LogEventProperty>
    			<LogEventProperty ID="Failure Reason" Name="Failure Reason"> </LogEventProperty>
    			<LogEventProperty ID="Failure Description" Name="Failure Description"></LogEventProperty>
    			<LogEventProperty ID="Additional Information" Name="Additional Information">Code Confiement Garantie (3) : DEDIE - (ligne n° 2,colonne n° 11)</LogEventProperty>
    			<LogEventProperty ID="Additional Output" Name="Additional Output"></LogEventProperty>
    			<LogEventProperty ID="Script Line Number" Name="Script Line Number">0</LogEventProperty>
    			<LogEventProperty ID="Script Name" Name="Script Name">_PAR_Paramatrage2</LogEventProperty>
    			<LogEventProperty ID="Operating System" Name="Operating System">Windows</LogEventProperty>
    			<LogEventProperty ID="OS Version" Name="OS Version">2000</LogEventProperty>
    			<LogEventProperty ID="Processor" Name="Processor">Pentium</LogEventProperty>
    			<LogEventProperty ID="Display Resolution" Name="Display Resolution">1024x768</LogEventProperty>
    			<LogEventProperty ID="Display Color Bits" Name="Display Color Bits">32</LogEventProperty>
    			<LogEventProperty ID="OS Service Pack" Name="OS Service Pack">Service Pack 4</LogEventProperty>
    			<LogEventProperty ID="Memory Size" Name="Memory Size">248</LogEventProperty>
    			<LogEventProperty ID="Processor Number" Name="Processor Number">1</LogEventProperty>
    		</LogEvent>
    		<LogEvent ID="Abort">
    			<LogEventProperty ID="Event Type" Name="Event Type">Abort</LogEventProperty>
    			<LogEventProperty ID="Start Date" Name="Start Date">09/04/2006</LogEventProperty>
    			<LogEventProperty ID="Start Time" Name="Start Time">17:59:41</LogEventProperty>
    			<LogEventProperty ID="End Date" Name="End Date">09/04/2006</LogEventProperty>
    			<LogEventProperty ID="End Time" Name="End Time">17:59:41</LogEventProperty>
    			<LogEventProperty ID="Result" Name="Result">Fail</LogEventProperty>
    			<LogEventProperty ID="Failure Reason" Name="Failure Reason"> </LogEventProperty>
    			<LogEventProperty ID="Failure Description" Name="Failure Description"></LogEventProperty>
    			<LogEventProperty ID="Additional Information" Name="Additional Information">WriteLogMessage ,"Destination d'archivage :  - (ligne n° 3,colonne n° 21)",""</LogEventProperty>
    			<LogEventProperty ID="Additional Output" Name="Additional Output"></LogEventProperty>
    			<LogEventProperty ID="Script Line Number" Name="Script Line Number">1642</LogEventProperty>
    			<LogEventProperty ID="Script Name" Name="Script Name">_PAR_Paramatrage2</LogEventProperty>
    			<LogEventProperty ID="Operating System" Name="Operating System">Windows</LogEventProperty>
    			<LogEventProperty ID="OS Version" Name="OS Version">2000</LogEventProperty>
    			<LogEventProperty ID="Processor" Name="Processor">Pentium</LogEventProperty>
    			<LogEventProperty ID="Display Resolution" Name="Display Resolution">1024x768</LogEventProperty>
    			<LogEventProperty ID="Display Color Bits" Name="Display Color Bits">32</LogEventProperty>
    			<LogEventProperty ID="OS Service Pack" Name="OS Service Pack">Service Pack 4</LogEventProperty>
    			<LogEventProperty ID="Memory Size" Name="Memory Size">248</LogEventProperty>
    			<LogEventProperty ID="Processor Number" Name="Processor Number">1</LogEventProperty>
    		</LogEvent>
    	</LogEvent>
    </TestLog>
    Et voici le Xsl que j'ai écrit:

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    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
    <?xml version="1.0"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xml:lang="fr" lang="fr">
    	<xsl:output method="html"/>
     
    	<xsl:template match="/">
    		<xsl:variable name="EtatGeneral" select="/TestLog/LogEvent[@ID = 'Script Start']/LogEventProperty[@ID = 'Result']/text()"/>
    		<html>
    			<head>
    				<title>Script lancé : <xsl:value-of select="/TestLog/LogEvent[@ID = 'Script Start']/LogEventProperty[@ID = 'Script Name']"/></title>
    			</head>
     
    			<body bgcolor="white">
     
    				<!--xsl:choose>
    					<xsl:when test="$EtatGeneral = 'Fail'"></xsl:when>
    					<xsl:text>TEST en Fail</xsl:text>
    					<xsl:when test="$EtatGeneral = 'Pass'"></xsl:when>
    					<xsl:text>TEST en Pass</xsl:text>
    					<xsl:otherwise>
    						<xsl:text>  Essai ecriture  </xsl:text>
    					</xsl:otherwise>
    				</xsl:choose-->
     
     
    				<p>
    					<h2>Script lancé : <xsl:value-of select="/TestLog/LogEvent[@ID = 'Script Start']/LogEventProperty[@ID = 'Script Name']/text()"/></h2>
    				</p>
    				<b>
    					<xsl:text>Résultat global : </xsl:text>
    					<xsl:value-of select="/TestLog/LogEvent[@ID = 'Script Start']/LogEventProperty[@ID = 'Result']/text()"/>
    				</b>
    				<br/>
    				<br/>
    				<table border="5" cellspacing="2" cellpadding="5">
     
    					<tr bgcolor="lightyellow">
    						<th align="left">Type</th>
    						<th align="left">Ligne</th>
    						<th align="left">Détail</th>
    						<th align="left">Statut</th>
    						<th align="left">Temps</th>
    					</tr>
    					<xsl:for-each select="/TestLog/LogEvent[@ID = 'Script Start']/LogEvent">
    						<tr>
     
    							<td align="left">
    								<xsl:value-of select="LogEventProperty[@ID = 'Event Type']/text()"/>
    							</td>
    							<td align="left">
    								<xsl:text></xsl:text><xsl:value-of select="LogEventProperty[@ID = 'Script Line Number']/text()"/>
    							</td>
    							<td>
    								<xsl:value-of select="LogEventProperty[@ID = 'Additional Information']/text()"/>
    							</td>
     
    							<!--xsl:variable name="valeur" select="//LogEventProperty[@ID = 'Result']/text()"/>
     
    							<xsl:choose>
    								<xsl:when test="$valeur = 'Fail'"></xsl:when>
    								<td bgcolor="#00FFFF">
    									<xsl:value-of select="LogEventProperty[@ID = 'Result']/text()"/>
    								</td>
    								<xsl:when test="$valeur = 'Pass'"></xsl:when>
    								<td bgcolor="#55FFAA">
    									<xsl:value-of select="LogEventProperty[@ID = 'Result']/text()"/>
    								</td>
    								<xsl:when test="$valeur = 'Warning'"></xsl:when>
    								<td bgcolor="#FF22FF">
    									<xsl:value-of select="LogEventProperty[@ID = 'Result']/text()"/>
    								</td>
    								<xsl:when test="$valeur = 'Information'"></xsl:when>
    								<td bgcolor="#FFFF00">
    									<xsl:value-of select="LogEventProperty[@ID = 'Result']/text()"/>
    								</td>
    								<xsl:otherwise></xsl:otherwise>
    								<td>
    									<xsl:value-of select="LogEventProperty[@ID = 'Result']/text()"/>
    								</td>
    							</xsl:choose-->
     
    							<td>
    								<xsl:value-of select="LogEventProperty[@ID = 'Result']/text()"/>
    							</td>
    							<td>
    								<xsl:value-of select="LogEventProperty[@ID = 'Start Time']/text()"/>
    							</td>
    						</tr>
    					</xsl:for-each>
    				</table>
    			</body>
    		</html>
    	</xsl:template>
     
    	<xsl:template match="NewTemplate">
    	</xsl:template>
    </xsl:stylesheet>
    Je souhaite colorer les éléments $valeur en fonction du résultat.
    Mon problème vient de la partie xsl choose: en effet, ma variable $valeur semble bien être alimentée, mais je ne passe pas dans le bloc xsl choose

    Si une bonne ame pouvait me guider ...

    Merci d'avance !!!

  2. #2
    Nouveau Candidat au Club
    Profil pro
    Inscrit en
    Février 2003
    Messages
    5
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Février 2003
    Messages : 5
    Points : 1
    Points
    1
    Par défaut
    J'arrive à réaliser mes colorations uniquement avec des conditions If, ce qui rend mon code un peu lourd.

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    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
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xml:lang="fr" lang="fr">
    	<xsl:output method="html" encoding="iso-8859-1"/>
     
    	<xsl:template match="/">
    		<html>
    			<head>
    				<title>Script lancé : <xsl:value-of select="/TestLog/LogEvent[@ID = 'Script Start']/LogEventProperty[@ID = 'Script Name']"/></title>
    			</head>
     
    			<body bgcolor="white">
    				<xsl:variable name="EtatGeneral" select="/TestLog/LogEvent[@ID = 'Script Start']/LogEventProperty[@ID = 'Result']/text()"/>
     
    				<p>
    					<h2>Script : <xsl:value-of select="/TestLog/LogEvent[@ID = 'Script Start']/LogEventProperty[@ID = 'Script Name']/text()"/></h2>
    				</p>
    				<b>
     
    					<xsl:if test="/TestLog/LogEvent[@ID = 'Script Start']/LogEventProperty[@ID = 'Result']/text() = 'Fail'">
    						<h2>
    							<div align="center" style="background-color:red; color:lightgrey;">
    								<xsl:text>Résultat global : </xsl:text>
    								<xsl:value-of select="/TestLog/LogEvent[@ID = 'Script Start']/LogEventProperty[@ID = 'Result']/text()"/>
    							</div>
    						</h2>
    					</xsl:if>
    					<xsl:if test="/TestLog/LogEvent[@ID = 'Script Start']/LogEventProperty[@ID = 'Result']/text() = 'Pass'">
    						<h2>
    							<div align="center" style="background-color:green; color:lightgrey;">
    								<xsl:text>Résultat global : </xsl:text>
    								<xsl:value-of select="/TestLog/LogEvent[@ID = 'Script Start']/LogEventProperty[@ID = 'Result']/text()"/>
    							</div>
    						</h2>
    					</xsl:if>
    					<xsl:if test="/TestLog/LogEvent[@ID = 'Script Start']/LogEventProperty[@ID = 'Result']/text() = 'Warning'">
    						<h2>
    							<div align="center" style="background-color:orange; color:lightyellow;">
    								<xsl:text>Résultat global : </xsl:text>
    								<xsl:value-of select="/TestLog/LogEvent[@ID = 'Script Start']/LogEventProperty[@ID = 'Result']/text()"/>
    							</div>
    						</h2>
    					</xsl:if>
    				</b>
    				<br/>
    				<table border="5" cellspacing="2" cellpadding="5">
     
    					<tr bgcolor="lightyellow">
    						<th align="left">Type</th>
    						<th align="left">Ligne</th>
    						<th align="left">Détail</th>
    						<th align="left">Statut</th>
    						<th align="left">Temps</th>
    					</tr>
    					<xsl:for-each select="/TestLog/LogEvent[@ID = 'Script Start']/LogEvent">
    						<tr>
     
    							<td align="left">
    								<xsl:value-of select="LogEventProperty[@ID = 'Event Type']/text()"/>
    							</td>
    							<td align="left">
    								<xsl:text></xsl:text>
    								<xsl:value-of select="LogEventProperty[@ID = 'Script Line Number']/text()"/>
    							</td>
    							<td>
    								<xsl:value-of select="LogEventProperty[@ID = 'Additional Information']/text()"/>
    							</td>
     
    							<!--xsl:variable name="valeur" select="//LogEventProperty[@ID = 'Result']/text()"/>
     
    							<xsl:choose>
    								<xsl:when test="$valeur = 'Fail'"></xsl:when>
    								<td bgcolor="#00FFFF">
    									<xsl:value-of select="LogEventProperty[@ID = 'Result']/text()"/>
    								</td>
    								<xsl:when test="$valeur = 'Pass'"></xsl:when>
    								<td bgcolor="#55FFAA">
    									<xsl:value-of select="LogEventProperty[@ID = 'Result']/text()"/>
    								</td>
    								<xsl:when test="$valeur = 'Warning'"></xsl:when>
    								<td bgcolor="#FF22FF">
    									<xsl:value-of select="LogEventProperty[@ID = 'Result']/text()"/>
    								</td>
    								<xsl:when test="$valeur = 'Information'"></xsl:when>
    								<td bgcolor="#FFFF00">
    									<xsl:value-of select="LogEventProperty[@ID = 'Result']/text()"/>
    								</td>
    								<xsl:otherwise></xsl:otherwise>
    								<td>
    									<xsl:value-of select="LogEventProperty[@ID = 'Result']/text()"/>
    								</td>
    							</xsl:choose-->
     
    							<td>
    								<xsl:value-of select="LogEventProperty[@ID = 'Result']/text()"/>
    							</td>
    							<td>
    								<xsl:value-of select="LogEventProperty[@ID = 'Start Time']/text()"/>
    							</td>
    						</tr>
    					</xsl:for-each>
    				</table>
    			</body>
    		</html>
    	</xsl:template>
     
    	<xsl:template match="NewTemplate">
    	</xsl:template>
    </xsl:stylesheet>
    Quelqu'un pourrait m'aider svp?

  3. #3
    Rédacteur

    Avatar de Erwy
    Homme Profil pro
    Développeur Web
    Inscrit en
    Novembre 2003
    Messages
    4 967
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 48
    Localisation : France

    Informations professionnelles :
    Activité : Développeur Web
    Secteur : Administration - Collectivité locale

    Informations forums :
    Inscription : Novembre 2003
    Messages : 4 967
    Points : 10 927
    Points
    10 927
    Par défaut
    /TestLog/LogEvent[@ID = 'Script Start']/LogEventProperty[@ID = 'Result']/text()
    le text() ne doit pas être mis à la fin d'un xpath

  4. #4
    Nouveau Candidat au Club
    Profil pro
    Inscrit en
    Février 2003
    Messages
    5
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Février 2003
    Messages : 5
    Points : 1
    Points
    1
    Par défaut
    J'ai essayé cette solution, mais cela ne semble pas fonctionner.
    Le debugger que j'utilise me récuppère TOUTES les valeurs possibles pour ma variable $valeur

  5. #5
    Rédacteur

    Avatar de Erwy
    Homme Profil pro
    Développeur Web
    Inscrit en
    Novembre 2003
    Messages
    4 967
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 48
    Localisation : France

    Informations professionnelles :
    Activité : Développeur Web
    Secteur : Administration - Collectivité locale

    Informations forums :
    Inscription : Novembre 2003
    Messages : 4 967
    Points : 10 927
    Points
    10 927
    Par défaut
    Tu n'es pas très clair et j'ai l'impression que tu ne comprends pas tout a fait comment fonctionne un xpath ni les variables en xslt.

    Que veux tu ranger dans ta variable ?
    Pourquoi ces test qui se succèdent ?
    Quel noeud veux tu tester ?

  6. #6
    Nouveau Candidat au Club
    Profil pro
    Inscrit en
    Février 2003
    Messages
    5
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Février 2003
    Messages : 5
    Points : 1
    Points
    1
    Par défaut
    Je veux tester la valeur de chaque noeud /TestLog/LogEvent[@ID = 'Script Start']/LogEvent/LogEventProperty[@ID = 'Result']

    En fonction de cette valeur (Pass, Fail, Warning ...), je colore la case correspondante du tableau dans mon HTML résultat

  7. #7
    Rédacteur

    Avatar de Erwy
    Homme Profil pro
    Développeur Web
    Inscrit en
    Novembre 2003
    Messages
    4 967
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 48
    Localisation : France

    Informations professionnelles :
    Activité : Développeur Web
    Secteur : Administration - Collectivité locale

    Informations forums :
    Inscription : Novembre 2003
    Messages : 4 967
    Points : 10 927
    Points
    10 927
    Par défaut
    C'est ce que je craignais
    Si tu veux tester un ensemble de noeud tu dois boucler sur ces noeuds avec un for-each ou un template, il n'y a rien de ça dans ton premier script
    Pourrais tu donner un exemple plus "succint" , ne reprenant que le principe general de ce que tu veux (la on s'emmêle un peu dans le faisceau de balise ) pour qu'on puisse t'aider

  8. #8
    Nouveau Candidat au Club
    Profil pro
    Inscrit en
    Février 2003
    Messages
    5
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Février 2003
    Messages : 5
    Points : 1
    Points
    1
    Par défaut
    Alors je vais tenter d'être plus clair, en taillant un peu mon XML:

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    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
    <TestLog>
    	<LogEvent ID="Computer Start">
    	</LogEvent>
    	<LogEvent ID="Script Start">
    		<LogEventProperty ID="Event Type" Name="Event Type">Script Start</LogEventProperty>
    		<LogEventProperty ID="Start Date" Name="Start Date">09/04/2006</LogEventProperty>
    		<LogEventProperty ID="Start Time" Name="Start Time">17:47:12</LogEventProperty>
    		<LogEventProperty ID="End Date" Name="End Date">09/04/2006</LogEventProperty>
    		<LogEventProperty ID="End Time" Name="End Time">17:47:12</LogEventProperty>
    		<LogEventProperty ID="Result" Name="Result">Fail</LogEventProperty>
    		<LogEventProperty ID="Failure Reason" Name="Failure Reason"> </LogEventProperty>
    		<LogEventProperty ID="Failure Description" Name="Failure Description"></LogEventProperty>
    		<LogEventProperty ID="Script Line Number" Name="Script Line Number">1</LogEventProperty>
    		<LogEventProperty ID="Script Name" Name="Script Name">_PAR_Paramatrage2</LogEventProperty>
    		<LogEventProperty ID="Operating System" Name="Operating System">Windows</LogEventProperty>
    		<LogEventProperty ID="OS Version" Name="OS Version">2000</LogEventProperty>
    		<LogEventProperty ID="Processor" Name="Processor">Pentium</LogEventProperty>
    		<LogEventProperty ID="Display Resolution" Name="Display Resolution">1024x768</LogEventProperty>
    		<LogEventProperty ID="Display Color Bits" Name="Display Color Bits">32</LogEventProperty>
    		<LogEventProperty ID="OS Service Pack" Name="OS Service Pack">Service Pack 4</LogEventProperty>
    		<LogEventProperty ID="Memory Size" Name="Memory Size">248</LogEventProperty>
    		<LogEventProperty ID="Processor Number" Name="Processor Number">1</LogEventProperty>
    		<LogEvent ID="Log Message">
    			<LogEventProperty ID="Event Type" Name="Event Type">Log Message</LogEventProperty>
    			<LogEventProperty ID="Start Date" Name="Start Date">09/04/2006</LogEventProperty>
    			<LogEventProperty ID="Start Time" Name="Start Time">17:47:14</LogEventProperty>
    			<LogEventProperty ID="End Date" Name="End Date">09/04/2006</LogEventProperty>
    			<LogEventProperty ID="End Time" Name="End Time">17:47:14</LogEventProperty>
    			<LogEventProperty ID="Result" Name="Result">Pass</LogEventProperty>
    			<LogEventProperty ID="Failure Reason" Name="Failure Reason"> </LogEventProperty>
    			<LogEventProperty ID="Failure Description" Name="Failure Description"></LogEventProperty>
    			<LogEventProperty ID="Additional Information" Name="Additional Information">Elément sélectionné ---&gt;Standard</LogEventProperty>
    			<LogEventProperty ID="Additional Output" Name="Additional Output"></LogEventProperty>
    			<LogEventProperty ID="Script Line Number" Name="Script Line Number">45</LogEventProperty>
    			<LogEventProperty ID="Script Name" Name="Script Name">_PAR_Paramatrage2</LogEventProperty>
    			<LogEventProperty ID="Operating System" Name="Operating System">Windows</LogEventProperty>
    			<LogEventProperty ID="OS Version" Name="OS Version">2000</LogEventProperty>
    			<LogEventProperty ID="Processor" Name="Processor">Pentium</LogEventProperty>
    			<LogEventProperty ID="Display Resolution" Name="Display Resolution">1024x768</LogEventProperty>
    			<LogEventProperty ID="Display Color Bits" Name="Display Color Bits">32</LogEventProperty>
    			<LogEventProperty ID="OS Service Pack" Name="OS Service Pack">Service Pack 4</LogEventProperty>
    			<LogEventProperty ID="Memory Size" Name="Memory Size">248</LogEventProperty>
    			<LogEventProperty ID="Processor Number" Name="Processor Number">1</LogEventProperty>
    		</LogEvent>
    	</LogEvent>
    </TestLog>
    Le noeud que je veux tester est celui en rouge.

    Dans mon XSL, je mets bien un for each:
    <xsl:for-each select="/TestLog/LogEvent[@ID = 'Script Start']/LogEvent">



    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    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
    ...
    <!--xsl:variable name="valeur" select="//LogEventProperty[@ID = 'Result']"/>
     
    							<xsl:choose>
    								<xsl:when test="$valeur = 'Fail'"></xsl:when>
    								<td bgcolor="#00FFFF">
    									<xsl:value-of select="LogEventProperty[@ID = 'Result']"/>
    								</td>
    								<xsl:when test="$valeur = 'Pass'"></xsl:when>
    								<td bgcolor="#55FFAA">
    									<xsl:value-of select="LogEventProperty[@ID = 'Result']"/>
    								</td>
    								<xsl:when test="$valeur = 'Warning'"></xsl:when>
    								<td bgcolor="#FF22FF">
    									<xsl:value-of select="LogEventProperty[@ID = 'Result']"/>
    								</td>
    								<xsl:when test="$valeur = 'Information'"></xsl:when>
    								<td bgcolor="#FFFF00">
    									<xsl:value-of select="LogEventProperty[@ID = 'Result']"/>
    								</td>
    								<xsl:otherwise></xsl:otherwise>
    								<td>
    									<xsl:value-of select="LogEventProperty[@ID = 'Result']"/>
    								</td>
    							</xsl:choose-->
     
    ...
    Avec ce code lors du débug, rien n'est sélectionné. Il semble que soient concatténé l'ensemble des valeurs prises par chaque noeud ciblé.

    Est ce un soucis de portée de ma variable $valeur ?

    Merci d'avance

Discussions similaires

  1. Problème de formatage XSL
    Par Invité dans le forum ASP
    Réponses: 1
    Dernier message: 15/01/2008, 17h46
  2. [XSLT] probléme avec le xsl:if
    Par Mo_Poly dans le forum XSL/XSLT/XPATH
    Réponses: 2
    Dernier message: 13/11/2007, 21h45
  3. [XSLT] problème intégration d'applet dans une feuille XSL
    Par jymmy dans le forum XSL/XSLT/XPATH
    Réponses: 1
    Dernier message: 25/03/2007, 15h01
  4. Réponses: 3
    Dernier message: 17/07/2006, 08h29
  5. [XSLT] Problème PHP + XSL
    Par thefaycal dans le forum Bibliothèques et frameworks
    Réponses: 2
    Dernier message: 21/12/2005, 09h16

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo