enhancements to XML Schema 1.1 assertions run-time error messages
-----------------------------------------------------------------
Key: XERCESJ-1470
URL: https://issues.apache.org/jira/browse/XERCESJ-1470
Project: Xerces2-J
Issue Type: Improvement
Components: XML Schema 1.1 Datatypes, XML Schema 1.1 Structures
Affects Versions: 2.10.0
Reporter: Mukul Gandhi
Assignee: Mukul Gandhi
Priority: Trivial
Fix For: 2.11.0
I committed sometime ago little enhancement to Xerces specific error messages
during XML Schema 1.1 assertions evaluation failure (thought it would be ok to
create a JIRA issue for this). Here are the summary of these changes (explained
with a small example).
instance document [1]:
<x>101</x>
XML Schema 1.1 simpleType definition [2]:
<xs:simpleType>
<xs:restriction base="xs:integer" xmlns:xerces="http://xerces.apache.org">
<xs:assertion test="$value mod 2 = 0" xerces:message="The value must
be divisible by 2. {$value} is not divisible by 2." />
</xs:restriction>
</xs:simpleType>
When the instance document [1] is validated by the simpleType [2] Xerces would
now display an error message like following:
"The value must be divisible by 2. 101 is not divisible by 2."
At run-time the placeholder (a kind of little macro) {$value} will be replaced
by corresponding value from instance document. The placeholder for this purpose
must have a name {$value}. There can be multiple instances of these
placeholders in single assertions message, and all-of them will be replaced by
the value from instance document.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]