View Single Post
  #2 (permalink)  
Old June 7th, 2007, 11:02 AM
joefawcett's Avatar
joefawcett joefawcett is offline
Wrox Author
Points: 9,763, Level: 42
Points: 9,763, Level: 42 Points: 9,763, Level: 42 Points: 9,763, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Exeter, , United Kingdom.
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

Well you can use getElementsByTagName but that returns a collection and works on elements. You don't have an element called location_id so you need:
Code:
set colLocation = xmlObj.getElementsByTagName("location")
Set firstLocation = colLocation.Item(0)
Response.Write firstLocation.getAttribute("id")
It would be better to try to learn XPath, it's much more flexible:
Code:
Response.Write xmlObj.selectSingleNode("/Response/location/@id").nodeValue
--

Joe (Microsoft MVP - XML)