You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by sa...@apache.org on 2005/11/24 16:25:54 UTC

svn commit: r348754 - in /xerces/java/trunk/src/org/apache/xerces/impl: dv/xs/XSSimpleTypeDecl.java msg/XMLSchemaMessages.properties

Author: sandygao
Date: Thu Nov 24 07:25:52 2005
New Revision: 348754

URL: http://svn.apache.org/viewcvs?rev=348754&view=rev
Log:
XML Schema errata E2-66.

Modified:
    xerces/java/trunk/src/org/apache/xerces/impl/dv/xs/XSSimpleTypeDecl.java
    xerces/java/trunk/src/org/apache/xerces/impl/msg/XMLSchemaMessages.properties

Modified: xerces/java/trunk/src/org/apache/xerces/impl/dv/xs/XSSimpleTypeDecl.java
URL: http://svn.apache.org/viewcvs/xerces/java/trunk/src/org/apache/xerces/impl/dv/xs/XSSimpleTypeDecl.java?rev=348754&r1=348753&r2=348754&view=diff
==============================================================================
--- xerces/java/trunk/src/org/apache/xerces/impl/dv/xs/XSSimpleTypeDecl.java (original)
+++ xerces/java/trunk/src/org/apache/xerces/impl/dv/xs/XSSimpleTypeDecl.java Thu Nov 24 07:25:52 2005
@@ -1052,24 +1052,6 @@
 		// step 2: check facets against each other: length, bounds
 		if(fFacetsDefined != 0) {
 			
-			// check 4.3.1.c1 error: length & (maxLength | minLength)
-			if((fFacetsDefined & FACET_LENGTH) != 0 ){
-				if ((fFacetsDefined & FACET_MINLENGTH) != 0) {
-					if ((fFacetsDefined & FACET_MAXLENGTH) != 0) {
-						// length, minLength and maxLength defined
-						reportError("length-minLength-maxLength.a", new Object[]{fTypeName, Integer.toString(fLength), Integer.toString(fMinLength), Integer.toString(fMaxLength)});
-					}
-					else {
-						// length and minLength defined
-						reportError("length-minLength-maxLength.b", new Object[]{fTypeName, Integer.toString(fLength), Integer.toString(fMinLength)});
-					}
-				}
-				else if ((fFacetsDefined & FACET_MAXLENGTH) != 0) {
-					// length and maxLength defined
-					reportError("length-minLength-maxLength.c", new Object[]{fTypeName, Integer.toString(fLength), Integer.toString(fMaxLength)});
-				}
-			}
-			
 			// check 4.3.2.c1 must: minLength <= maxLength
 			if(((fFacetsDefined & FACET_MINLENGTH ) != 0 ) && ((fFacetsDefined & FACET_MAXLENGTH) != 0))
 			{
@@ -1126,12 +1108,12 @@
 				if ((fBase.fFacetsDefined & FACET_MINLENGTH) != 0 &&
 						fLength < fBase.fMinLength) {
 					// length, fBase.minLength and fBase.maxLength defined
-					reportError("length-minLength-maxLength.d", new Object[]{fTypeName, Integer.toString(fLength), Integer.toString(fBase.fMinLength)});
+					reportError("length-minLength-maxLength.1.1", new Object[]{fTypeName, Integer.toString(fLength), Integer.toString(fBase.fMinLength)});
 				}
 				if ((fBase.fFacetsDefined & FACET_MAXLENGTH) != 0 &&
 						fLength > fBase.fMaxLength) {
 					// length and fBase.maxLength defined
-					reportError("length-minLength-maxLength.e", new Object[]{fTypeName, Integer.toString(fLength), Integer.toString(fBase.fMaxLength)});
+					reportError("length-minLength-maxLength.2.1", new Object[]{fTypeName, Integer.toString(fLength), Integer.toString(fBase.fMaxLength)});
 				}
 				if ( (fBase.fFacetsDefined & FACET_LENGTH) != 0 ) {
 					// check 4.3.1.c2 error: length != fBase.length
@@ -1141,16 +1123,30 @@
 			}
 			
 			// check 4.3.1.c1 error: fBase.length & (maxLength | minLength)
-			else if((fBase.fFacetsDefined & FACET_LENGTH) != 0 ){
-				if ((fFacetsDefined & FACET_MINLENGTH) != 0 &&
-						fBase.fLength < fMinLength) {
-					// fBase.length, minLength and maxLength defined
-					reportError("length-minLength-maxLength.d", new Object[]{fTypeName, Integer.toString(fBase.fLength), Integer.toString(fMinLength)});
+			if((fBase.fFacetsDefined & FACET_LENGTH) != 0 || (fFacetsDefined & FACET_LENGTH) != 0){
+				if ((fFacetsDefined & FACET_MINLENGTH) != 0){
+					if (fBase.fLength < fMinLength) {
+						// fBase.length, minLength and maxLength defined
+						reportError("length-minLength-maxLength.1.1", new Object[]{fTypeName, Integer.toString(fBase.fLength), Integer.toString(fMinLength)});
+					}
+					if ((fBase.fFacetsDefined & FACET_MINLENGTH) == 0){ 
+						reportError("length-minLength-maxLength.1.2.a", new Object[]{fTypeName});  
+					}
+					if (fMinLength != fBase.fMinLength){
+						reportError("length-minLength-maxLength.1.2.b", new Object[]{fTypeName, Integer.toString(fMinLength), Integer.toString(fBase.fMinLength)}); 
+					}
 				}
-				if ((fFacetsDefined & FACET_MAXLENGTH) != 0 &&
-						fBase.fLength > fMaxLength) {
-					// fBase.length and maxLength defined
-					reportError("length-minLength-maxLength.e", new Object[]{this, Integer.toString(fBase.fLength), Integer.toString(fMaxLength)});
+				if ((fFacetsDefined & FACET_MAXLENGTH) != 0){
+					if (fBase.fLength > fMaxLength) {
+						// fBase.length, minLength and maxLength defined
+						reportError("length-minLength-maxLength.2.1", new Object[]{fTypeName, Integer.toString(fBase.fLength), Integer.toString(fMaxLength)});
+					}
+					if ((fBase.fFacetsDefined & FACET_MAXLENGTH) == 0){ 
+						reportError("length-minLength-maxLength.2.2.a", new Object[]{fTypeName});  
+					}
+					if (fMaxLength != fBase.fMaxLength){
+						reportError("length-minLength-maxLength.2.2.b", new Object[]{fTypeName, Integer.toString(fMaxLength), Integer.toString(fBase.fBase.fMaxLength)}); 
+					}
 				}
 			}
 			

Modified: xerces/java/trunk/src/org/apache/xerces/impl/msg/XMLSchemaMessages.properties
URL: http://svn.apache.org/viewcvs/xerces/java/trunk/src/org/apache/xerces/impl/msg/XMLSchemaMessages.properties?rev=348754&r1=348753&r2=348754&view=diff
==============================================================================
--- xerces/java/trunk/src/org/apache/xerces/impl/msg/XMLSchemaMessages.properties (original)
+++ xerces/java/trunk/src/org/apache/xerces/impl/msg/XMLSchemaMessages.properties Thu Nov 24 07:25:52 2005
@@ -186,11 +186,12 @@
         e-props-correct.6 = e-props-correct.6: Circular substitution group detected for element ''{0}''.
         fractionDigits-valid-restriction = fractionDigits-valid-restriction: In the definition of {2}, the value ''{0}'' for the facet ''fractionDigits'' is invalid, because it must be <= the value for ''fractionDigits'' which was set to ''{1}'' in one of the ancestor types.
         fractionDigits-totalDigits = fractionDigits-totalDigits: In the definition of {2}, the value ''{0}'' for the facet ''fractionDigits'' is invalid, because the value must be <= the value for ''totalDigits'' which is ''{1}''.
-        length-minLength-maxLength.a = length-minLength-maxLength.a: It is an error to specify both length and either of minLength or maxLength. However, {0} has length = ''{1}'', minLength = ''{2}'' and maxLength = ''{3}''.
-        length-minLength-maxLength.b = length-minLength-maxLength.b: It is an error to specify both length and either of minLength or maxLength. However, {0} has length = ''{1}'' and minLength = ''{2}''.
-        length-minLength-maxLength.c = length-minLength-maxLength.c: It is an error to specify both length and either of minLength or maxLength. However, {0} has length = ''{1}'' and maxLength = ''{2}''.
-        length-minLength-maxLength.d = length-minLength-maxLength.d: For type {0}, it is an error for the value of length ''{1}'' to be less than the value of minLength ''{2}''.
-        length-minLength-maxLength.e = length-minLength-maxLength.e: For type {0}, it is an error for the value of length ''{1}'' to be greater than the value of maxLength ''{2}''. 
+        length-minLength-maxLength.1.1 = length-minLength-maxLength.1.1: For type {0}, it is an error for the value of length ''{1}'' to be less than the value of minLength ''{2}''.
+        length-minLength-maxLength.1.2.a = length-minLength-maxLength.1.2.a: For type {0}, it is an error for the base to not have a minLength facet if the current restriction has the minLength facet and the current restriction or base has the length facet. 
+        length-minLength-maxLength.1.2.b = length-minLength-maxLength.1.2.b: For type {0}, it is an error for the current minLength ''{1}'' to not equal the base minLength ''{2}''.
+        length-minLength-maxLength.2.1 = length-minLength-maxLength.2.1: For type {0}, it is an error for the value of length ''{1}'' to be greater than the value of maxLength ''{2}''. 
+        length-minLength-maxLength.2.2.a = length-minLength-maxLength.2.2.a: For type {0}, it is an error for the base to not have a maxLength facet if the current restriction has the maxLength facet and the current restriction or base has the length facet. 
+        length-minLength-maxLength.2.2.b = length-minLength-maxLength.2.2.b: For type {0}, it is an error for the current maxLength ''{1}'' to not equal the base maxLength ''{2}''.        
         length-valid-restriction = length-valid-restriction: Error for type ''{2}''. The value of length = ''{0}'' must be = the value of that of the base type ''{1}''.
         maxExclusive-valid-restriction.1 = maxExclusive-valid-restriction.1: Error for type ''{2}''. The maxExclusive value =''{0}'' must be <= maxExclusive of the base type ''{1}''.
         maxExclusive-valid-restriction.2 = maxExclusive-valid-restriction.2: Error for type ''{2}''. The maxExclusive value =''{0}'' must be <= maxInclusive of the base type ''{1}''.



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xerces.apache.org
For additional commands, e-mail: commits-help@xerces.apache.org