>How do you prematurely end parsing, using the parse() method of the SAX
parser,
>without using the progressive parsing methods like parseNext().  Can you?

Throw an exception from your handler. That really is the standard solution.
If you throw a recognizable exception, the routine which invoked the parser
can catch the SAXException, unwrap it, examine it, and thus distinguish
between deliberate shutdown and unintended crash.

If you're getting your SAX stream from code you don't have control over,
this probably isn't an option. In that case, the best you can do may be to
switch your handler into a no-op mode and let the parser finish.

I've used both. The "CoroutineSAXParser" mechanism in Xalan was originally
designed around the exception approach but was forced to fall back on the
let-it-run-out solution.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to