Home | Advertising Info53 USERS CURRENTLY ONLINE   
PowerASP
   Site Search Contact Us Wednesday, May 01, 2024  

  Active InfoActive Info  Display List of Info MembersMemberlist  Search The InfoSearch  HelpHelp
  RegisterRegister  LoginLogin
Classic ASP - General
 PowerASP Code Help Area : Classic ASP - General
Subject Info: XML Parsing Problem A d d  -  P o s tAdd P o s t
Author
Message << Prev Info | Next Info >>
Jimbalaya
Newbie
Newbie
Avatar

Joined: February/24/2006
Location: United States
Online Status: Offline
Info: 1
Added: February/24/2006 at 10:13am | IP Logged Quote Jimbalaya

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=Sma rtStart&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.xs d">
     <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
Back to Top View Jimbalaya's Profile Search for other info by Jimbalaya Visit Jimbalaya's Homepage
 

If you wish to make a comment to this info you must first login
If you are not already registered you must first register

  A d d  -  P o s tAdd P o s t
Printable version Printable version

Info Jump
You cannot add new info in this area
You cannot add to info in this area
You cannot delete your info in this area
You cannot edit your info in this area
You cannot create polls in this area
You cannot vote in polls in this area

   Active Server Pages Rule The World
Contact Us  
All artwork, design & content contained in this site are Copyright © 1998 - 2024 PowerASP.com and Christopher J. Williams
Banner ads ,other site logos, etc are copyright of their respective companies.
STATS Unless otherwise noted - All Rights Reserved.

Active Server Pages help tutorial how to ASP Help ASP Tutorials ASP Programming ASP Code - ASP Free CJWSoft ASPProtect ASPBanner ASPClassifieds www.aspprotect.com, www.cjwsoft.com,www.aspclassifieds.com,www.aspphotogallery.com