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:
chrisctx
New Member
*


Posts: 4
Joined: May 2010
O.P. Help with small XML reader
I have no experience with Jscript so I'm struggling quite a bit, and would love some help

Basically I'm making a window with 3 listviews (I would love for it to be one with three columns, but I just cant get it to work), they display different elements of a certain XML file (I generate it via other means).

Anyways, here is what I made so far, I downloaded a few scripts and tried to copy what they where doing, but it didint work out as planned hehe.

code:

function OnEvent_Initialize(MessengerStart)
{
}

function OnEvent_Uninitialize(MessengerExit)
{
}

var xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
function loadXML(xmlFile)
{
  xmlDoc.async="false";
  xmlDoc.onreadystatechange=verify;
  xmlDoc.load(xmlFile);
  xmlObj=xmlDoc.documentElement;
}

function OnEvent_MenuClicked (MenuItemId, Location, OriginWnd)
{
    // Captures when the user clicks on the 'WLMBb' menu
    if (MenuItemId=="Manage") fillTable();
}

function onTareasEvent_CtrlClicked (PlusWnd, ControlId)
{
    if (ControlId == "Refresh")
    {
        fillTable();
    }   
}

function fillTable()
{
    // Opens the window and loads the tasks from the XML file.
    var Manage = MsgPlus.CreateWnd("Interface.xml", "Manage");

    loadXML('C:\\Program Files\\Messenger Plus! Live\\Scripts\\wlmbb\\tasks.xml');
    TaskList = xmlObj.getElementsByTagName("tasks")[0].getElementsByTagName("task");
    IntTaskList = TaskList.lenght
   
    for (IntCurrentTask = 0; IntCurrentTask < IntTaskList; IntCurrentTask++)
    {
        CurrentTask = xmlObj.getElementByTagName("tasks")[0].getElementsByTagName("task")[IntCurrentTask];
        IntId = 0;
        Manage.LstView_AddItem("ListViewName", CurrentTask.getElementsByTagName("name")[0].text, IntId++);
        Manage.LstView_AddItem("ListViewExpiration", CurrentTask.getElementsByTagName("name")[0].text, IntId++);
        Manage.LstView_AddItem("ListViewCourse", CurrentTask.getElementsByTagName("name")[0].text, IntId++);
    }
}




And here is an example of the XML it should read:

code:
<?xml version="1.0" encoding='UTF-8'?>
<tasks>
    <task id="1">
        <name>nameofthistask1</name>
        <expiration>may 21 2010</expiration>
        <course>nameofthiscourse1</course>
    </task>
    <task id="2">
        <name>somethingelse</name>
        <expiration>may 22 2010</expiration>
        <course>Cooking class</course>
    </task>
    <task id="3">
        <name>listview</name>
        <expiration>may 23 2010</expiration>
        <course>scripting</course>
    </task>
    <task id="4">
        <name>WLMBb</name>
        <expiration>mayo 24 2010</expiration>
        <course>coolstuff</course>
    </task>
</tasks>



I would really appreciate if you guys could help me, I already made a program that does all of this in c#, but I wanted to surprise my teacher with a program that runs directly on messenger (since the purpose of this script is to share information between us, something we do in messenger a lot).

Thanks in advance.
05-25-2010 05:36 AM
Profile E-Mail PM 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