Get the tools you need to learn Java skills fast!
Video tutorials, eBooks, hands-on lab exercises, sample code.
Get started
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 The Software Craftsman this week in the Agile 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: 21

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: 42954
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 "" you would use the InputStream you obtained from the line of code above.
Have you tried LearnNowOnline?
subject: Read XML from URL