What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Reading an XML file from an URL

Reading an XML file from an URL
Author: Message:
x2i
New Member
*

Avatar

Posts: 2
Joined: Aug 2008
O.P. RE: RE: Reading an XML file from an URL
quote:
Originally posted by roflmao456
easy. just simply use the XMLHTTP object ;)

code:
var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
xmlhttp.open("GET","http://url.com/xml.xml",false);
xmlhttp.send(null);

var xml = xmlhttp.responseXML;
var Peter = xml.selectNodes("/Family/Member/Age/text()");
/*
either
var Peter = xml.selectNodes("/Family/Member/Age/text()");
or
var Peter = xml.selectNodes("/Family/Member/Age/text()")[0];

.. haven't used this function much :p
*/



Hmm this seems to look like it should work, however when I try to return the result I just get 4 squares as a string :S

EDIT:

I have figured it out by using a javascript example

I used the following:

code:
var x = xml.getElementsByTagName("Age")[0];
var Peter = x.childNodes[0];
   
msgbox(Peter.nodeValue);


Thankyou for your help :D

This post was edited on 08-30-2008 at 02:05 AM by x2i.
08-30-2008 01:52 AM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Reading an XML file from an URL - by x2i on 08-30-2008 at 01:03 AM
RE: Reading an XML file from an URL - by roflmao456 on 08-30-2008 at 01:30 AM
RE: RE: Reading an XML file from an URL - by x2i on 08-30-2008 at 01:52 AM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On