public void reportError(String msg, Locator src) throws SAXException {
          // set a flag to true to avoid returning a corrupted object.
          setErrorFlag();

          SAXParseException e = new SAXParseException(msg, src);
          if (errorHandler == null) throw e;
          else errorHandler.error(e);
        }
 public void fatalError(SAXParseException e) {
   setErrorFlag();
 }
 public void fatalError(SAXParseException e) throws SAXException {
   setErrorFlag();
   getErrorHandler().fatalError(e);
 }