User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the ASP section within the Web Development category of DaniWeb, a massive community of 422,551 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 4,690 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 ASP advertiser: Lunarpages ASP Web Hosting

How to Parse XML in ASP?

Join Date: Jun 2005
Location: Seattle, WA
Posts: 53
Reputation: senexom is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 0
senexom's Avatar
senexom senexom is offline Offline
Junior Poster in Training

How to Parse XML in ASP?

  #1  
Aug 8th, 2005
Hey guys,
I'm having a "great" pleasure of parsing XML in my ASP page, except I can't seem to figure it out what I'm doing wrong. I have tried a bunch of stuff and can't seem to read a simple xml doc. here is what my code looks like...
' Create new XML reader object
Dim xmlDoc
Set xmlDoc = Server.CreateObject("Microsoft.XMLDOM")

' Load the specified XML file (returns XML output)
xmlDoc.load("http://somesite.com/api/xml?action=login&login=jon@doe.com&password=foobar")

' Parse XML
if xmlDoc.parseError.errorcode <> 0 then
  ' oops error in xml
  Response.Write("XML Error...<br>")
else
  ' get xml data
  Response.Write(xmlDoc.documentElement.childNodes(0).attributes.getNamedItem("code").nodeValue)
end if


my xml looks like this...
<?xml version="1.0" encoding="utf-8"?>
<results>
	<status code="value"/>
</results>


and my error is...
Microsoft VBScript runtime error '800a01a8'

Object required: 'documentElement'


This is my first time working with XML in ASP, so it is possible i'm missing something simple, any ideas what's going wrong here?

Thanks
AddThis Social Bookmark Button
Reply With Quote  
All times are GMT -4. The time now is 12:51 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC