aspose file tools*
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
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Read XML from URL" Watch "Read XML from URL" New topic
Author

Read XML from URL

Subash Murugan
Greenhorn

Joined: Mar 26, 2008
Posts: 21
Hi,

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

from my application I will hit the URL
http://host:/UserDeetails_xml.cfm?Username=XXXX

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

Thanks
Subash
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42620
    
  65
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Read XML from URL