Bonjour,
J'essai depuis quelques jours de traiter des données XML
qui sont fournies par un fichier en .ASP
Ce fichier ce trouve sur internet, et je doit m'identifier pour
récupérer ce fichier. L'adresse est de type :
http://affiliate.espotting.fr/addwords/KeywordRetrieval.asp?partnerid=...&advertiserid=...&password=...
voila à peu pres ce que ca donne :
<?xml version="1.0" encoding="ISO-8859-1" ?>
-<response>
-<terms>
-<term>
<value>referencement</value>
<bid>.85</bid>
<url>http://www.synodiance.com</url>
<title>Synodiance : référencement de sites web</title>
<description>Synodiance : référencement sur mesure de sites web.</description>
</term>
+<term></term>
+<term></term>
+<term></term>
</terms>
</response>
Tout d'abord, j'ai sauvegardé ce fichier sur mon dur.
Pui g coder la page qui me permet d'organiser ces donner dans
un tableu.
Donc j'ai utiliser Server.MapPath
Comme mon test fonctionnait correctement, je l'ai appliqué
à la page située sur le net, mais hélas g une erreur que je n'arrive pas à résoudre.
Voici ma source :
<%@ Language=VBScript %>
<html>
<head>
<title>Resultat</title>
<link rel=stylesheet href="style.css" type="text/css">
<%
Dim xmlDoc
Set xmlDoc = Server.CreateObject("MSXML2.DOMDocument.3.0")
'xmlDoc.load("http://affiliate.espotting.fr/addwords/KeywordRetrieval.asp?partnerid=...&advertiserid=...&password=...")
xmlDoc.load(Server.MapPath("KeywordRetrieval.asp"))
%>
</head>
<body>
<center><h1>CLIMB'UP</h1></center>
<br><br><br>
<b>Voici la liste de vos mots clés :<b>
<table width="100%" align="center" border="1" cellpadding="10" cellspacing="10">
<th align="center">Value</th>
<th align="center">Bid</th>
<th align="center">Url</th>
<th align="center">Title</th>
<th align="center">Description</th>
<%
For Each term in xmlDoc.documentElement.childNodes
For Each champ in term.ChildNodes
VAL = champ.childNodes(0).text
BID = champ.childNodes(1).text
URL = champ.childNodes(2).text
TITLE = champ.childNodes(3).text
DESCRIPT = champ.childNodes(4).text
%>
<tr>
<td align="center">
<% = VAL %>
</td>
<td align="center">
<% = BID %>
</td>
<td align="center">
<% = URL %>
</td>
<td align="center">
<% = TITLE %>
</td>
<td align="center">
<% = DESCRIPT %>
</td>
</tr>
<%Next
Next%>
</table>
</body>
</html>