•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the XML, XSLT and XPATH section within the Software Development category of DaniWeb, a massive community of 456,513 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,733 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our XML, XSLT and XPATH advertiser: Programming Forums
Views: 1699 | Replies: 1
![]() |
•
•
Join Date: Sep 2007
Posts: 3
Reputation:
Rep Power: 0
Solved Threads: 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
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
•
•
Join Date: Dec 2007
Posts: 75
Reputation:
Rep Power: 1
Solved Threads: 10
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>
<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>
![]() |
•
•
•
•
•
•
•
•
DaniWeb XML, XSLT and XPATH Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
- windows xp pro stop error, happens after only a few minutes of loading up (Troubleshooting Dead Machines)
- How to Parse XML in ASP? (ASP)
- What exactly is xml? (RSS, Web Services and SOAP)
- Parse XML from ASP!!! (ASP)
- Experienced C# .NET developer looking for offsite job! (Post your Resume)
Other Threads in the XML, XSLT and XPATH Forum
- Previous Thread: need help
- Next Thread: Running WSEMessaging Webcast


Linear Mode