how to stop Xerces

Mhaxx

Usenet Archive
Joined
Jul 19, 2004
Messages
12
Reaction score
0
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
 

Johannes Koch

Usenet Archive
Joined
Nov 14, 2000
Messages
801
Reaction score
0
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.
 

Keith M. Corbett

Usenet Archive
Joined
Mar 13, 2001
Messages
50
Reaction score
0
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
 

Martin Honnen

Usenet Archive
Joined
Apr 8, 2000
Messages
6,174
Reaction score
0
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.
 

Johannes Koch

Usenet Archive
Joined
Nov 14, 2000
Messages
801
Reaction score
0
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
548,042
Messages
3,104,223
Members
248,131
Latest member
Tonypshaw1

Latest Threads

Top