क्लासिक एएसपी में गूगल जियोकोडिंग XML पार्सिंग

वोट
1

का उपयोग करते हुए http://maps.googleapis.com/maps/api/geocode/xml?address=5555%20La%20Cienaga%20Blvd%20Los%20Angeles,%20CA&sensor=false

मैं क्लासिक एएसपी में XML पार्स करने के लिए कोशिश कर रहा हूँ।

मैं विभिन्न उदाहरणों की कोशिश की, वे काम करने के लिए लगता है, लेकिन मैं नहीं कर सकता

किसी को भी मुझे एक हाथ दे सकते हैं? उदाहरण के लिए, मैं के लिए मूल्य प्राप्त करना चाहते हैं, तो अक्षांश और formatted_address मैं यह कैसे कर सकते हैं?

नीचे एक्सएमएल है कि मैं ऊपर के लिंक से मिलता है

<GeocodeResponse>
<status>OK</status>
<result>
<type>street_address</type>
<formatted_address>5555 La Cienega, Los Angeles, CA 90056, USA</formatted_address>
<address_component>
<long_name>5555</long_name>
<short_name>5555</short_name>
<type>street_number</type>
</address_component>
<address_component>
<long_name>La Cienega</long_name>
<short_name>La Cienega</short_name>
<type>route</type>
</address_component>
<address_component>
<long_name>Los Angeles</long_name>
<short_name>Los Angeles</short_name>
<type>locality</type>
<type>political</type>
</address_component>
<address_component>
<long_name>Los Angeles</long_name>
<short_name>Los Angeles</short_name>
<type>administrative_area_level_2</type>
<type>political</type>
</address_component>
<address_component>
<long_name>California</long_name>
<short_name>CA</short_name>
<type>administrative_area_level_1</type>
<type>political</type>
</address_component>
<address_component>
<long_name>United States</long_name>
<short_name>US</short_name>
<type>country</type>
<type>political</type>
</address_component>
<address_component>
<long_name>90056</long_name>
<short_name>90056</short_name>
<type>postal_code</type>
</address_component>
<geometry>
<location>
<lat>33.9978986</lat>
<lng>-118.3696586</lng>
</location>
<location_type>RANGE_INTERPOLATED</location_type>
<viewport>
<southwest>
<lat>33.9965523</lat>
<lng>-118.3709990</lng>
</southwest>
<northeast>
<lat>33.9992503</lat>
<lng>-118.3683010</lng>
</northeast>
</viewport>
<bounds>
<southwest>
<lat>33.9978986</lat>
<lng>-118.3696586</lng>
</southwest>
<northeast>
<lat>33.9979040</lat>
<lng>-118.3696414</lng>
</northeast>
</bounds>
</geometry>
<partial_match>true</partial_match>
</result>
</GeocodeResponse>
20/02/2013 को 07:25
का स्रोत उपयोगकर्ता
अन्य भाषाओं में...                            


1 जवाब

वोट
1

XML दस्तावेज़ आरंभ क्लासिक एएसपी में, एक बार आप कर कि XPath का उपयोग करके देखें

Set docXML = CreateObject( "Microsoft.XMLDOM" ) 
docXML.async = False 
docXML.loadXML( myXMLText )

अक्षां प्राप्त करने के लिए

docXML.documentElement.selectSingleNode( "/GeocodeResponse/result/geometry/location/lat" )

तथा

docXML.documentElement.selectSingleNode( "/GeocodeResponse/result/formatted_address" )

स्वरूपित पता प्राप्त करने के लिए।

20/02/2013 को 10:25
का स्रोत उपयोगकर्ता

Cookies help us deliver our services. By using our services, you agree to our use of cookies. Learn more