- From: Tomayko, Ryan <Ryan_Tomayko@stercomm.com>
- Date: Fri, 2 Aug 2002 10:42:26 -0400
- To: www-forms@w3.org
- Cc: "'Dan Dennedy'" <DDennedy@digitalbang.com>
<< Error messages per validation rule can be provided with the XML Schema appinfo element, which resides in an annotation element. Appinfo is meant for automatic processing. In XForms error messages are bound to form controls because a form control is the unit of presentation. The binding expression of a form control pertains to only one node in the instance data. So how could something a user has entered through one control cause multiple rules to be violated? Wouldn't that indicate an error in the structure of the instance data? If so, it is a bug in the form. The XForms alert elements are not indented to provide feedback about bugs. >> I think we may be talking around each other. Sorry, I'll start from the beginning. I jumped into my last message hastily. You can have multiple bind elements associated with a single node and thus have multiple isValid (constraint) rules associated with a single node. For instance. <xf:model> <xf:instance> <foo xmlns=""> <bar/> </foo> </xf:instance> <xf:bind ref="foo/bar" isValid="rule1"/> <xf:bind ref="foo/bar" isValid="rule2"/> </xf:model> This allows multiple isValid constraints to be placed on a single node in the instance doc. The processor must assume that if any of the isValid constraints returns false for a given node, the node is invalid. If, say, the second isValid constraints returns true when the first returned false, the node is still invalid. An isValid returning false invalidates the node, an isValid returning true does not necessarily validate the node unless all isValid constraints associated with a node return true. As an example, let's say I wanted to validate that a field met the following conditions using multiple isValid constraints. a.) A Valid XXX-XXX-XXXX phone number (e.g. all numerics separated by dashes). b.) Has an area code that starts with 555. c.) Ends with a 7. Now, for clarity to the user, I would like to display an alert message consistent with the validation rule that was broken as opposed to displaying a single message that stated all the rules that may or may not have been broken. We've seen single alert messages get up over a paragraph which forces the user to go back and check their input against multiple problems with the data where maybe only a sentence out of the paragraph is specific to their input. That is considered unacceptable by some and at the very least inelegant. I hope this clears up any miscommunication on my part regarding this topic. - Ryan -----Original Message----- From: Werner Donné [mailto:werner.donne@re.be] Sent: Friday, August 02, 2002 8:42 AM To: Tomayko, Ryan Cc: 'Dan Dennedy'; www-forms@w3.org Subject: Re: Managing Validation Error Messages Tomayko, Ryan wrote: > I want to chime in on this as well. This is one of the greater > shortcomings of the spec IMO. It is a shame that validation rules to > validation messages is a many to one relationship. It should be > possible to provide a descriptive error message for each validation > rule. > Error messages per validation rule can be provided with the XML Schema appinfo element, which resides in an annotation element. Appinfo is meant for automatic processing. In XForms error messages are bound to form controls because a form control is the unit of presentation. The binding expression of a form control pertains to only one node in the instance data. So how could something a user has entered through one control cause multiple rules to be violated? Wouldn't that indicate an error in the structure of the instance data? If so, it is a bug in the form. The XForms alert elements are not indented to provide feedback about bugs. > I also feel that this might fall into a larger hole of > data/presentation debate [1]. Should [in]validation messages really be > part of the presentation layer? While the validation messages will at > some point be presented to the user, the invalidation occurs at the > data/logic level. It seems to make more sense to attach a meaningful > description to the validation error when the node is found to be > invalid. The control is not really what's invalid, the node the > control is bound to is invalid. That statement can end up being a > slippery slope however as you might apply the same idea to the hint > and help common controls. > > - Ryan Tomayko > > [1] See Post from Plechsmíd Martin [Martin.Plechsmid@merlin.cz] Re: > XForms Schema Attached 7/25/2002 > My opinion about validation messages is described in http://lists.w3.org/Archives/Public/www-forms/2002Jul/0037.html I would like to add to this that the model of a form is part of the presentation layer. The information it describes is presentation information. The part of the presentation layer which resides on the server might have to do transformations on a message before sending it to the business layer. In most cases this is not needed of course and the merits for this are XForms'. Werner. -- Werner Donné -- Re BVBA Engelbeekstraat 8 B-3300 Tienen tel: (+32) 486 425803 e-mail: werner.donne@re.be
Received on Friday, 2 August 2002 10:50:55 UTC