wood burning stoves 2.0*
The moose likes XML and Related Technologies and the fly likes Read XML from URL Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Read XML from URL" Watch "Read XML from URL" New topic

Read XML from URL

Subash Murugan

Joined: Mar 26, 2008
Posts: 20

I want to read an XML and parse the data from HttpUrlConnection,

from my application I will hit the URL

will return the XML string, I need to parse and get the necessary info.Which is the best way to do?

Ulf Dittmer

Joined: Mar 22, 2005
Posts: 41141
Getting an InputStream from hwere to read the URL contents can be as easy as

An example of how to use the SAX API to parse XML can be found here. Note that where it uses "System.in" you would use the InputStream you obtained from the line of code above.

Ping & DNS - my free Android networking tools app
Consider Paul's rocket mass heater.
subject: Read XML from URL
Similar Threads
Reading from XML file
RMI Binding on localhost
get value from url
You've seen it a thousand times before... "SQLException: No suitable driver"
Access to XML parsing after login authorization