Author: mukulg
Date: Sun Mar 20 06:16:59 2011
New Revision: 1083370
URL: http://svn.apache.org/viewvc?rev=1083370&view=rev
Log:
changing assertions failure error codes a bit (making them in line with
recommendations from the spec).
we might also change assertions error codes for simpleType with variety atomic
and list (i.e making them of flavor cvc-assertions-valid instead of the current
cvc-assertion.3.13.4.1). i might work on this a bit later.
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/XMLAssertPsychopathXPath2Impl.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=1083370&r1=1083369&r2=1083370&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
Sun Mar 20 06:16:59 2011
@@ -105,11 +105,11 @@
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.3 = cvc-type.3.1.3: The value ''{1}'' of element ''{0}''
is not valid.
- cvc-assertion.3.13.4.1 = cvc-assertion.3.13.4.1: Assertion evaluation
(''{1}'') for element ''{0}'' with type ''{2}'' did not succeed. {3}
- cvc-assertion.4.3.15.3 = cvc-assertion.4.3.15.3: Assertion evaluation
(''{1}'') for element ''{0}'' with type ''{2}'' did not succeed (undefined
context). {3}
- cvc-assertion.union-elem.3.13.4.1 = cvc-assertion.union-elem.3.13.4.1:
Value ''{0}'' is not facet-valid with respect to the specified assertions, on
type ''{2}'' on element ''{1}''.
- cvc-assertion.union-attr.3.13.4.1 = cvc-assertion.union-attr.3.13.4.1:
Value ''{0}'' is not facet-valid with respect to the specified assertions, on
type ''{3}'' on attribute ''{2}'/@'{1}''.
- cvc-assertion.failure = cvc-assertion.failure: {0} {1}
+ cvc-assertion.3.13.4.1 = cvc-assertion.3.13.4.1: Assertion evaluation
(''{1}'') for element ''{0}'' with type ''{2}'' did not succeed. {3}
+ cvc-assertion.3.13.4.1-failure-mesg =
cvc-assertion.3.13.4.1-failure-mesg: {0} {1}
+ cvc-assertions-valid-context = cvc-assertions-valid-context: Assertion
evaluation (''{1}'') for element ''{0}'' with type ''{2}'' did not succeed
(undefined context). {3}
+ cvc-assertions-valid-union-elem = cvc-assertions-valid-union-elem:
Value ''{0}'' is not facet-valid with respect to the specified assertions, on
type ''{2}'' on element ''{1}''.
+ cvc-assertions-valid-union-attr = cvc-assertions-valid-union-attr:
Value ''{0}'' is not facet-valid with respect to the specified assertions, on
type ''{3}'' on attribute ''{2}'/@'{1}''.
cvc-xpath.3.13.4.2a = cvc-xpath.3.13.4.2a: Assertion XPath expression
(''{0}'') on the schema type ''{1}'' couldn''t compile successfully.
cvc-xpath.3.13.4.2b = cvc-xpath.3.13.4.2b: Assertion XPath expression
(''{0}'') on the schema type ''{1}'' is invalid. An assert XPath expression
cannot begin with / or //, since an assert tree is rooted at a parentless
element.
Modified:
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLAssertPsychopathXPath2Impl.java
URL:
http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLAssertPsychopathXPath2Impl.java?rev=1083370&r1=1083369&r2=1083370&view=diff
==============================================================================
---
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLAssertPsychopathXPath2Impl.java
(original)
+++
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLAssertPsychopathXPath2Impl.java
Sun Mar 20 06:16:59 2011
@@ -551,11 +551,11 @@ public class XMLAssertPsychopathXPath2Im
isValueValid = false;
if (assertImpl.getAttrName() == null) {
// assertion evaluation was for an element
-
fXmlSchemaValidator.reportSchemaError("cvc-assertion.union-elem.3.13.4.1", new
Object[] {value, element.rawname,
((XSSimpleTypeDecl)simpleTypeDefn).getTypeName()});
+
fXmlSchemaValidator.reportSchemaError("cvc-assertions-valid-union-elem", new
Object[] {value, element.rawname,
((XSSimpleTypeDecl)simpleTypeDefn).getTypeName()});
}
else {
// assertion evaluation was for an attribute
-
fXmlSchemaValidator.reportSchemaError("cvc-assertion.union-attr.3.13.4.1", new
Object[] {value, assertImpl.getAttrName(), element.rawname,
((XSSimpleTypeDecl)simpleTypeDefn).getTypeName()});
+
fXmlSchemaValidator.reportSchemaError("cvc-assertions-valid-union-attr", new
Object[] {value, assertImpl.getAttrName(), element.rawname,
((XSSimpleTypeDecl)simpleTypeDefn).getTypeName()});
}
fXmlSchemaValidator.reportSchemaError("cvc-datatype-valid.1.2.3", new Object[]
{value, ((XSSimpleTypeDecl)simpleTypeDefn).getTypeName()});
}
@@ -697,7 +697,7 @@ public class XMLAssertPsychopathXPath2Im
catch (DynamicError ex) {
if (ex.code().equals("XPDY0002")) {
// ref: http://www.w3.org/TR/xpath20/#eval_context
- assertionError = new AssertionError("cvc-assertion.4.3.15.3",
element, assertImpl, value, isList);
+ assertionError = new
AssertionError("cvc-assertions-valid-context", element, assertImpl, value,
isList);
}
else {
assertionError = new AssertionError("cvc-assertion.3.13.4.1",
element, assertImpl, value, isList);
@@ -977,13 +977,13 @@ public class XMLAssertPsychopathXPath2Im
if (!message.endsWith(".")) {
message = message + ".";
}
- if (key.equals("cvc-assertion.4.3.15.3")) {
+ if (key.equals("cvc-assertions-valid-context")) {
message = "Assertion failed (undefined context) for schema type
'" + typeNameStrAnnotation + "'. " + message;
}
else {
message = "Assertion failed for schema type '" +
typeNameStrAnnotation + "'. " + message;
}
- fXmlSchemaValidator.reportSchemaError("cvc-assertion.failure", new
Object[] {message, listAssertErrMessage});
+
fXmlSchemaValidator.reportSchemaError("cvc-assertion.3.13.4.1-failure-mesg",
new Object[] {message, listAssertErrMessage});
}
else {
fXmlSchemaValidator.reportSchemaError(key, new Object[]
{elemErrorAnnotation, assertImpl.getTest().getXPath().toString(),
typeNameStrAnnotation, listAssertErrMessage});
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]