sandygao 2003/01/20 11:45:25 Modified: java/src/org/apache/xerces/impl/msg XMLSchemaMessages.properties java/src/org/apache/xerces/impl/xs/traversers XSDHandler.java Log: 1. Fixing some errors in the message file; 2. Proper error codes for circular references; 3. Error code change as per Erratum E1-23. Revision Changes Path 1.59 +11 -7 xml-xerces/java/src/org/apache/xerces/impl/msg/XMLSchemaMessages.properties Index: XMLSchemaMessages.properties =================================================================== RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/msg/XMLSchemaMessages.properties,v retrieving revision 1.58 retrieving revision 1.59 diff -u -r1.58 -r1.59 --- XMLSchemaMessages.properties 20 Jan 2003 17:44:41 -0000 1.58 +++ XMLSchemaMessages.properties 20 Jan 2003 19:45:25 -0000 1.59 @@ -115,6 +115,7 @@ src-attribute.4 = src-attribute.4: Attribute ''{0}'' have both a type attribute and a annoymous simpleType child.. src-attribute.5 = src-attribute.5: error. src-attribute_group = src-attribute_group: Attribute group ''{0}'' does not conform to the schema for schemas. Element ''{1}'' is invalid or misplaced. + src-attribute_group.3 = src-attribute_group.3: Circular definitions detected for attribute group ''{0}''. src-ct.0.1 = src-ct.0.1: Complex Type Definition Representation Error for type ''{0}''. Element ''{1}'' is invalid, misplaced, or occurs too often. src-element.1 = src-element.1: ''default'' and ''fixed'' must not both be present in element declaration ''{0}''. src-ct.0.2 = src-ct.0.2: Complex Type Definition Representation Error for type ''{0}''. Element ''{1}'' must not be empty. @@ -199,9 +200,9 @@ cos-particle-restrict.2 = cos-particle-restrict.2: Forbidden particle restriction: ''{0}''. cos-seq-range = cos-seq-range: error. cos-st-derived-ok = cos-st-derived-ok: error. - cos-st-restricts.1.1 = cos-st-restricts.1.1: The {base type definition} ''{0}'' must be an atomic simple type definition or a built-in primitive datatype. - cos-st-restricts.2.3.1.1 = cos-st-restricts.2.3.1.1: The {final} of the {item type definition} ''{0}'' must not contain list. - cos-st-restricts.3.3.1.1 = cos-st-restricts.3.3.1.1: The {member type definitions} ''{0}'' must have a {final} which does not contain union. + cos-st-restricts.1.1 = cos-st-restricts.1.1: The '{'base type definition'}' ''{0}'' must be an atomic simple type definition or a built-in primitive datatype. + cos-st-restricts.2.3.1.1 = cos-st-restricts.2.3.1.1: The '{'final'}' of the '{'item type definition'}' ''{0}'' must not contain list. + cos-st-restricts.3.3.1.1 = cos-st-restricts.3.3.1.1: The '{'member type definitions'}' ''{0}'' must have a '{'final'}' which does not contain union. cos-valid-default.1 = cos-valid-default.1: error. cos-valid-default.2.1 = cos-valid-default.2.1: Element ''{0}'' has a value constraint and must have a mixed or simple content model. cos-valid-default.2.2.1 = cos-valid-default.2.2.1: error. @@ -209,6 +210,7 @@ c-props-correct.1 = c-props-correct.1: error. c-props-correct.2 = c-props-correct.2: Cardinality of Fields for keyref ''{0}'' and key ''{1}'' must match. ct-props-correct = ct-props-correct: error. + ct-props-correct.3 = ct-props-correct.3: Circular definitions detected for complex type ''{0}''. ct-props-correct.4 = ct-props-correct.4: Error for type ''{0}''. Duplicate attribute uses with the same name and target namespace are specified. Name of duplicate attribute use is ''{1}''. ct-props-correct.5 = ct-props-correct.5: Error for type ''{0}''. Two attribute declarations, ''{1}'' and ''{2}'' have types which derived from ID. derivation-ok-restriction = derivation-ok-restriction: error. @@ -230,7 +232,8 @@ e-props-correct.1 = e-props-correct.1: error. e-props-correct.2 = e-props-correct.2: Invalid value constraint value ''{1}'' in element ''{0}''. e-props-correct.3 = e-props-correct.3: The '{'type definition'}' of element ''{0}'' must be validly derived from the '{'type definition'}' of the substitutionHead ''{1}''. - e-props-correct.4 = e-props-correct.4: There must not be a '{'value constraint'}' on element ''{0}'', because its '{'type definition'}' or '{'type definition'}''s '{'content type'}' is or is derived from ID. + e-props-correct.4 = e-props-correct.4: There must not be a '{'value constraint'}' on element ''{0}'', because its '{'type definition'}' or '{'type definition'}'''s '{'content type'}' is or is derived from ID. + e-props-correct.6 = e-props-correct.6: Circular substitution group detected for element ''{0}''. fractionDigits-totalDigits = fractionDigits-totalDigits: fractionDigits value = ''{0}'' must be <= totalDigits value = ''{1}''. length-minLength-maxLength = length-minLength-maxLength: It is an error for both length and either of minLength or maxLength to be specified. length-valid-restriction = length-valid-restriction: Value of length = ''{0}'' must be = the value of that of the base type ''{1}''. @@ -246,6 +249,7 @@ maxLength-valid-restriction = maxLength-valid-restriction: maxLength value = ''{0}'' must be <= that of the base type ''{1}''. mgd-props-correct = mgd-props-correct: error. mg-props-correct = mg-props-correct: error. + mg-props-correct.2 = mg-props-correct.2: Circular definitions detected for group ''{0}''. minExclusive-less-than-equal-to-maxExclusive = minExclusive-less-than-equal-to-maxExclusive: minExclusive value = ''{0}'' must be <= maxExclusive value = ''{1}''. minExclusive-less-than-maxInclusive = minExclusive-less-than-maxInclusive: minExclusive value = ''{0}'' must be < maxInclusive value = ''{1}''. minExclusive-valid-restriction.1 = minExclusive-valid-restriction.1: minExclusive value =''{0}'' must be >= minExclusive of the base type ''{1}''. @@ -300,8 +304,8 @@ sch-props-correct.1 = sch-props-correct.1: schema components of type ''{0}'' cannot occur after declarations or are not permitted as children of a <schema> element. sch-props-correct.2 = sch-props-correct.2: a schema cannot contain two global components with the same name; this one contains two occurrences of ''{0}''. st-props-correct.1 = st-props-correct.1: error. - st-props-correct.2 = st-props-correct.2: circular definitions detected for type ''{0}''. - st-props-correct.3 = st-props-correct.3: {final} of the {base type definition} contains restriction. + st-props-correct.2 = st-props-correct.2: circular definitions detected for simple type ''{0}''. + st-props-correct.3 = st-props-correct.3: '{'final'}' of the '{'base type definition'}' contains restriction. totalDigits-valid-restriction = totalDigits-valid-restriction: totalDigits value = ''{0}'' must be <= that of the base type ''{1}''. whiteSpace-valid-restriction.1 = whiteSpace-valid-restriction.1: It is an error if whiteSpace = ''preserve'' or ''replace'' and fBase.whiteSpace = ''collapse''. whiteSpace-valid-restriction.2 = whiteSpace-valid-restriction.2: It is an error if whiteSpace = ''preserve'' and fBase.whiteSpace = ''replace''. 1.61 +18 -2 xml-xerces/java/src/org/apache/xerces/impl/xs/traversers/XSDHandler.java Index: XSDHandler.java =================================================================== RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/xs/traversers/XSDHandler.java,v retrieving revision 1.60 retrieving revision 1.61 diff -u -r1.60 -r1.61 --- XSDHandler.java 16 Jan 2003 23:03:08 -0000 1.60 +++ XSDHandler.java 20 Jan 2003 19:45:25 -0000 1.61 @@ -1009,6 +1009,17 @@ "type definition", }; + private static final String[] CIRCULAR_CODES = { + "Internal-Error", + "Internal-Error", + "src-attribute_group.3", + "e-props-correct.6", + "mg-props-correct.2", + "Internal-Error", + "Internal-Error", + "st-props-correct.2", //or ct-props-correct.3 + }; + // since it is forbidden for traversers to talk to each other // directly (except wen a traverser encounters a local declaration), // this provides a generic means for a traverser to call @@ -1145,8 +1156,13 @@ // but we didn't find it in the grammar, so it's the latter case, and // a circular reference. error! if (DOMUtil.isHidden(decl)) { + String code = CIRCULAR_CODES[declType]; + if (declType == TYPEDECL_TYPE) { + if (SchemaSymbols.ELT_COMPLEXTYPE.equals(DOMUtil.getLocalName(decl))) + code = "ct-props-correct.3"; + } // decl must not be null if we're here... - reportSchemaError("st-props-correct.2", new Object [] {declToTraverse.prefix+":"+declToTraverse.localpart}, elmNode); + reportSchemaError(code, new Object [] {declToTraverse.prefix+":"+declToTraverse.localpart}, elmNode); return null; }
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]