Throw a SAXException. ex. try { parser.parse( new InputSource( someURI ) ); } catch( SAXException sax ) { if( sax.getMessage().equals( "My condition is true so stop parsing" ) ) { //do any necessary cleanup or whatever you want to do } } public void endElement( String ns, String localName, String nsName ) throws SAXException { if( myTestCondition == true ) throw new SAXException( "My condition is true so stop parsing" ); } Dane Foster Equity Technology Group, Inc http://www.equitytg.com. ----- Original Message ----- From: "Roberto Tiella" To: "xml mailing list" Sent: Thursday, February 01, 2001 6:17 AM Subject: stopping the SAX parser Hi, I would like to stop the SAX parser in a endElement method in DocumentHandler when a certain condition occours to avoid further parsing, any suggestions ? thanks, roberto. -- Roberto Tiella Process Reuse And Technologies Area SODALIA s.p.a. v. Valentina Zambra,1 38100 TRENTO ITALY phone: +39 0461 316430 fax: +39 0461 316401 --------------------------------------------------------------------- In case of troubles, e-mail: webmaster@xml.apache.org To unsubscribe, e-mail: general-unsubscribe@xml.apache.org For additional commands, e-mail: general-help@xml.apache.org