RE: Managing Validation Error Messages

Dan,

I think it is the intention that validation reveals the exact elements in the instance
data that violate a rule. These elements then must be mapped back to the corresponding
form control. The form contains all the necessary information to do that. Then, according
to section 4.3.12, an alert event is sent to the form control. Its default processing is to
display an error message to the user. The alert element is available for this. It is up
to the XForms implementation to decide how to present it to the user. If the implementation
is a component, this can be left to its client, who in principle decides on the error reporting
policy. The client simply registers a DOM event handler on the form controls to do it.

I therefore believe all the necessary mechanisms are described in the specification. Personally,
I would always use the alert elements, because end-users will be in contact with the forms.
It makes no sense to confront them with technical validation messages. No matter how
sofisticated XML Schema may be, it will in general not be possible to derive user-friendly
messages from the post-schema-validation infoset. The form author, on the other hand,
knows what the user is expected to enter in a certain form control. He can formulate this
with an end-user-oriented message.

It is worth noting that there is no standard API, to my knowledge, to discover a violating
element during validation. The Xerces parser from Apache, for example, provides the
"http://apache.org/xml/properties/dom/current-element-node" property. In any case,
it is not up to XForms to provide this mechanism. This is a matter of a general validation
API. For Java, for example, the JAXP API should be extended to allow the separation of
the establishment of well-formedness and the validation of a well-formed document
against a DTD, schema or whatever.

Werner.
-- 
Werner Donné  --  Re BVBA
Engelbeekstraat 8
B-3300 Tienen
tel: (+32) 486 425803	e-mail: werner.donne@re.be

Received on Wednesday, 31 July 2002 11:25:07 UTC