sandygao 2003/01/23 15:12:27 Modified: java/src/org/apache/xerces/impl/dtd XMLDTDValidator.java Log: Making the behavior of dynamic validation consistent: - Make it work as what the feature description says; - Make DTD and Schema validation work the same way. That is, when dynamic validation feature is on, dynamic validation always happens, in spite of the state of the validation feature. Revision Changes Path 1.45 +15 -3 xml-xerces/java/src/org/apache/xerces/impl/dtd/XMLDTDValidator.java Index: XMLDTDValidator.java =================================================================== RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/dtd/XMLDTDValidator.java,v retrieving revision 1.44 retrieving revision 1.45 diff -u -r1.44 -r1.45 --- XMLDTDValidator.java 16 Jan 2003 23:03:08 -0000 1.44 +++ XMLDTDValidator.java 23 Jan 2003 23:12:27 -0000 1.45 @@ -1076,9 +1076,21 @@ } public final boolean validate(){ + // Do validation if all of the following are true: + // 1. The JAXP Schema Language property is not XML Schema + // REVISIT: since only DTD and Schema are supported at this time, + // such checking is sufficient. but if more schema types + // are introduced in the future, we'll need to change it + // to something like + // (fSchemaType == null || fSchemaType == NS_XML_DTD) + // 2. One of the following is true (validation features) + // 2.1 Dynamic validation is off, and validation is on + // 2.2 Dynamic validation is on, and DOCTYPE was seen + // 3 Xerces schema validation feature is off, or DOCTYPE was seen. return (fSchemaType != Constants.NS_XMLSCHEMA) && - fValidation && (!fDynamicValidation || fSeenDoctypeDecl) - && (fDTDValidation || fSeenDoctypeDecl); + (!fDynamicValidation && fValidation || + fDynamicValidation && fSeenDoctypeDecl) && + (fDTDValidation || fSeenDoctypeDecl); } //REVISIT:we can convert into functions.. adding default attribute values.. and one validating.
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]