XML Parsing

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sunnyluthra1
    New Member
    • Jan 2008
    • 3

    #1

    XML Parsing

    Hi,
    I am working on a Geocoding tool in MS Access.
    when I make a query using google api. I get the following KML file back as a search result.
    Here is the result.

    <?xml version="1.0" encoding="UTF-8" ?>
    - <kml xmlns="http://earth.google.co m/kml/2.0">
    - <Response>
    <name>Lake Road, Ontario, NY, 14519</name>
    - <Status>
    <code>200</code>
    <request>geocod e</request>
    </Status>
    - <Placemark id="p1">
    <address>Lake Rd, N.Y. 14519, USA</address>
    + <AddressDetai ls Accuracy="6" xmlns="urn:oasi s:names:tc:ciq: xsdschema:xAL:2 .0">
    - <Country>
    <CountryNameCod e>US</CountryNameCode >
    - <Administrative Area>
    <Administrative AreaName>N.Y.</AdministrativeA reaName>
    - <SubAdministrat iveArea>
    <SubAdministrat iveAreaName>Way ne</SubAdministrati veAreaName>
    - <Thoroughfare >
    <ThoroughfareNa me>Lake Rd</ThoroughfareNam e>
    </Thoroughfare>
    - <PostalCode>
    <PostalCodeNumb er>14519</PostalCodeNumbe r>
    </PostalCode>
    </SubAdministrati veArea>
    </AdministrativeA rea>
    </Country>
    </AddressDetails>
    - <Point>
    <coordinates>-77.314140,43.27 2448,0</coordinates>
    </Point>
    </Placemark>
    </Response>
    </kml>

    *************** **
    Now from Here I want to parse the XML data & get the imformation that I need Like Latitude & Longitude & AddressDetails Accuracy.
    I was able to got the lat & long from the above data by using the following command.
    MsgBox (Left(rootNode. selectSingleNod e("//coordinates").T ext, InStr(rootNode. selectSingleNod e("//coordinates").T ext, ",") - 1))
    But I don't have any Idea, How to get the AddressDetails Accuracy element from this KML document.
    Does Anyone has any idea. How to get the value of element AddressDetails Accuracy in a variable. I am using Ms Access. So I want it in VBA.
    Any Help will be appreciated.
Working...