Je débute, j'avoue que je patauge assez ...
c'est pourquoi je viens vers vous pour trouver un conseil.
Je souhaite utiliser une liste de photos en fichier XML : (çà m'évite de louer une BDD pour créer mes pages de site : le XML est gratuit !...)
mon fichier exemple :
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 <?xml version="1.0" encoding="ISO-8859-1"?> <?xml-stylesheet type="text/xsl" href="cxslphotoExt.xsl"?> <gite> <photo> <auteur>L.A.</auteur> <cat>ext</cat> <rub>paysage</rub> <date></date> <IMAGE source="images\GitePanoreglcom650.jpg"/> <titre>panorama </titre> <LIEN xml:link="simple" href="text/ruisseau.html"></LIEN> <dim> </dim> <prix> 200 Euros</prix> <iframe>document.open(bla.html)</iframe> </photo> <photo> <auteur>L.A.</auteur> <cat>int</cat> <rub>paysage</rub> <date></date> <IMAGE source="images\gitSaM.jpg"/> <titre>salle à manger </titre> <LIEN xml:link="simple" href="text/ruisseau.html">salle à manger</LIEN> <dim> </dim> <prix> </prix> <iframe>document.open(bla.html)</iframe> </photo> <photo> <auteur>L.A.</auteur> <cat>int</cat> <rub>paysage</rub> <date></date> <IMAGE source="images\Gitfeubois.jpg"/> <titre>séjour </titre> <LIEN xml:link="simple" href="text/ruisseau.html">sejour</LIEN> <dim> </dim> <prix> </prix> <iframe>document.open(bla.html)</iframe> </photo> .... </gite>
pour pouvoir les trier en 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 <?xml version="1.0" encoding="ISO-8859-1"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="html" encoding="iso-8859-1" doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1- transitional.dtd"/> <xsl:template match="/"> <html> <head> <style type="text/css"> p { font: italic small-caps 900 12px arial } </style> </head> <body> ... ..... <table width="700" border="0" cellspacing="10" cellpadding="10" align="center"> <!--<tr bgcolor="antiquewhite"> <td>Date</td> <td>Image</td> <td>Titre</td> <td>dimensions</td> </tr>--> <xsl:for-each select="gite/photo"> <xsl:if match=".[cat='ext']"> <tr bgcolor="#fffcc" > <td> <table summary="photo" cellspacing="17" cellpadding="4" align="center" border="5" bordercolor="#00185A" style="filter:Alpha(opacity=100, finishopacity=85, style=3)" bgcolor="#ffffcc"> <tr bgcolor="white"><td bgcolor="ivory"><IMG><xsl:attribute name="src"> <xsl:value-of select="IMAGE/@source"/> </xsl:attribute></IMG> </td></tr> </table> </xsl:if> </xsl:for-each> </table> ... ... </body> </html> </xsl:template> </xsl:stylesheet>
et les éditer dans une page en HTML :
tout çà est lu correctement sous Microsoft Int Explorer
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 <?xml version="1.0" encoding="ISO-8859-1"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <html> <head> <title>liste des photos</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <script type="text/javascript"> // Load XML var xml = new ActiveXObject("Microsoft.XMLDOM") xml.async = false xml.load("aGitetest.xml") // Load the XSL var xsl = new ActiveXObject("Microsoft.XMLDOM") xsl.async = false xsl.load("cxslphotoExt.xsl") // Transform document.write(xml.transformNode(xsl)) </script> <style type="text/css"></style><link rel="stylesheet" href="css/macss.css"> </head> <body bgcolor="#ffffcc" background="fdegrBl3jaune.gif" class="scroll"> <br /><br /><br /><br /> <table width="47%" border="0" align="center" height="27"> <tr><HR ALIGN=center SIZE=4 WIDTH=710></tr> <tr> <td class="pied" width="46%"> <div align="center"><a href="photosGiteInt.htm ">photos d'intérieur</a></div> </td> <td class="pied" width="54%"> <div align="center"><a href="photosGiteExt.htm ">photos extérieures</a></div> </td> </tr> </table> <p class="absoluLien" style="left: 21px; top: 12px"><a href="gitefoto.html"> Retour à l'accueil </a></p> <xsl:template match="/"> </xsl:template> </xsl:stylesheet> </body> </html>
Par contre :
Les images n'apparaissent pas !!! : ni avec FireFox ni avec Chrome !!! pourquoi ?
D'avance merci pour votre aide
ou excuses si je ne suis pas dans le bon forum ou si je me suis mal exprimé...
Partager