peiyongz 2004/04/23 14:19:59 Modified: c/src/xercesc/internal DGXMLScanner.cpp IGXMLScanner.cpp Log: XML1.0-3rd: EMPTY Element can not have content (not even entity references, comments, PIs or white space). Revision Changes Path 1.43 +20 -1 xml-xerces/c/src/xercesc/internal/DGXMLScanner.cpp Index: DGXMLScanner.cpp =================================================================== RCS file: /home/cvs/xml-xerces/c/src/xercesc/internal/DGXMLScanner.cpp,v retrieving revision 1.42 retrieving revision 1.43 diff -u -r1.42 -r1.43 --- DGXMLScanner.cpp 7 Apr 2004 14:15:12 -0000 1.42 +++ DGXMLScanner.cpp 23 Apr 2004 21:19:59 -0000 1.43 @@ -582,6 +582,7 @@ case Token_Comment : scanComment(); + fElemStack.setCommentOrPISeen(); break; case Token_EndTag : @@ -590,6 +591,7 @@ case Token_PI : scanPI(); + fElemStack.setCommentOrPISeen(); break; case Token_StartTag : @@ -704,6 +706,23 @@ // this element and let him validate it. if (fValidate) { + + // + // XML1.0-3rd + // Validity Constraint: + // The declaration matches EMPTY and the element has no content (not even + // entity references, comments, PIs or white space). + // + if ( (topElem->fCommentOrPISeen) && + (((DTDElementDecl*) topElem->fThisElement)->getModelType() == DTDElementDecl::Empty)) + { + fValidator->emitError + ( + XMLValid::EmptyElemHasContent + , topElem->fThisElement->getFullName() + ); + } + int res = fValidator->checkContent ( topElem->fThisElement 1.65 +21 -1 xml-xerces/c/src/xercesc/internal/IGXMLScanner.cpp Index: IGXMLScanner.cpp =================================================================== RCS file: /home/cvs/xml-xerces/c/src/xercesc/internal/IGXMLScanner.cpp,v retrieving revision 1.64 retrieving revision 1.65 diff -u -r1.64 -r1.65 --- IGXMLScanner.cpp 14 Apr 2004 21:33:57 -0000 1.64 +++ IGXMLScanner.cpp 23 Apr 2004 21:19:59 -0000 1.65 @@ -911,6 +911,7 @@ case Token_Comment : scanComment(); + fElemStack.setCommentOrPISeen(); break; case Token_EndTag : @@ -919,6 +920,7 @@ case Token_PI : scanPI(); + fElemStack.setCommentOrPISeen(); break; case Token_StartTag : @@ -1085,6 +1087,24 @@ DatatypeValidator* psviMemberType = 0; if (fValidate) { + + // + // XML1.0-3rd + // Validity Constraint: + // The declaration matches EMPTY and the element has no content (not even + // entity references, comments, PIs or white space). + // + if ( (fGrammarType == Grammar::DTDGrammarType) && + (topElem->fCommentOrPISeen) && + (((DTDElementDecl*) topElem->fThisElement)->getModelType() == DTDElementDecl::Empty)) + { + fValidator->emitError + ( + XMLValid::EmptyElemHasContent + , topElem->fThisElement->getFullName() + ); + } + int res = fValidator->checkContent ( topElem->fThisElement
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]