|
-
Jun 1st, 2001, 01:33 AM
#1
Thread Starter
Hyperactive Member
Simple Question in XML
Hi there!
In XML file, how do I check if a particular element exists or not in ASP (Vbscript)?
I have used this:
Code:
set elmt=objXML.selectSingleNode(elmntname) 'elmntname is passed as a parameter
I have checked for IsNull(elmt), which always returns True, even if there is a node.
Also I have used the following code to check,
Code:
if elmt is nothing then
Response.write "Node not found!"
else
Response.write "Node found!"
end if
But, this gives the "Node not found!" message, even if there is one in the file.
Please help me.
-
Jun 2nd, 2001, 09:34 AM
#2
-
Jun 2nd, 2001, 09:35 AM
#3
Lively Member
if len(objXML.documentElement.getElementsByTagName(elmntname)) <> 0 then
use this
Sonia
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|