src/com/sun/org/apache/xerces/internal/impl/XMLDTDScannerImpl.java

Print this page




 568      * are just specified by their name.
 569      *
 570      * @param name The name of the entity.
 571      *
 572      * @throws XNIException Thrown by handler to signal an error.
 573      */
 574     public void endEntity(String name, Augmentations augs)
 575     throws XNIException, IOException {
 576 
 577         super.endEntity(name, augs);
 578 
 579         // if there is no data after the doctype
 580         //
 581         if (fScannerState == SCANNER_STATE_END_OF_INPUT)
 582             return;
 583 
 584         // Handle end of PE
 585         boolean reportEntity = fReportEntity;
 586         if (name.startsWith("%")) {
 587             reportEntity = peekReportEntity();
 588             // check well-formedness of the enity
 589             int startMarkUpDepth = popPEStack();
 590             // throw fatalError if this entity was incomplete and
 591             // was a freestanding decl
 592             if(startMarkUpDepth == 0 &&
 593             startMarkUpDepth < fMarkUpDepth) {
 594                 fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN,
 595                 "ILL_FORMED_PARAMETER_ENTITY_WHEN_USED_IN_DECL",
 596                 new Object[]{ fEntityManager.fCurrentEntity.name},
 597                 XMLErrorReporter.SEVERITY_FATAL_ERROR);
 598             }
 599             if (startMarkUpDepth != fMarkUpDepth) {
 600                 reportEntity = false;
 601                 if (fValidation) {
 602                     // Proper nesting of parameter entities is a Validity Constraint
 603                     // and must not be enforced when validation is off
 604                     fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN,
 605                     "ImproperDeclarationNesting",
 606                     new Object[]{ name },
 607                     XMLErrorReporter.SEVERITY_ERROR);
 608                 }




 568      * are just specified by their name.
 569      *
 570      * @param name The name of the entity.
 571      *
 572      * @throws XNIException Thrown by handler to signal an error.
 573      */
 574     public void endEntity(String name, Augmentations augs)
 575     throws XNIException, IOException {
 576 
 577         super.endEntity(name, augs);
 578 
 579         // if there is no data after the doctype
 580         //
 581         if (fScannerState == SCANNER_STATE_END_OF_INPUT)
 582             return;
 583 
 584         // Handle end of PE
 585         boolean reportEntity = fReportEntity;
 586         if (name.startsWith("%")) {
 587             reportEntity = peekReportEntity();
 588             // check well-formedness of the entity
 589             int startMarkUpDepth = popPEStack();
 590             // throw fatalError if this entity was incomplete and
 591             // was a freestanding decl
 592             if(startMarkUpDepth == 0 &&
 593             startMarkUpDepth < fMarkUpDepth) {
 594                 fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN,
 595                 "ILL_FORMED_PARAMETER_ENTITY_WHEN_USED_IN_DECL",
 596                 new Object[]{ fEntityManager.fCurrentEntity.name},
 597                 XMLErrorReporter.SEVERITY_FATAL_ERROR);
 598             }
 599             if (startMarkUpDepth != fMarkUpDepth) {
 600                 reportEntity = false;
 601                 if (fValidation) {
 602                     // Proper nesting of parameter entities is a Validity Constraint
 603                     // and must not be enforced when validation is off
 604                     fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN,
 605                     "ImproperDeclarationNesting",
 606                     new Object[]{ name },
 607                     XMLErrorReporter.SEVERITY_ERROR);
 608                 }