What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Xml parser fails

Xml parser fails
Author: Message:
SmokingCookie
Senior Member
****

Avatar

Posts: 815
Reputation: 15
29 / Male / Flag
Joined: Jul 2007
O.P. Xml parser fails
Hi,

I am currently gathering some experience witn the XMLDOM object.
I have a weird error, though, in the following piece of code:

code:
var Notification = new Object();
XmlParser.load(MsgPlus.ScriptFilesPath + BackSlash + "Notifs.xml");
Key = MsgPlus.ScriptRegPath + BackSlash + "LastNotif";
LastNotif = RegRead(Key); // RegRead(Key) works fine.. My script basically relies on it :P
NodeName = "//Notification" + (LastNotif + 1);
Debug.Trace("> " + NodeName)
D = XmlParser.selectSingleNode(NodeName);
Notification.Name = D.attributes.getNamedItem("Name").value; // Line 1400


The error is:

Error detected in line 1400 of "Date calculator.js": Object required.

Can anyone please help me?

Tnx in advance..
05-08-2008 05:22 PM
Profile PM Find Quote Report
Matti
Elite Member
*****

Avatar
Script Developer and Helper

Posts: 1646
Reputation: 39
31 / Male / Flag
Joined: Apr 2004
RE: Xml parser fails
A quick research pointed out that you were very close, but yet so far. There's no value child of the Node object, you should use the nodeValue property instead! :D

Even better: the return value of selectSingleNode is in your case an Element object (which is an extension of Node), so you can simply use D.getAttribute("Name") which is simpler, cleaner, more efficient and does the same thing. :)
code:
D = XmlParser.selectSingleNode(NodeName);
Notification.Name = D.getAttribute("Name");

This post was edited on 05-08-2008 at 06:44 PM by Matti.
Plus! Script Developer | Plus! Beta Tester | Creator of Countdown Live | Co-developer of Screenshot Sender 5

Found my post useful? Rate me!
05-08-2008 06:42 PM
Profile E-Mail PM Web Find Quote Report
SmokingCookie
Senior Member
****

Avatar

Posts: 815
Reputation: 15
29 / Male / Flag
Joined: Jul 2007
O.P. RE: Xml parser fails
Quite complex, but I'll give it a try :D

EDIT::

Gives me "null".

WORKS!! ThanQ :D
Check your rep..

Now I have one small (off-topic) problem:

code:
NotificationPages[i] = Script.MainUrl + D.getAttribute("Page"); // Works :D
WndNotifs.LstView_SetItemText("LstVNotifs",i,2,NotificationPages[i]);


Does nothing (2nd line)..
I am completely unfamiliar with the "LsdView_SetItemText(...)" function..
The column index is probably wrong (I need the 2nd column from the left; also tried 1)..

Could anyone please help me? (A) :P

This post was edited on 05-09-2008 at 09:47 AM by SmokingCookie.
05-08-2008 07:52 PM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »


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