Bonjour,
Voici mon schéma XML :
<?xml version="1.0" encoding="ISO-8859-1" ?>
<SEARCHRESULTS QUERY="music" NUMRESULTS="4" TOTRESULTS="4"
RESPONSETIME="32">
<RESULTSET DATABASE="Espotting" QUERY="music" NUMRESULTS="4"
TOTRESULTS="4" RESPONSETIME="0">
<RESULT POS="1">
<TITLE><![CDATA[ Commandez vos CD sur Amazon.fr ]]></TITLE>
<URL><![CDATA[ http://www.amazon.fr ]]></URL>
<REDIR>
<![CDATA[
http://affiliate.fr.espotting.com/search/redirector.asp?url=http%3A%2F%2Fwww
%2Eamazon%2Efr%2Fexec%2Fobidos%2Fredirect%3Ftag%3Despot%2Dmass%2D7160%2D21%2
6path%3Dtg%2Fbrowse%2F%2D%2F301062&bidid=85308540&searchguid=%CF%C0%E9%EC%FF
%B3%84%E0%BB%D3%E3%F7%8D%CD%EC%A0%FA%CA%AE%A8%A4%BB%93%A4%DB%E5%88%91%E4%99%
80%99%91%84%89%D0%83%F8&affiliateid=1&position=1&keyword=music&sourceid=1&se
archdate=02+Jul+2003+15%3A55%3A04%3A11 ]]>
</REDIR>
<DESCRIPTION>
<![CDATA[ CD, livres, DVD, logiciels et jeux vidéo sont sur
Amazon - Livraison gratuite à partir de 20 euros d'achats
(conditions sur site). ]]>
</DESCRIPTION>
<LOGOPATH><![CDATA[
http://affiliate.espotting.fr/images/advertisers/Amazon.fr(107).gif ]]></LO
GOPATH>
<COST>0.11</COST>
</RESULT>
<RESULT POS="2">
...
</REDIR>
...
</RESULTSET>
<PARAMETERS>
<PAGE>1</PAGE>
<HITS>10</HITS>
<AFFILIATEID>1</AFFILIATEID>
<NOADULT>0</NOADULT>
</PARAMETERS>
</SEARCHRESULTS>
Et je veux accéder aux attributs de la balise "resultset"
Voici mon code :
<%@ Language=VBScript %>
<html>
<head>
<title>Resultat</title>
<link rel=stylesheet href="style.css" type="text/css">
<%
Dim xmlServ
Set xmlServ = Server.CreateObject("MSXML2.ServerXMLHTTP")
xmlServ.open "GET",
"http://maximilien/apw/Edouard/Climb'up/soft/results.xml", false
xmlServ.send()
Set attributs =
xmlServ.responseXML.childNodes.item(1).childNodes.item(0).attributes.getName
dItem("DATABASE")
%>
</head>
<body background="Images/carre-gris.gif">
<br>
Terme recherché : <b>"<% = attributs.value %>"</b>
</body>
</html>
Et je ne comprends pas pourquoi on ne peut pas remplacer :
Set attributs =
xmlServ.responseXML.childNodes.item(1).childNodes.item(0).attributes.getName
dItem("DATABASE")
par ça :
Set attributs =
xmlServ.responseXML.selectSingleNode("resultset").attributes.getNamedItem("D
ATABASE")
Merci.
--
Devenez redacteur <XML>fr et contribuez au developpement du
xml francophone (http://xmlfr.org/infos/redacteurs/) !
Liste de diffusion "xml-tech@xmlfr.org" (http://xmlfr.org).
Cette liste est a votre disposition pour discuter en francais de
tout sujet technique lie a XML.
Pour resilier votre abonnement, envoyez un message contenant
la commande "unsubscribe" a xml-tech-request@xmlfr.org
(mailto:xml-tech-request@xmlfr.org?Subject=unsubscribe)
Received on Fri Jul 4 11:20:11 2003