This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
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 EJB 3 in Action this week in the EJB and other Java EE Technologies 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 ?
 
jQuery in Action, 2nd edition
 
subject: Fatal error while parsing xml
 
Similar Threads
  problem
Entity not getting resolved in XSL
parent child relation ship
The entity "nbsp" was referenced, but not declared
The entity "nbsp" was referenced, but not declared.