aspose file tools*
The moose likes Groovy and the fly likes Fatal error while parsing xml Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Languages » Groovy
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 ?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Fatal error while parsing xml