IntelliJ Java IDE
The moose likes Groovy and the fly likes Fatal error while parsing xml Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Other Languages » Groovy
Reply Bookmark "Fatal error while parsing xml" Watch "Fatal error while parsing xml" New topic
Author

Fatal error while parsing xml

aashu dwivedi
Greenhorn

Joined: Sep 02, 2009
Posts: 4
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

Joined: Sep 02, 2009
Posts: 4
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

Joined: Sep 02, 2009
Posts: 4
but i was wondering why a different ErrorHandler Interface is needed instead of regular Exception mechanism of java ?
 
 
subject: Fatal error while parsing xml
 
Threads others viewed
The entity "nbsp" was referenced, but not declared.
Entity not getting resolved in XSL
  problem
parent child relation ship
The entity "nbsp" was referenced, but not declared
WebSphere development made easy
without the weight of IBM tools
http://www.myeclipseide.com