Author: mukulg Date: Thu Jun 2 15:47:52 2022 New Revision: 1901562 URL: http://svn.apache.org/viewvc?rev=1901562&view=rev Log: committing fix for jira issue XERCESJ-1746
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 xerces/java/trunk/src/org/apache/xerces/impl/msg/XMLSchemaMessages.properties xerces/java/trunk/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=1901562&r1=1901561&r2=1901562&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 Thu Jun 2 15:47:52 2022 @@ -109,7 +109,7 @@ cvc-type.1 = cvc-type.1: The type definition ''{0}'' was not found. cvc-type.2 = cvc-type.2: The type definition cannot be abstract for element {0}. cvc-type.3.1.1 = cvc-type.3.1.1: Element ''{0}'' is a simple type, so it cannot have attributes, excepting those whose namespace name is identical to ''http://www.w3.org/2001/XMLSchema-instance'' and whose [local name] is one of ''type'', ''nil'', ''schemaLocation'' or ''noNamespaceSchemaLocation''. However, the attribute, ''{1}'' was found. - cvc-type.3.1.2 = cvc-type.3.1.2: Element ''{0}'' is a simple type, so it must have no element information item [children]. + cvc-type.3.1.2 = cvc-type.3.1.2: Element ''{0}'' has the simple type ''{1}'', so it must have no element information item [children]. cvc-type.3.1.3 = cvc-type.3.1.3: The value ''{1}'' of element ''{0}'' is not valid. cvc-assertion = cvc-assertion: Assertion evaluation (''{1}'') for element ''{0}'' on schema type ''{2}'' did not succeed. {3} cvc-assertion-failure-mesg = cvc-assertion-failure-mesg: {0} {1} 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=1901562&r1=1901561&r2=1901562&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 Thu Jun 2 15:47:52 2022 @@ -3008,10 +3008,11 @@ public class XMLSchemaValidator extends // 3.1 If the type definition is a simple type definition, then all of the following must be true: if (fCurrentType.getTypeCategory() == XSTypeDefinition.SIMPLE_TYPE) { // 3.1.2 The element information item must have no element information item [children]. - if (fSubElement) - reportSchemaError("cvc-type.3.1.2", new Object[] { element.rawname }); - // 3.1.3 If clause 3.2 of Element Locally Valid (Element) (3.3.4) did not apply, then the normalized value must be valid with respect to the type definition as defined by String Valid (3.14.4). - if (!fNil) { + if (fSubElement) { + reportSchemaError("cvc-type.3.1.2", new Object[] { element.rawname, XS11TypeHelper.getSchemaTypeName(fCurrentType) }); + } + else if (!fNil) { + // 3.1.3 If clause 3.2 of Element Locally Valid (Element) (3.3.4) did not apply, then the normalized value must be valid with respect to the type definition as defined by String Valid (3.14.4). XSSimpleType dv = (XSSimpleType) fCurrentType; try { if (!fNormalizeData || fUnionType) { Modified: xerces/java/trunk/src/org/apache/xerces/impl/msg/XMLSchemaMessages.properties URL: http://svn.apache.org/viewvc/xerces/java/trunk/src/org/apache/xerces/impl/msg/XMLSchemaMessages.properties?rev=1901562&r1=1901561&r2=1901562&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 Jun 2 15:47:52 2022 @@ -105,7 +105,7 @@ cvc-type.1 = cvc-type.1: The type definition ''{0}'' was not found. cvc-type.2 = cvc-type.2: The type definition cannot be abstract for element {0}. cvc-type.3.1.1 = cvc-type.3.1.1: Element ''{0}'' is a simple type, so it cannot have attributes, excepting those whose namespace name is identical to ''http://www.w3.org/2001/XMLSchema-instance'' and whose [local name] is one of ''type'', ''nil'', ''schemaLocation'' or ''noNamespaceSchemaLocation''. However, the attribute, ''{1}'' was found. - cvc-type.3.1.2 = cvc-type.3.1.2: Element ''{0}'' is a simple type, so it must have no element information item [children]. + cvc-type.3.1.2 = cvc-type.3.1.2: Element ''{0}'' has the simple type ''{1}'', so it must have no element information item [children]. cvc-type.3.1.3 = cvc-type.3.1.3: The value ''{1}'' of element ''{0}'' is not valid. #schema valid (3.X.3) Modified: xerces/java/trunk/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java URL: http://svn.apache.org/viewvc/xerces/java/trunk/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java?rev=1901562&r1=1901561&r2=1901562&view=diff ============================================================================== --- xerces/java/trunk/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java (original) +++ xerces/java/trunk/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java Thu Jun 2 15:47:52 2022 @@ -3428,10 +3428,11 @@ public class XMLSchemaValidator // 3.1 If the type definition is a simple type definition, then all of the following must be true: if (fCurrentType.getTypeCategory() == XSTypeDefinition.SIMPLE_TYPE) { // 3.1.2 The element information item must have no element information item [children]. - if (fSubElement) - reportSchemaError("cvc-type.3.1.2", new Object[] { element.rawname }); - // 3.1.3 If clause 3.2 of Element Locally Valid (Element) (3.3.4) did not apply, then the normalized value must be valid with respect to the type definition as defined by String Valid (3.14.4). - if (!fNil) { + if (fSubElement) { + reportSchemaError("cvc-type.3.1.2", new Object[] { element.rawname, XS10TypeHelper.getSchemaTypeName(fCurrentType) }); + } + else if (!fNil) { + // 3.1.3 If clause 3.2 of Element Locally Valid (Element) (3.3.4) did not apply, then the normalized value must be valid with respect to the type definition as defined by String Valid (3.14.4). XSSimpleType dv = (XSSimpleType) fCurrentType; try { if (!fNormalizeData || fUnionType) { --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@xerces.apache.org For additional commands, e-mail: commits-h...@xerces.apache.org