PDA

View Full Version : JAVA and XML


mxb7642
08-03-2007, 02:47 PM
I am trying to retrieve the xml data for a website. When I look at the source for the site I see xml, however, when I try to retrieve it using java, I get back html. I've tried two techniques so far:


tidy = new Tidy();
tidy.setXHTML(true);
tidy.setShowWarnings(false);
tidy.setQuiet(true);
url = new URL( urlString );
connection = (HttpURLConnection)url.openConnection();
InputStream in = connection.getInputStream();



SAXParserFactory spf = SAXParserFactory.newInstance();
spf.setValidating(false);
sp = spf.newSAXParser();
URL url = new URL( urlString );
HttpURLConnection connection = (HttpURLConnection)url.openConnection();
in = connection.getInputStream();


Is there something wrong with my code? Or should I be using a different technique? Thanks for the help ahead of time.

Alex Vincent
08-04-2007, 06:21 AM
Double-posted and CLOSED:
http://www.codingforums.com/showthread.php?t=120478

Please do not post the same question in two or more forums. It confuses people trying to help you and annoys moderators (like me).