Since you state that you already know how to parse through the XML, I'm just going to go ahead and give you some tips on how you can get to the website and pull down the data. In any case, this is how I've done it for some projects of mine.
First off, you need to import two of the .net classes, specifically HttpURLConnection and URL.
You then, want to create a URL to either the xml file or the webpage you are going to. Then you can use the HttpURLConnection to open the URL, set the request method as GET (since you're getting information from the server), perhaps include browser specific information to make it convinced you're not a bot, and then connect. Here is a quick snippet of code that I have no tested:
Code:
import java.net.HttpURLConnection;
import java.net.URL;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
public class getXML
{
public static void main(String args[])
{
try {
URL ourURL = new URL("http://www.codingforums.com/external.php?type=RSS2"); //Coding Forums RSS Feed
HttpURLConnection huc = (HttpURLConnection)url.openConnection();
huc.setRequestMethod("GET");
huc.setRequestProperty("User-Agent", "Mozilla/4.0 (compatible; JVM)");
huc.setRequestProperty("Pragma", "no-cache");
huc.connect();
BufferedReader reader = new BufferedReader(new InputStreamReader(huc.getInputStream()));
String line = null;
while ((line = reader.readLine()) != null) {
// Either do your parsing here, or append it to a StringBuffer for later use
}
catch(IOException ioe)
{
ioe.printStackTrace();
}
catch(Exception e)
{
System.err.println("General Exception " + e);
e.printStackTrace();
}
}
}
}
Obviously I didn't close anything, connection or streamwise and you would wand to fix that in your code.
I actually learned this bit of code by looking at someone else's so I don't feel too bad about sharing it around. But, for more information I suggest you look at these things here:
URL
HttpURLConnection
Probably the best source for URL stuff:
Sun Tutorial on URL's
NOTE: Interesting enough, the Sun tutorial comes up with a more smaller solution then what I came up with that might be easier to understand. So My suggestion is you read through that and use mine as a background.