Hi ,
I am downloading images from Flickr webserver using Flickr API.While parsing the url using document object
I got the fatel error:
[Fatal Error] ?method=flickr.photos.getRecent&api_key=myapikey&t ags=&per_page=10&page=1:16:155: The element type "br" must be terminated by the matching end-tag "</br>".
The requested url to download the image is :-
"http://www.flickr.com/services/rest/?method=flickr.photos.getRecent&api_key=myapikey&t ags=&per_page=10&page=1"
Below is the method that parses the content.
protected Document getFlickrData(String method, Map<String, String> params) throws MalformedURLException, SAXException, IOException, FlickrException { URL flickrRequestUrl = null; flickrRequestUrl = constructFlickrRequestUrl(method, params); System.out.println("FlckrRequestUrl:" " " flickrRequestUrl); System.setProperty("http.proxyHost", "myproxy.com"); System.setProperty("http.proxyPort", "8080"); Authenticator.setDefault( new HttpAuthenticator() ); System.setProperty("http.proxyUser", "kj0044135"); System.setProperty("http.proxyPassword", "password"); System.out.println("Document before parsing flickrRequestUrl:"); [B]Document document = xmlParser.parse(flickrRequestUrl.toString()); [/B]// Here I am getting exception System.out.println("Document after parsing flickrRequestUrl:" " " document); NodeList errors = document.getDocumentElement().getElementsByTagName("err"); if (errors != null && errors.getLength() > 0) { System.out.println("Error occur"); throw new FlickrException((Element) errors.item(0)); } return document; }
what is the problem in this.Please help my out here.
Thanks in advance.
Thanks and Regards,
Kalpesh