• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Fatal error while parsing xml

 
aashu dwivedi
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am using the following code

to parse the output obtained by an imdb movie rating service which sometimes happen to send an HTML output breaking the above code
producing a



as you can see the line "error parsing the search output " is generated by the catch block written by me but even when the exception is cought the program stops because of the fatal error i am not able to understand why is it so and what might solve the problem guys please help.
 
aashu dwivedi
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
seems like the problem was with the Error handler interface .
creating a seperate ErrorHandler class and registering it with parser solved the problem


while As documented at http://java.sun.com/j2se/1.4.2/docs/api/org/xml/sax/ErrorHandler.html
the ErrorHandler interface requires one to implement the following methods
eror();
fatalerror();
warning();
 
aashu dwivedi
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
but i was wondering why a different ErrorHandler Interface is needed instead of regular Exception mechanism of java ?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic