code: private void validateXMLSchema(InputStream objectAsStream, DOValidatorXMLSchema xsv)
              throws ObjectValidityException, GeneralException {
  
          try {
              xsv.validate(objectAsStream);
          } catch (ObjectValidityException e) {
              logger.error("VALIDATE: ERROR - failed XML Schema validation.", e);
              throw e;
          } catch (Exception e) {
              logger.error("VALIDATE: ERROR - failed XML Schema validation.", e);
              throw new ObjectValidityException("[DOValidatorImpl]: validateXMLSchema. "
                      + e.getMessage());
          }
          logger.debug("VALIDATE: SUCCESS - passed XML Schema validation.");
      }
docs: Do XML Schema validation on the Fedora object.
  
  @param objectAsFile
  The digital object provided as a file.
  @throws ObjectValidityException
  If validation fails for any reason.
  @throws GeneralException
  If validation fails for any reason.