What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » XML Reading/Parsing

XML Reading/Parsing
Author: Message:
Matti
Elite Member
*****

Avatar
Script Developer and Helper

Posts: 1646
Reputation: 39
31 / Male / Flag
Joined: Apr 2004
RE: XML Reading/Parsing
MeEtc wrote a nice tutorial how to do this: [Tutorial] Communicating with web pages. Take a look at the section "Retrieving content of a web page" before you continue. It's really worth to read it! :)

The only difference is that you can use the xmlhttp.responseXML property rather than xmlhttp.responseText, as this contains a nice XMLDOM object, ready for you to edit!

Here you have an example on what you can do with it:
code:
var url = "http://stats.enemyterritory.com/profile/paril101?xml=true";
   
Interop.Call("wininet.dll", "DeleteUrlCacheEntryW", url);
var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
xmlhttp.open("GET", url, true);
xmlhttp.onreadystatechange = function () {
   if (xmlhttp.readyState == 4) {
      if (xmlhttp.status == 200) {
         // Data from URL was retrieved successfully
         // You can now use xmlhttp.responseXML
         var xml = xmlhttp.responseXML;
         Debug.Trace("Engineer XP:"+xml.selectSingleNode("player/xp/engineer").getAttribute("xp"));
      } else {
         // The server returned an HTTP code other than 200
         Debug.Trace("ERROR!");
      }
   }
}
xmlhttp.send();
Plus! Script Developer | Plus! Beta Tester | Creator of Countdown Live | Co-developer of Screenshot Sender 5

Found my post useful? Rate me!
05-18-2008 04:46 PM
Profile E-Mail PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
XML Reading/Parsing - by Paril on 05-18-2008 at 01:48 PM
RE: XML Reading/Parsing - by mynetx on 05-18-2008 at 02:01 PM
RE: XML Reading/Parsing - by Paril on 05-18-2008 at 02:04 PM
RE: XML Reading/Parsing - by Paril on 05-18-2008 at 02:17 PM
RE: XML Reading/Parsing - by Matti on 05-18-2008 at 04:46 PM
RE: XML Reading/Parsing - by Paril on 05-18-2008 at 09:59 PM
RE: XML Reading/Parsing - by markee on 05-18-2008 at 10:40 PM
RE: XML Reading/Parsing - by Paril on 05-19-2008 at 12:14 AM
RE: XML Reading/Parsing - by Matti on 05-19-2008 at 03:36 PM
RE: XML Reading/Parsing - by Paril on 05-20-2008 at 01:26 PM


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