W3C home > Mailing lists > Public > www-forms@w3.org > July 2002

RE: Managing Validation Error Messages

From: Werner Donné <werner.donne@re.be>
Date: Wed, 31 Jul 2002 17:24:48 +0200
Message-ID: <3D480140.90504@re.be>
To: www-forms@w3.org

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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Saturday, 10 March 2012 06:21:51 GMT