• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Fatal error while parsing xml

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
but i was wondering why a different ErrorHandler Interface is needed instead of regular Exception mechanism of java ?
 
reply
    Bookmark Topic Watch Topic
  • New Topic