Bonjour à tous,

j'ai fait le code affiché ci-après, il fonctionnait et ne fonctionne plus !

Le 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
<?xml version="1.0" encoding="ISO-8859-1" ?>
<?xml-stylesheet type="text/xsl" href="modele_3.xsl" ?> <!-- Le XSLT changera en fonction du modèle choisi -->
<root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="ecran.xsd">
	<ecran>
	</ecran>
	<modele>
		<nom />
		<titre />
		<description />
	</modele>
	<zones>
		<zone id="1" media="video" chemin="video.wmv" />
		<zone id="2" media="video" chemin="scary_gary.mov" />
		<zone id="3" media="image" chemin="stephane-camoufle.jpg" />
		<zone id="4" media="flash" chemin="snailrunner1.swf" />
	</zones>
</root>
Le XSLT
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
<?xml version="1.0" encoding="ISO-8859-1" ?>
<xsl:stylesheet version="1.0" 
			xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
			xmlns:fn="http://www.w3.org/2005/02/xpath-functions">
<xsl:output
			method="html" 
			encoding="ISO-8859-1" 
			doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
			doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
			indent="yes"/>
<xsl:template match="root">
	<html>
		<head>
			<title>Affichage 4 zones</title>
			<link rel="stylesheet" type="text/css" href="modele_3.css"/>
		</head>
		<body>
			<div class="global">
				<div class="centre">
					<!-- Saisir "about:plugins" dans la barre d'adresse du navigateur -->
					<!-- afin d'obtenir la liste des plugins activés. -->
					<!-- Il s'agit en fait de simples fichiers .DLL (sous Windows) -->
					<!-- Ils sont situés dans le répertoire plugins du profil utilisateur en cours. -->
						<div class="zone1">
							<xsl:if test="./zones/zone/@id = '1'">
								<xsl:apply-templates select="zone"/>
							</xsl:if>
						</div>
						<div class="zone2">
							<xsl:if test="./zones/zone/@id = '2'">
								<xsl:apply-templates select="zone"/>
							</xsl:if>
						</div>
						<div class="zone3">
							<xsl:if test="./zones/zone/@id = '3'">
								<xsl:apply-templates select="zone"/>
							</xsl:if>
						</div>
						<div class="zone4">
							<xsl:if test="./zones/zone/@id = '4'">
								<xsl:apply-templates select="zone"/>
							</xsl:if>
						</div>
				</div>
			</div>
		</body>
	</html>
</xsl:template>
 
