Click to See Complete Forum and Search --> : extracting xml data using java


pburghben
09-15-2010, 12:53 PM
I just started a new job and they threw me into a project that requires xml knowledge. Unfortunately, I know nothing about xml, so maybe this forum can help.

I'm dealing with Google Maps and when you send them a geocoding url, it displays text in xml format. I need to use java to somehow extract some of the data from that result. Any advice or ideas would be appreciated!

For some context:
Say you were to enter "http://maps.google.com/maps/api/geocode/xml?address=1600+Amphitheatre+Parkway,+Mountain+View,+CA&sensor=false" into your browser (or any address in its place). It would display an xml file with all of the information about that location. What I need to extract are the formatted address and the lat/long coordinates. I have no clue where to start.

Thanks for your help!

Charles
09-16-2010, 07:11 AM
Best to post that question on the Java forum. But be careful to avoid the JavaScript forum; that's a different language.

sohguanh
09-16-2010, 09:02 PM
What I need to extract are the formatted address and the lat/long coordinates. I have no clue where to start.


Depending on which Java JDK version you are using, the latter version has those XML related API built-in. All you need to learn is how to use them in your Java code.

http://download.oracle.com/javase/1.5.0/docs/api/

Above show the Javadoc for XML related and other classes.