Have a look at this address
http://www.ecb.int/stats/eurofxref/eurofxref-daily.xml

in my asp code i am using

<%
Set xml = CreateObject("Msxml2.XMLHTTP.3.0")
xml.Open "GET", "http://www.ecb.int/stats/eurofxref/eurofxref-daily.xml",
False
xml.Send
%>

<%=xml.responseXML.xml%>

----------------------------------------
result

"Reference rates European Central Bank "
---------------------------------------------

How can i get the value for each currency?

I can't make it work for the last 2 days . Any idea about what is wrong?

Thank (a lot) in advance
for any info

Re: XMLHTTP not working by Bob

Bob
Wed Dec 15 07:39:07 CST 2004

xarrisx wrote:
> Have a look at this address
> http://www.ecb.int/stats/eurofxref/eurofxref-daily.xml
>
> in my asp code i am using
>
> <%
> Set xml = CreateObject("Msxml2.XMLHTTP.3.0")
> xml.Open "GET",
> "http://www.ecb.int/stats/eurofxref/eurofxref-daily.xml", False
> xml.Send
> %>
>
> <%=xml.responseXML.xml%>
>
> ----------------------------------------
> result
>
> "Reference rates European Central Bank "
> ---------------------------------------------
>
> How can i get the value for each currency?
>
> I can't make it work for the last 2 days . Any idea about what is
> wrong?
>
> Thank (a lot) in advance
> for any info

View the page source instead of relying on the output in the browser window.

It works fine for me. You might also wish to try using:
response.contenttype="text/xml"
if you want to display the xml in the browser.

If you really want to get the rates, you should use selectNodes, like this:

<%
dim xml,xmldoc, oNodes, oNode
set xmldoc=createobject("msxml2.domdocument.3.0")
Set xml = CreateObject("Msxml2.ServerXMLHTTP.3.0")
xml.Open "GET",
"http://www.ecb.int/stats/eurofxref/eurofxref-daily.xml",False
xml.Send

set xmldoc=xml.responsexml
set oNodes=xmldoc.selectNodes("//Cube[@currency]")
for each oNode in oNodes
Response.Write onode.getattribute("currency") & ": " & _
onode.getattribute("rate") & "<BR>"
next

%>

Bob Barrows

PS. In server-side code, you should be using ServerXMLHTTP, not XMLHTTP. Go
to msdn.microsoft.com/library and read up on it.

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"



Re: XMLHTTP not working by xarrisx

xarrisx
Wed Dec 15 11:47:27 CST 2004

Thanks bob i was an idiot for not checking at the source code.
Also thank for the code in getting each value!!1


"Bob Barrows [MVP]" <reb01501@NOyahoo.SPAMcom> wrote in message
news:uLhWytq4EHA.1404@TK2MSFTNGP11.phx.gbl...
> xarrisx wrote:
> > Have a look at this address
> > http://www.ecb.int/stats/eurofxref/eurofxref-daily.xml
> >
> > in my asp code i am using
> >
> > <%
> > Set xml = CreateObject("Msxml2.XMLHTTP.3.0")
> > xml.Open "GET",
> > "http://www.ecb.int/stats/eurofxref/eurofxref-daily.xml", False
> > xml.Send
> > %>
> >
> > <%=xml.responseXML.xml%>
> >
> > ----------------------------------------
> > result
> >
> > "Reference rates European Central Bank "
> > ---------------------------------------------
> >
> > How can i get the value for each currency?
> >
> > I can't make it work for the last 2 days . Any idea about what is
> > wrong?
> >
> > Thank (a lot) in advance
> > for any info
>
> View the page source instead of relying on the output in the browser
window.
>
> It works fine for me. You might also wish to try using:
> response.contenttype="text/xml"
> if you want to display the xml in the browser.
>
> If you really want to get the rates, you should use selectNodes, like
this:
>
> <%
> dim xml,xmldoc, oNodes, oNode
> set xmldoc=createobject("msxml2.domdocument.3.0")
> Set xml = CreateObject("Msxml2.ServerXMLHTTP.3.0")
> xml.Open "GET",
> "http://www.ecb.int/stats/eurofxref/eurofxref-daily.xml",False
> xml.Send
>
> set xmldoc=xml.responsexml
> set oNodes=xmldoc.selectNodes("//Cube[@currency]")
> for each oNode in oNodes
> Response.Write onode.getattribute("currency") & ": " & _
> onode.getattribute("rate") & "<BR>"
> next
>
> %>
>
> Bob Barrows
>
> PS. In server-side code, you should be using ServerXMLHTTP, not XMLHTTP.
Go
> to msdn.microsoft.com/library and read up on it.
>
> --
> Microsoft MVP - ASP/ASP.NET
> Please reply to the newsgroup. This email account is my spam trap so I
> don't check it very often. If you must reply off-line, then remove the
> "NO SPAM"
>
>