What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Help with small XML reader

Help with small XML reader
Author: Message:
Matti
Elite Member
*****

Avatar
Script Developer and Helper

Posts: 1646
Reputation: 39
32 / Male / Flag
Joined: Apr 2004
RE: Help with small XML reader
Could you provide us with the details from the script debugger window?

Anyway, I think there are two possibilities for this problem:
  1. The ActiveXObject couldn't be created.
    I had this before, for some reason my Windows installation couldn't recognize Microsoft.XMLDOM any more. After some research, I found that MSXML2.DOMDocument still worked, but then again that didn't work on other computers. I decided to implement both of them in a try...catch block so that it would always find a working ActiveXObject.
    So, instead of using new ActiveXObject('MSXML.DOMDocument');, I now call CreateXML() after defining it as followed:
    js code:
    //Creates a new XMLDOM instance
    function CreateXML() {
        try {
            var xml = new ActiveXObject("Microsoft.XMLDOM");
        } catch(e) { try {
            var xml = new ActiveXObject("MSXML2.DOMDocument");
        } catch(e) { return; } }
        xml.async = false;
        return xml;
    }
  2. The path may be faulty.
    I see that you're using a slash in your path, try a backslash instead. Of course, in JScript you have to escape a backslash with a backslash, so that line should look something like this:
    js code:
    XML.load(MsgPlus.ScriptFilesPath + '\\tasks.xml');
  3. The file might still be loading when you try to access it.
    This can be easily fixed by setting async to false, forcing the XML DOM object to load the XML file synchronously. As you can see above, my function does this automatically since I don't use asynchronous XML loading very often in my scripts.
It would help if you posted the full error message though. :)

Hint: these forums can do syntax highlighting by wrapping your code in [code=js] ... [/code] tags (for JScript, that is), it makes your code easier to read for others. ;)
Plus! Script Developer | Plus! Beta Tester | Creator of Countdown Live | Co-developer of Screenshot Sender 5

Found my post useful? Rate me!
05-25-2010 06:25 PM
Profile E-Mail PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Help with small XML reader - by chrisctx on 05-25-2010 at 05:36 AM
RE: Help with small XML reader - by matty on 05-25-2010 at 11:35 AM
RE: Help with small XML reader - by chrisctx on 05-25-2010 at 03:39 PM
RE: Help with small XML reader - by Matti on 05-25-2010 at 04:03 PM
RE: Help with small XML reader - by chrisctx on 05-25-2010 at 06:07 PM
RE: Help with small XML reader - by Matti on 05-25-2010 at 06:25 PM
RE: Help with small XML reader - by chrisctx on 05-26-2010 at 01:10 AM
RE: Help with small XML reader - by Matti on 05-26-2010 at 11:31 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