You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by "Eric Smith@i-Commerce Services" <Er...@za.didata.com> on 2000/10/18 13:29:59 UTC

How do I gracefully exit from a SAX parse midway through?

Hi,

I have implemented a ContentHandler, and would like to know if it is
possible to 'gracefully' terminate the parse process without throwing a SAX
exception (this is how I am currently doing it).  This isn't really an error
condition, so I don't think that a SAX exception is appropriate.  I don't
really want to 'ignore' subsequent events either since the message could
potentially be large, and this would waste CPU resources.

thanks,

--Eric

Eric Smith
Systems Architect
Dimension Data
eric.smith@za.didata.com

Re: How do I gracefully exit from a SAX parse midway through?

Posted by Edwin Goei <Ed...@eng.sun.com>.
"Eric Smith@i-Commerce Services" wrote:
> 
> Hi,
> 
> I have implemented a ContentHandler, and would like to know if it is
> possible to 'gracefully' terminate the parse process without throwing a SAX
> exception (this is how I am currently doing it).  This isn't really an error
> condition, so I don't think that a SAX exception is appropriate.  I don't
> really want to 'ignore' subsequent events either since the message could
> potentially be large, and this would waste CPU resources.

The only way I know of is the throw an exception.  I think it says so in
the SAX docs.

-Edwin