User Name Password Register
DaniWeb IT Discussion Community
All
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
Reply
Join Date: Sep 2007
Posts: 3
Reputation: moiseszaragoza is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
moiseszaragoza moiseszaragoza is offline Offline
Newbie Poster

XML in ASP

  #1  
Sep 26th, 2007
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
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Dec 2007
Posts: 75
Reputation: hielo is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 10
hielo hielo is offline Offline
Junior Poster in Training

Re: XML in ASP

  #2  
Dec 8th, 2007
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>
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb XML, XSLT and XPATH Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the XML, XSLT and XPATH Forum

All times are GMT -4. The time now is 3:52 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC