Hi,
For a project I'm doing I have a varied number of nodes with node names of nib"number"_title So I'm using a for loop and within that loop I'm using getElementsByTagName to ge the node but It brings up an error if it's trying to find a node thats not there.
Microsoft VBScript runtime (0x800A01A8) Object required: 'xml.getElementsByTagName(...).item(...)' /newsite/eg/eg.asp, line 46
So how would I test to see if the nodes there and then write it if it is?
My ASP code looks like this:
<%
Dim i
Dim objTest
For i = 1 to 3
Set objTest = xml.getElementsByTagName("nib"&i&"_title")
if Not (objTest Is Nothing) Then
Response.Write("<li><a style=""text-decoration: none; color:white;"" href=""#nib"&i&""">"&xml.getElementsByTagName("nib"&i&"_title").item(0).text&"</a></li>")
End If
Next
%>