What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » XML - check if node exists

XML - check if node exists
Author: Message:
deAd
Scripting Contest Winner
*****

Avatar

Posts: 1060
Reputation: 28
– / Male / Flag
Joined: Jan 2006
O.P. XML - check if node exists
Is there a way using the 'Microsoft.XMLDOM' activexobject to check if a particular node exists? right now I'm using try/catch but there's got to be a better way...
07-25-2006 01:49 AM
Profile PM Find Quote Report
cooldude_i06
Full Member
***

Avatar
I'm so cool I worry myself.

Posts: 272
Reputation: 9
– / Male / –
Joined: Sep 2003
RE: XML - check if node exists
code:
var node = xmlDoc.documentElement.selectSingleNode("Nodename");
if(nodeUser) Debug.Trace("Node exists.");
else Debug.Trace("Nodes does not exist.");

You can also look for nodes with specific properties

code:
var node = xmlDoc.documentElement.selectSingleNode("NodeName[@PropertyName='PropertyValue']");
[Image: clb2.jpg]
07-25-2006 02:37 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