MyXmlContentHandler::startElement( ... ){ ... if ( oh_shit ) return false; ...}... QXmlSimpleReader reader( ... ); if ( !reader.parse( myinput, true ) ) { do { // report error } while ( !reader.parseContinue() ); }