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
32 / Male / Flag
Joined: Apr 2004
RE: XML Reading/Parsing
You can easily do that by using the right statements in your search parameter for xml.selectSingleNode():
code:
var node = xml.selectSingleNode("badges[@category='soldier'][@level='1']/tasks[@id='1']");
var total = node.getAttribute("total");
The parts in green are selectors for attributes, this means that the XMLDOM engine will first look for a node with the name 'badges' and then will check if it's category-attribute equals 'soldier' and the level is '1'. If this is true, it'll look in its child nodes for 'tasks'-nodes and if it finds one with id '1', it'll return that node. Then, you can simply use the Node.getAttribute("attribute_name") method to get the 'total' attribute from the node. ;)
Plus! Script Developer | Plus! Beta Tester | Creator of Countdown Live | Co-developer of Screenshot Sender 5

Found my post useful? Rate me!
05-19-2008 03:36 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