Bonjour , j'ai besoin d'integrer du contenu audio dans ma page xml sauf que j'ai un petit problème lors de lecture du contenu audio il n'y a qu'un seul qui se répéte sur tous les autres . je ne sais pas d'ou vient le problème
voici mes fichier xml et xsl


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
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt"
      xmlns:user="http://mycompany.com/mynamespace">
 
<xsl:template match="/">
  <html>
  <body>
  <h2>Liste des musiques</h2>
    <table border="1">
      <tr bgcolor="#CC0033">
        <th style="text-align:left">artiste</th>
        <th style="text-align:left">nom</th>
        <th style="text-align:left">location</th>
        <th style="text-align:left">play</th>
        <th style="text-align:left">pause</th>
      </tr>
      <xsl:for-each select="music/morceau">
      <tr>
 
        <td><xsl:value-of select="artiste"/></td>
        <td><xsl:value-of select="nom"/></td>
        <td> <xsl:value-of select="audio" /> </td>
        <td><input  type="button" value="play"  onclick="user:playAudio()"/>
        <td><input  type="button" value="pause"  onclick="user:pauseAudio()"/>
  <xsl:element name="audio">
  	<xsl:attribute name="id">myAudio</xsl:attribute>
  	<xsl:attribute name="chemin"><xsl:value-of select="audio"/></xsl:attribute>
 	 <xsl:element name="source">
  		<xsl:attribute name="src"><xsl:value-of select="audio"/></xsl:attribute>
    		<xsl:attribute name="type">audio/mpeg</xsl:attribute>
	</xsl:element>
</xsl:element>
        </td>
        </td>
      </tr>
 
      </xsl:for-each>
    </table>
    <script>
 
    	  var x = document.getElementById("myAudio"); 
 
	function playAudio() { 
		x.pause();
		x.currentTime = 0;
		var y = document.getElementById("myAudio").getAttribute("chemin");
 
		x.play();
		console.log(y);
	} 
 
	function pauseAudio() { 
	    x.pause(); 
	} 
 
    </script>
  </body>
  </html>
</xsl:template>
</xsl:stylesheet>
 
 
 
 
----------------------------------------------------
 
 
<?xml version="1.0" encoding="UTF-8"?>
 
<!-- New document created with EditiX at Sun Mar 20 12:35:01 VET 2016 -->
 
<?xml-stylesheet href="projet.xsl" type="text/xsl"?>
 
 
 <music >
               <morceau  id="1">
               	<audio>mp3/1.mp3</audio>
               	<artiste>sherine abde lwahab</artiste>
               	<nom>enta akher wahed </nom>
               </morceau>
               <morceau  id="2">
               	<audio>mp3/2.mp3</audio>
               	<artiste>hama9i</artiste>
               	<nom>Agmal Youm </nom>
               </morceau>
               <morceau  id="3">
               	<audio>mp3/3.mp3</audio>
               	<artiste>hama9i</artiste>
               	<nom>Baedna Leh </nom>
               </morceau>
               <morceau  id="4">
               	<audio>mp3/4.mp3</audio>
               	<artiste>Marwan Khoury</artiste>
               	<nom>Fakart Insit </nom>
               </morceau>
               <morceau  id="5">
               	<audio>mp3/5.mp3</audio>
               	<artiste>Majed Al Mohandis</artiste>
               	<nom>Ya Hob Ya Hob</nom>
               </morceau>
 
               <audio-player><embed type="audio/mpeg" src="mp3/Enta Akher Wahed , Sherine   -إنتَ آخر وآحد , شري.mp3" height="27" width="207" quality="best"></embed></audio-player>
 
 
 
</music>