<xsl:template match="zone">
	<xsl:variable name="ext"><xsl:value-of select="substring-after(./@chemin,'.')"/></xsl:variable>
	<xsl:if test="./@media = 'video'">
		debug
		<xsl:if test="$ext = 'avi' or $ext = 'wmv'">
			<!-- Si positionnement de l'attribut "classid" dans la balise "object" -->
			<!-- d'un média lu par Windows Media Player : -->
			<!-- apparition de la barre de contrôle, malgré le "autostart" à "false" !!! -->
			<!-- classid="clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6" -->
			<object 
				id="media_wmv" 
				data="{./@chemin}"
				type="video/x-ms-wmv"
				codebase="http://activex.microsoft.com/activex/controls/
					mplayer/en/nsmp2inf.cab#Version=6,4,5,715" 
				width="350px" height="350px" 
				standby="Chargement...">
					<param name="src" value="{./@chemin}" />
					<param name="autostart" value="false" />
					<param name="bgcolor" value="#000000" />
					<param name="controller" value="false" />
					<param name="loop" value="true" />
					<!-- Pour ie < 5 et Netscape <= 4 -->
					<embed 
						src="{./@chemin}" 
						type="video/x-ms-wmv" 
						width="350px" height="350px" 
						autostart="0" showcontrols="0" loop="1"
						bgcolor="#000000"
					/>
				<!-- Texte alternatif : fonctionne sous Firefox  -->
				Média n°1
			</object>
		</xsl:if>
		<xsl:if test="$ext = 'mov'">
			<object 
				id="media_mov" 
				data="{./@chemin}"
				type="video/quicktime"
				classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" 
				codebase="http://www.apple.com/qtactivex/qtplugin.cab" 
				width="350px" height="350px" 
				standby="Chargement...">
					<param name="src" value="{./@chemin}" />
					<param name="autostart" value="false" />
					<param name="bgcolor" value="#000000" />
					<param name="controller" value="false" />
					<param name="loop" value="true" />
					<!-- Pour ie < 5 et Netscape <= 4 -->
					<embed 
						src="{./@chemin}" 
						type="video/quicktime"
						pluginspage="http://www.apple.com/qtactivex/qtplugin.cab" 
						width="350px" height="350px" 
						autostart="false" controller="false" loop="true" 
						bgcolor="#000000" 
					/>
				<!-- Texte alternatif : fonctionne sous Firefox, mais fonctionne mal !  -->
				Vidéo Quicktime
			</object>
		</xsl:if>
		<xsl:if test="$ext = 'rm'">
			<!-- type="audio/x-pn-realaudio-plugin"  -->
			<object 
				id="media_rm" 
				data="{./@chemin}" 
				classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA"
				codebase="http://www.codecguide.com/about_real.htm" 
				width="350px" height="350px" 
				standby="Chargement...">
					<param name="src" value="{./@chemin}" />
					<param name="autostart" value="false" />
					<param name="bgcolor" value="#000000" />
					<param name="console" value="one" />
					<param name="controls" value="ImageWindow" />
					<param name="loop" value="true" />
					<!-- Pour ie < 5 et Netscape <= 4 -->
					<embed 
						src="{./@chemin}" 
						type="audio/x-pn-realaudio-plugin" 
						pluginspage="http://www.codecguide.com/about_real.htm" 
						width="350px" height="350px" 
						autostart="false" controls="ImageWindow" loop="true" 
						bgcolor="#000000" 
					/>
				<!-- Texte alternatif : fonctionne sous Firefox, mais fonctionne mal !  -->
				Vidéo Real Media
			</object>
		</xsl:if>
	</xsl:if>
	<xsl:if test="./@media = 'image'">
		<img src="{./@chemin}" height="100px" width="100px" alt="Une image promotionnelle" />
		<!--
		<xsl:if test="$ext = 'jpg'">
		</xsl:if>
		<xsl:if test="$ext = 'gif'">
		</xsl:if>
		<xsl:if test="$ext = 'png'">
		</xsl:if>
		-->
	</xsl:if>
	<xsl:if test="./@media = 'flash'">
		<!-- 
			classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0"
		-->
		<object
			id="media_flash"
			data="{./@chemin}"
			type="application/x-shockwave-flash"
			width="350px"
			height="350px"
			bgcolor="#000000"
			standby="Chargement...">
				<param name="movie" value="{./@chemin}" />
				<param name="autostart" value="false" /><!-- Le Flash se lance en automatique tout de même !!! -->
				<param name="bgcolor" value="#000000" />
				<param name="loop" value="true" /><!-- Le Flash boucle tout de même !!! -->
				<param name="quality" value="high" />
				<!-- Pour ie < 5 et Netscape <= 4 -->
				<embed 
					src="{./@chemin}" 
					type="application/x-shockwave-flash" 
					pluginspage="http://www.macromedia.com/shockwave/download/
						index.cgi?P1_Prod_Version=ShockwaveFlash" 
					width="350px" height="350px" 
					autostart="false" loop="true" 
					bgcolor="#000000" 
					quality="best" 
				/>
			<!-- Texte alternatif : fonctionne sous Firefox, mais fonctionne mal !  -->
			Animation Flash
		</object>
	</xsl:if>
</xsl:template>
</xsl:stylesheet>
Le CSS
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
body {
	margin: 0;
	padding: 0;
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 0.8em;
	background-color: #fff;
}
.global {
	position: absolute;
	left: 50%;
	top: 50%;
	width: 1000px;
	height: 730px;
	margin-top: -365px;
	margin-left: -500px;
}
 
.centre {
	position: absolute;
	width: 990px;
	height: 720px;
	padding: 5px;
	background-color: #FFFFE6;
	border: 2px solid #000000;
}
	.zone1 {
		float: left;
		width: 485px;
		height: 350px;
		padding: 2px;
		background-color: orange;
		border: 1px solid #000000;
		text-align: center;
	}
	.zone2 {
		float: right;
		width: 485px;
		height: 350px;
		padding: 2px;
		background-color: orange;
		border: 1px solid #000000;
		text-align: center;
	}
	.zone3 {
		position: absolute;
		left: 5px;
		bottom: 5px;
		width: 485px;
		height: 350px;
		padding: 2px;
		background-color: orange;
		border: 1px solid #000000;
		text-align: center;
	}
	.zone4 {
		position: absolute;
		right: 5px;
		bottom: 5px;
		width: 485px;
		height: 350px;
		padding: 2px;
		background-color: orange;
		border: 1px solid #000000;
		text-align: center;
	}
 
#media {
	position: relative;
	left: 50%;
	top: 50%;
	width: 350px;
	height: 350px;
	margin-top: -175px;
	margin-left: -175px;
}
Le XML et le CSS sont bon, je pencherais plus pour une erreur dans les chemins : parcours de l'arbre.