-
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.
-
if len(objXML.documentElement.getElementsByTagName('ERROR')) <> 0 then
Tag is present
else
Tag is not present
End if
I hope this pice of code works for u...
Sonia:rolleyes: ;)
-
if len(objXML.documentElement.getElementsByTagName(elmntname)) <> 0 then
use this
Sonia:)