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

Update XML
Author: Message:
SnuZZer
Full Member
***

Avatar

Posts: 114
32 / Male / Flag
Joined: Jun 2006
O.P. Update XML
Hi.
Yes, it's me again!

I hope you understand :-$

I have made a script which i want to update a XML file, not add a new post, but update a post.
I have to ideas how to do that, I could clear the XML file and add the informations again, or I can update a post with a function.
But my problem is.. I don't know how to do that :-$

Here is my code.
code:
    var Sti = MsgPlus.ScriptFilesPath + "\\upload.xml";

    var xml = new ActiveXObject("Microsoft.XMLDOM");
    xml.load(Sti);
    var opdaterXML = xml.createElement("Status");
    opdaterXML.appendChild(xml.createTextNode(Status));
    xml.getElementsByTagName("Skift")[0].appendChild(opdaterXML);
    xml.save(Sti);
11-04-2006 09:42 AM
Profile E-Mail PM Web Find Quote Report
Matti
Elite Member
*****

Avatar
Script Developer and Helper

Posts: 1646
Reputation: 39
32 / Male / Flag
Joined: Apr 2004
RE: Update XML
In theory, this should work:
code:
var xmlFile = MsgPlus.ScriptFilesPath + "\\upload.xml";

var xml = new ActiveXObject("Microsoft.XMLDOM");
xml.load(xmlFile);
var xmlNode = xml.documentElement.selectSingleNode("Status");
xmlNode.text = Status;
xml.save(xmlFile);
;)

I changed the variable names to something I can understand, you can change them back if you want.

This post was edited on 11-04-2006 at 10:05 AM by Matti.
Plus! Script Developer | Plus! Beta Tester | Creator of Countdown Live | Co-developer of Screenshot Sender 5

Found my post useful? Rate me!
11-04-2006 10:04 AM
Profile E-Mail PM Web Find Quote Report
SnuZZer
Full Member
***

Avatar

Posts: 114
32 / Male / Flag
Joined: Jun 2006
O.P. RE: Update XML
Hi.
Oh, cool! It works!!
Many thanks!
11-04-2006 10:20 AM
Profile E-Mail PM Web Find Quote Report
Matti
Elite Member
*****

Avatar
Script Developer and Helper

Posts: 1646
Reputation: 39
32 / Male / Flag
Joined: Apr 2004
RE: Update XML
You're welcome. :)

For a full reference about the methods, properties and events of the XMLDOM, take a look at the DevGuru page. ;)

This post was edited on 11-04-2006 at 11:20 AM by Matti.
Plus! Script Developer | Plus! Beta Tester | Creator of Countdown Live | Co-developer of Screenshot Sender 5

Found my post useful? Rate me!
11-04-2006 11:18 AM
Profile E-Mail PM Web 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