Bonjour
Pouvez-vous m'aider :
J'ai crée un fichier catalogue.xml
J'ai crée un fichier catalogue.xls
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 1. <?xml version="1.0" encoding="iso-8859-1"?> 2. <?xml-stylesheet version="1.1" type="text/xsl" href="catalogue.xsl"?> 3. <catalogue> 4. <categorie> 5. <nom>A</nom> 6. <categorie> 7. <nom> ALBERT toto </nom> 8. <document> 9. <titre>Envoyer un message</titre> 10. <grade>xxx</grade> 11. <poste>yyyy</poste> 12. <secteur>zzzzzzzzzzzz</secteur> 13. <tel>00.00.00.00.00</tel> 14. <ref>mailto:xx@toto.fr</ref> 15. </document> 16. </categorie> 17. </categorie> 18. <categorie> 19. <nom>B</nom> 20. <categorie> 21. <nom>BONSOIR Vous</nom> 22. <document> 23. <titre>Envoyer un message</titre> 24. <grade>xxx</grade> 25. <poste>zzzz</poste> 26. <secteur>ffffffffffff</secteur> 27. <tel>00.00.00.00.01</tel> 28. <ref>mailto:zz@toto.fr</ref> 29. </document> 30. </categorie> 31. </categorie> 32. </catalogue>
je n'ai aucun soucis pour visualiser le fichier xml dans Internet Explorer mais avec Firefox , j'ai le message suivant
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 1. <?xml version="1.0" encoding="ISO-8859-1" ?> 2. - <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/TR/WD-xsl"> 3. - <xsl:template match="/"> 4. - <html> 5. - <head> 6. <link rel="stylesheet" type="text/css" href="catalogue.css" /> 7. <title>Annuaire </title> 8. <base target="_new" /> 9. - <script> 10. - <xsl:comment> 11. - <![CDATA[ 12. var deplier = true; 13. var replier = false; 14. 15. function deplirepli(titre, depli) 16. { 17. plus = titre.children[0]; 18. moins = titre.children[1]; 19. div = titre.parentElement; 20. moins.style.display = depli ? "" : "none"; 21. plus.style.display = depli ? "none" : ""; 22. titre.title="Cliquer pour " + (depli ? "re" : "dé" ) + "plier"; 23. div.children[1].style.display= depli ? "" : "none"; 24. } 25. 26. function deplirepliTout(action) 27. { 28. 29. coll = document.all.tags("div" ); 30. for (i=0; i<coll.length; i++) 31. { 32. if (coll[i].className == "title" ) 33. { 34. deplirepli(coll[i], action); 35. } 36. } 37. } 38. 39. 40. function toggleDisplay(titre) 41. { 42. plus = titre.children[0]; 43. 44. if (plus.style.display=="" ) 45. // déplier 46. { 47. deplirepli(titre, deplier); 48. } 49. else 50. // replier 51. { 52. deplirepli(titre, replier); 53. } 54. } 55. 56. 57. function display(identifieur) 58. { 59. if (identifieur!=null) { 60. deplirepliTout(replier); 61. personne=document.getElementById(identifieur); 62. var parent=personne.parentNode; 63. while (parent.tagName!="BODY" ) 64. { 65. parent.style.display=""; 66. parent=parent.parentNode; 67. } 68. } 69. 70. nom = personne.children(0); 71. nom.style.backgroundColor="navajowhite"; 72. nom.style.color="white"; 73. nom.style.fontSize="larger"; 74. document.location="#"+identifieur 75. } 76. 77. function changeButton(selection) 78. { 79. document.all.bouton.title=document.getElementById(selection.value).children[0].innerText; 80. } 81. 82. 83. 84. ]]> 85. </xsl:comment> 86. </script> 87. </head> 88. - <BODY> 89. - <DIV id="listing"> 90. <xsl:apply-templates select="catalogue" /> 91. </DIV> 92. - <P class="petit"> 93. <A HREF="mailto:aaa@toto.fr">Signaler toute anomalie</A> 94. </P> 95. </BODY> 96. </html> 97. </xsl:template> 98. - <xsl:template match="catalogue"> 99. - <h1 id="titre"> 100. <input class="grosbouton" style="float:left" type="button" value="++" title="Tout déplier" onclick="deplirepliTout(deplier)" /> 101. <input class="grosbouton" style="float:right" type="button" value="--" title="Tout replier" onclick="deplirepliTout(replier)" /> 102. Annuaire 103. <span style="cursor:hand" title="Annuaire">HHHHH</span> 104. </h1> 105. <xsl:apply-templates select="categorie" order-by="nom" /> 106. </xsl:template> 107. - <xsl:template match="categorie"> 108. - <DIV CLASS="wrapping"> 109. - <DIV CLASS="title" onclick="toggleDisplay(this)"> 110. - <xsl:attribute name="title"> 111. - <xsl:if test="aide"> 112. <xsl:value-of select="aide" /> 113. <xsl:eval>"\r"</xsl:eval> 114. </xsl:if> 115. Cliquez vite pour en savoir plus 116. </xsl:attribute> 117. <SPAN>+</SPAN> 118. <SPAN STYLE="display:none">-</SPAN> 119. <xsl:value-of select="nom" /> 120. </DIV> 121. - <DIV CLASS="wrapping" STYLE="display:none"> 122. <xsl:apply-templates select="categorie" order-by="nom" /> 123. - <xsl:if test="document"> 124. - <table class="persons"> 125. <xsl:apply-templates select="document" order-by="titre" /> 126. </table> 127. </xsl:if> 128. </DIV> 129. </DIV> 130. </xsl:template> 131. - <xsl:template match="document"> 132. - <tr class="document"> 133. - <xsl:attribute name="ID"> 134. <xsl:eval>uniqueID(this)</xsl:eval> 135. </xsl:attribute> 136. 137. 138. - <td> 139. - <a> 140. - <xsl:attribute name="name"> 141. <xsl:eval>uniqueID(this)</xsl:eval> 142. </xsl:attribute> 143. </a> 144. - <a> 145. <xsl:attribute name="title">Cliquer pour envoyer un message</xsl:attribute> 146. - <xsl:attribute name="href"> 147. <xsl:value-of select="ref" /> 148. </xsl:attribute> 149. <xsl:value-of select="titre" /> 150. </a> 151. </td> 152. - <td> 153. <xsl:value-of select="poste" /> 154. </td> 155. - <td> 156. <xsl:value-of select="secteur" /> 157. </td> 158. - <td> 159. <xsl:value-of select="tel" /> 160. </td> 161. - <td> 162. <xsl:value-of select="grade" /> 163. </td> 164. </tr> 165. </xsl:template> 166. <xsl:script /> 167. </xsl:stylesheet>
Erreur lors du chargement de la feuille de style : Échec de l'analyse d'une feuille de style XSLT.
Où est l'erreur ?
Merci d'avance
Partager