Author: mukulg Date: Sat Nov 17 05:27:30 2012 New Revision: 1410698 URL: http://svn.apache.org/viewvc?rev=1410698&view=rev Log: committing fix for jira issue XERCESJ-1594.
Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/msg/XMLSchemaMessages.properties xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/msg/XMLSchemaMessages.properties URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/msg/XMLSchemaMessages.properties?rev=1410698&r1=1410697&r2=1410698&view=diff ============================================================================== --- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/msg/XMLSchemaMessages.properties (original) +++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/msg/XMLSchemaMessages.properties Sat Nov 17 05:27:30 2012 @@ -44,6 +44,7 @@ KeyRefOutOfScope = Identity Constraint error: the keyref identity constraint \"{0}\" refers to a key or unique that is out of scope. KeyRefReferNotFound = Key reference declaration \"{0}\" refers to unknown key with name \"{1}\". UnknownField = Internal identity constraint error; unknown field \"{0}\" for identity constraint \"{2}\" specified for element \"{1}\". + KeyRefNotEnoughValues = cvc-identity-constraint.4.3.b: Not enough values specified for <keyref name=\"{1}\"> identity constraint specified for element \"{0}\". # Ideally, we should only use the following error keys, not the ones under # "Identity constraints". And we should cover all of the following errors. Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java?rev=1410698&r1=1410697&r2=1410698&view=diff ============================================================================== --- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java (original) +++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java Sat Nov 17 05:27:30 2012 @@ -2749,18 +2749,13 @@ public class XMLSchemaValidator && id.getCategory() == IdentityConstraint.IC_KEYREF) { ValueStoreBase values = fValueStoreCache.getValueStoreFor(id, selMatcher.getInitialDepth()); - // nothing to do if nothing matched, or if not all - // fields are present. - if (values != null && values.fValuesCount == values.fFieldCount) { - values.endDocumentFragment(); + // report error if not all fields are present + if (values.fValuesCount != values.fFieldCount) { + reportSchemaError("KeyRefNotEnoughValues", new Object[] { element.rawname, values.getIdentityConstraint().getName() }); } - else if (values != null) { - IdentityConstraint idcConstraint = values.getIdentityConstraint(); - if (fValueStoreCache.fGlobalIDConstraintMap.get(((KeyRef)idcConstraint).getKey()) == null) { - reportSchemaError("KeyRefOutOfScope", new Object[] { idcConstraint.getName() }); - } + if (values != null) { // nothing to do if nothing matched + values.endDocumentFragment(); } - } } } --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@xerces.apache.org For additional commands, e-mail: commits-h...@xerces.apache.org