diff --git a/src/xercesc/internal/XMLScanner.cpp b/src/xercesc/internal/XMLScanner.cpp index 2b6fb05cd425ed4ea54eff47ce7eab04dd472d77..888e28423424bdeb25d451f4e9c575563c0462a6 100644 --- a/src/xercesc/internal/XMLScanner.cpp +++ b/src/xercesc/internal/XMLScanner.cpp @@ -2382,19 +2382,11 @@ bool XMLScanner::scanStartTag(bool& gotData) , elemDecl->getFullName() ); } - - // - // If we are not validating, then mark it as declared since it makes - // things simpler and we aren't going to do do the validation checks - // that need to know if it was really declared or not anyway. - // - if (!fValidate) - elemDecl->setCreateReason(XMLElementDecl::Declared); } else { // If its not marked declared and validating, then emit an error - if (!elemDecl->isDeclared() && fValidate) + if (fValidate && !elemDecl->isDeclared()) { fValidator->emitError ( @@ -3272,14 +3264,6 @@ bool XMLScanner::scanStartTagNS(bool& gotData) , elemDecl->getFullName() ); } - - // - // If we are not validating, then mark it as declared since it makes - // things simpler and we aren't going to do do the validation checks - // that need to know if it was really declared or not anyway. - // - if (!fValidate) - elemDecl->setCreateReason(XMLElementDecl::Declared); } else {