Programming Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsOtherProgramming Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old February 24th, 2006, 12:18 PM
Jimbalaya Jimbalaya is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Feb 2006
Location: Frisco, TX, USA
Posts: 3 Jimbalaya User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 49 m 38 sec
Reputation Power: 0
XML Parsing Yahoo with ASP

Hi,

I'm having trouble with parsing an XML file from Yahoo's Geocoder.

I'm getting an (0x800A01A8) Object required error on the line following line: Response.Write "Latitude" & xmlDoc.selectSingleNode("Latitude").Text

If I coment that our I get the same error on the next line.

Here is my code and the xml file I should be returning follows.

Code:
<%
                        
xmlURL = "http://api.local.yahoo.com/MapsService/V1/geocode?appid=SmartStart&street=3821%20Plantation%20Ln%20&zip=75035"
                        
'// Create the XMLHTTP object
Set xmlHTTP = Server.CreateObject("MSXML2.XMLHTTP")
                        
'// Fire off the request!
xmlHTTP.Open "GET", xmlURL
xmlHTTP.Send 

'// Load the XML parser
Set xmlDoc = Server.CreateObject("Microsoft.XMLDOM")
xmlDoc.Async = False
xmlDoc.loadXML (xmlHTTP.ResponseXML.xml)
                            
'// Set the Result node
Set arrResult = xmlDoc.selectSingleNode("//ResultSet/Result")
                            
'// Show Latitude and Longitude
Response.Write "Latitude" & arrResult.selectSingleNode("Latitude").Text
Response.Write "Longitude" & ArrResult.selectSingleNode("Longitude").Text
                            
'// Unload XML parser
Set xmlDoc = Nothing

'// Destroy the object
Set xmlHTTP = Nothing

%>
Yahoo XML
Code:
<?xml version="1.0" encoding="UTF-8" ?> 
<ResultSet xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:yahoo:maps" xsi:schemaLocation="urn:yahoo:maps http://api.local.yahoo.com/MapsService/V1/GeocodeResponse.xsd">
  <Result precision="address">
      <Latitude>33.109863</Latitude> 
      <Longitude>-96.781642</Longitude> 
      <Address>3821 PLANTATION LN</Address> 
      <City>FRISCO</City> 
      <State>TX</State> 
      <Zip>75035-8587</Zip> 
      <Country>US</Country> 
    </Result>
  </ResultSet>
<!--  ws01.search.re2.yahoo.com compressed/chunked Fri Feb 24 06:41:55 PST 2006 --> 


Thank you,
Jim

Reply With Quote
Reply

Viewing: ASP Free ForumsOtherProgramming Help > XML Parsing Yahoo with ASP


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT