Aller au contenu

liens xml


truitas

Sujets conseillés

Bonjour à tous,

j'espère être au bon endroit.

je vous explique ce que je voudrais faire:

J'ai crée avec dreamweaver un tableau dynamique spry inséré dans une page html que vous pouvez voir ici. J'aimerais insérer des liens dans une nouvelle colonne renvoyant vers des pages html spécifiques. Et c'est là que je bloque. Si j'ai bien compris la technologie spry utilise du Javasript, du XML et de l'ajax. Je vous remercie par avance pour vos réponses

Mon code xml est le suivant:


<?xml version="1.0" encoding="utf-8"?>
<dataroot>
<randonnees>
<randonneeID>1</randonneeID>
<massif>Belledonnes</massif>
<type>randonnee nocturne</type>
<saison>ete</saison>
<prix>45</prix>
<duree>apres-midi-soiree</duree>
<description>randonnee et repas autour d'un feu</description>
<LARGEIMAGE>etoiles_filantes.jpg</LARGEIMAGE>
<MEDIAID>1</MEDIAID>
</randonnees>
<randonnees>
<randonneeID>2</randonneeID>
<massif>Bauges</massif>
<type>nuitee en refuge</type>
<saison>ete</saison>
<prix>62</prix>
<duree>soiree-nuitee-matinee</duree>
<description>randonnee nocturne et nuit en refuge</description>
<LARGEIMAGE>nocturne_ete.jpg</LARGEIMAGE>
<MEDIAID>2</MEDIAID>
</randonnees>
<randonnees>
<randonneeID>3</randonneeID>
<massif>Bauges</massif>
<type>randonnee gourmande</type>
<saison>ete</saison>
<prix>35</prix>
<duree>journee</duree>
<description>randonnee et degustation de produits du terroir</description>
<LARGEIMAGE>valle _entremont_chartreuse.png</LARGEIMAGE>
<MEDIAID>3</MEDIAID>
</randonnees>
<randonnees>
<randonneeID>4</randonneeID>
<massif>Chartreuse</massif>
<type>randonnee thematique</type>
<saison>ete</saison>
<prix>38</prix>
<duree>journee</duree>
<description>randonnee du vertige et degustation de produits du terroir </description>
<LARGEIMAGE>ARCHE_CHARTREUSE.JPG</LARGEIMAGE>
<MEDIAID>4</MEDIAID>
</randonnees>
</dataroot>

Mon code html:


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:spry="http://ns.adobe.com/spry">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Document sans nom</title>
<script src="../SpryAssets/xpath.js" type="text/javascript"></script>
<script src="../SpryAssets/SpryData.js" type="text/javascript"></script>
<script type="text/javascript">
<!--
var dsimages = new Spry.Data.XMLDataSet("Copie de Untitled-1.xml", "dataroot/randonnees",{sortOnLoad:"prix",sortOrderOnLoad:"ascending"});
//-->
</script>
</head>

<body>
<h1>spry</h1>
<p> </p>
<div spry:region="dsimages">
<table border="1" align="center" cellpadding="1" bordercolor="#000000" bgcolor="#FFFFFF">
<tr>
<th bordercolor="#000000" spry:sort="saison"> </th>
<th bordercolor="#000000" spry:sort="saison">Saison</th>
<th bordercolor="#000000" spry:sort="massif">Massif</th>
<th bordercolor="#000000" spry:sort="type">Type</th>
<th bordercolor="#000000">Description</th>
<th bordercolor="#000000" spry:sort="duree">Duree</th>
<th bordercolor="#000000" spry:sort="prix">Prix</th>
</tr>
<tr spry:repeat="dsimages">
<th bordercolor="#000000"><img src="image/{LARGEIMAGE}" alt="arche chartreuse" width="100" height="50" /></th>
<th bordercolor="#000000">{saison}</th>
<th bordercolor="#000000">{massif}</th>
<th bordercolor="#000000">{type}</th>
<th bordercolor="#000000">{description}</th>
<th bordercolor="#000000">{duree}</th>
<th bordercolor="#000000">{prix}</th>
</tr>
</table>
</div>
<p> </p>
</body>
</html>

Lien vers le commentaire
Partager sur d’autres sites

bonjour a tous en fait c'était plus simple que je ne pensais:

après avoir ajouté une ligne url dans mon fichier xml, il suffisait de transformer dans le doc html comme suit:

code initial:

<h1>spry</h1>
<p> </p>
<div spry:region="dsimages">
<table border="1" align="center" cellpadding="1" bordercolor="#000000" bgcolor="#FFFFFF">
<tr>
<th bordercolor="#000000" spry:sort="saison"> </th>
<th bordercolor="#000000" spry:sort="saison"><a href="#">Saison</a></th>
<th bordercolor="#000000" spry:sort="massif"><a href="#">Massif</a></th>
<th bordercolor="#000000" spry:sort="type">Type</th>
<th bordercolor="#000000">Description</th>
<th bordercolor="#000000" spry:sort="duree">Duree</th>
<th bordercolor="#000000" spry:sort="prix"> </th>
<th bordercolor="#000000" spry:sort="prix">Prix</th>
</tr>
<tr spry:repeat="dsimages">
<th bordercolor="#000000"><img src="image/{LARGEIMAGE}" alt="arche chartreuse" width="100" height="50" /></th>
<th bordercolor="#000000">{saison}</th>
<th bordercolor="#000000">{massif}</th>
<th bordercolor="#000000">{type}</th>
<th bordercolor="#000000">{description}</th>
<th bordercolor="#000000">{duree}</th>
<th bordercolor="#000000">{URL}</th>
<th bordercolor="#000000">{prix}</th>
</tr>
</table>

le résultat qui fonctionne:

 <th bordercolor="#000000"><a href="{URL}">Détails</a></th>

Lien vers le commentaire
Partager sur d’autres sites

Veuillez vous connecter pour commenter

Vous pourrez laisser un commentaire après vous êtes connecté.



Connectez-vous maintenant
×
×
  • Créer...