protected void checkAndSendUnparsedEntity(UnparsedEntity ent){
  if (isRootDocument()) {
    int index=fUnparsedEntities.indexOf(ent);
    if (index == -1) {
      XMLResourceIdentifier id=new XMLResourceIdentifierImpl(ent.publicId,ent.systemId,ent.baseURI,ent.expandedSystemId);
      addUnparsedEntity(ent.name,id,ent.notation,ent.augmentations);
      if (fSendUEAndNotationEvents && fDTDHandler != null) {
        fDTDHandler.unparsedEntityDecl(ent.name,id,ent.notation,ent.augmentations);
      }
    }
 else {
      UnparsedEntity localEntity=(UnparsedEntity)fUnparsedEntities.get(index);
      if (!ent.isDuplicate(localEntity)) {
        reportFatalError("NonDuplicateUnparsedEntity",new Object[]{ent.name});
      }
    }
  }
 else {
    fParentXIncludeHandler.checkAndSendUnparsedEntity(ent);
  }
}

protected void checkAndSendUnparsedEntity ( UnparsedEntity ent ) { if ( isRootDocument ( ) ) { int index = fUnparsedEntities . indexOf ( ent ) ; if ( index == - 1 ) { XMLResourceIdentifier id = new XMLResourceIdentifierImpl ( ent . publicId , ent . systemId , ent . baseURI , ent . expandedSystemId ) ; addUnparsedEntity ( ent . name , id , ent . notation , ent . augmentations ) ; if ( fSendUEAndNotationEvents && fDTDHandler != null ) { fDTDHandler . unparsedEntityDecl ( ent . name , id , ent . notation , ent . augmentations ) ; } } else { UnparsedEntity localEntity = ( UnparsedEntity ) fUnparsedEntities . get ( index ) ; if ( ! ent . isDuplicate ( localEntity ) ) { reportFatalError ( "NonDuplicateUnparsedEntity" , new Object [ ] { ent . name } ) ; } } } else { fParentXIncludeHandler . checkAndSendUnparsedEntity ( ent ) ; } }
the purpose of this method is to check if an unparsedentity conflicts with a previously declared entity in the current pipeline stack . if there is no conflict , the unparsedentity is sent by the root pipeline .
