jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/XMLDocumentFragmentScannerImpl.java
changeset 2669 15024792697e
parent 6 7f561c08de6b
child 3294 8943b2e74175
equal deleted inserted replaced
2225:a25c5ec5e40e 2669:15024792697e
   287     protected boolean fReplaceEntityReferences = true;
   287     protected boolean fReplaceEntityReferences = true;
   288     protected boolean fSupportExternalEntities = false;
   288     protected boolean fSupportExternalEntities = false;
   289     protected boolean fReportCdataEvent = false ;
   289     protected boolean fReportCdataEvent = false ;
   290     protected boolean fIsCoalesce = false ;
   290     protected boolean fIsCoalesce = false ;
   291     protected String fDeclaredEncoding =  null;
   291     protected String fDeclaredEncoding =  null;
       
   292     /** Disallow doctype declaration. */
       
   293     protected boolean fDisallowDoctype = false;
   292 
   294 
   293     // drivers
   295     // drivers
   294 
   296 
   295     /** Active driver. */
   297     /** Active driver. */
   296     protected Driver fDriver;
   298     protected Driver fDriver;
  1850             fScannerState = SCANNER_STATE_REFERENCE;
  1852             fScannerState = SCANNER_STATE_REFERENCE;
  1851             return ;
  1853             return ;
  1852         }
  1854         }
  1853         // start general entity
  1855         // start general entity
  1854         if (!fEntityStore.isDeclaredEntity(name)) {
  1856         if (!fEntityStore.isDeclaredEntity(name)) {
       
  1857             //SUPPORT_DTD=false && ReplaceEntityReferences should throw exception
       
  1858             if (fDisallowDoctype && fReplaceEntityReferences) {
       
  1859                 reportFatalError("EntityNotDeclared", new Object[]{name});
       
  1860                 return;
       
  1861             }
  1855             //REVISIT: one more case needs to be included: external PE and standalone is no
  1862             //REVISIT: one more case needs to be included: external PE and standalone is no
  1856             if ( fHasExternalDTD && !fStandalone) {
  1863             if ( fHasExternalDTD && !fStandalone) {
  1857                 if (fValidation)
  1864                 if (fValidation)
  1858                     fErrorReporter.reportError(fEntityScanner, XMLMessageFormatter.XML_DOMAIN,"EntityNotDeclared",
  1865                     fErrorReporter.reportError(fEntityScanner, XMLMessageFormatter.XML_DOMAIN,"EntityNotDeclared",
  1859                             new Object[]{name}, XMLErrorReporter.SEVERITY_ERROR);
  1866                             new Object[]{name}, XMLErrorReporter.SEVERITY_ERROR);