0

I know that I have childNodes in my XML

it has over 337 lines

But I still get a return of 0

My code

' Create new XML reader object
Dim xmlDoc
Set xmlDoc = Server.CreateObject("Microsoft.XMLDOM")
	' Load the specified XML file (returns XML output)
	xmlDoc.load("http://pathToXML")	
                         If (xmldoc.childNodes.length = 0) Then
			Response.Write("there are no childNodes") ' This reurns true	
		else
			Response.Write(xmldoc.childNodes.length)	 
		end if
2
Contributors
1
Reply
2
Views
10 Years
Discussion Span
Last Post by hielo
0

Try this:
<script language="VBScript" runat=Server>
Dim xmlDOC
Dim bOK
Dim HTTP
Set HTTP = CreateObject("MSXML2.XMLHTTP")
Set xmlDOC =CreateObject("MSXML.DOMDocument")
xmlDOC.Async=False
HTTP.Open "GET","http://topics.cnn.com/topics/feeds/rss/technology", False
HTTP.Send()
bOK = xmlDOC.load(HTTP.responseXML)
if Not bOK then
Response.Write "Error loading XML from HTTP"
end if

Dim objNodeList
Set objNodeList=xmlDOC.documentElement.selectNodes("//rss/channel/item/title")
Response.Write "Total Items: "& objNodeList.Length

Dim I
For I = 0 to objNodeList.Length -1
Response.Write "<div>" & objNodeList(i).text & "</div>"
next
Response.Write "Status: " & HTTP.statusText
</script>

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.