how to stop Xerces

M

Mhaxx

How can I stop Xerces Java 2.6.2 execution? If there is a validation
error I want to stop parsing, but now it goes on.. :-(

Mhaxx
 
J

Johannes Koch

Mhaxx said:
How can I stop Xerces Java 2.6.2 execution? If there is a validation
error I want to stop parsing, but now it goes on.. :-(

That's normal behavior. Only fatal errors (violating wellformedness)
make the parser stop.

You may ry
System.exit()
in your ErrorHandler's error method.
 
K

Keith M. Corbett

Johannes Koch said:
That's normal behavior. Only fatal errors (violating wellformedness)
make the parser stop.

You may ry
System.exit()
in your ErrorHandler's error method.

Would throwing an exception in the error method stop the parser? (without
necessarily stopping the calling program)

/kmc
 
M

Martin Honnen

Johannes said:
I don't think so.

My Java SDK documention for 1.4 says:

public void parse(InputSource input)
throws IOException,
SAXException
Parse an XML document.


During the parse, the XMLReader will provide information about the XML
document through the registered event handlers.

This method is synchronous: it will not return until parsing has ended.
If a client application wants to terminate parsing early, it should
throw an exception.
 
J

Johannes Koch

Martin said:
public void parse(InputSource input)
throws IOException,
SAXException
Parse an XML document.


During the parse, the XMLReader will provide information about the XML
document through the registered event handlers.

This method is synchronous: it will not return until parsing has ended.
If a client application wants to terminate parsing early, it should
throw an exception.

Ah, I should RTFM :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,763
Messages
2,569,562
Members
45,038
Latest member
OrderProperKetocapsules

Latest Threads

Top