public void startDocument() throws SAXException {
   fComponentManager.reset();
   fSchemaValidator.setDocumentHandler(this);
   fValidationManager.setEntityState(this);
   fTypeInfoProvider.finishStartElement(); // cleans up TypeInfoProvider
   fNeedPushNSContext = true;
   if (fUnparsedEntities != null && !fUnparsedEntities.isEmpty()) {
     // should only clear this if the last document contained unparsed entities
     fUnparsedEntities.clear();
   }
   fErrorReporter.setDocumentLocator(fSAXLocatorWrapper);
   try {
     fSchemaValidator.startDocument(
         fSAXLocatorWrapper, fSAXLocatorWrapper.getEncoding(), fNamespaceContext, null);
   } catch (XMLParseException e) {
     throw Util.toSAXParseException(e);
   } catch (XNIException e) {
     throw Util.toSAXException(e);
   }
 }