Re: A forms-lite straw man

On Wed, 6 Sep 2006, Lachlan Hunt wrote:

> Having said that, though, I may be interested in merging the two 
> in a way that doesn't involve retrofitting the syntax of one into 
> the other.  I'm *still* waiting for John Boyer to explain his 
> intriguing binding idea that he briefly mentioned earlier, which 
> seemed to do just that.

You ignored the ref attribute as an XPath expression identifying
the data. In principle, we could have the name attribute for
the case of a simple name, and ref for binding to structured data.

Another key difference is that in WebForms 2.0 the data is owned by 
the field, thus a field can state which forms it belongs to. It is 
better software engineering for the field to act as a view onto the 
data. Decoupling the view and the data makes it easier to support 
structured data and to describe calculations for derived fields and 
other purposes.

>>   verify: an XPath expression evaluating to a boolean
>
> I don't understand the purpose of that.

If the expression evaluates to false, the field is considered to
be invalid. I got the name wrong and it should have been called
validate. The expression could act over just the field's value,
but it could also refer to the values of other fields. It could
even call out to a function defined as part of a web page script.

>>   required: an XPath expression evaluating to a boolean
>
> WF2 provides a boolean required attribute.
>
> <input ... required="required"> or simply <input ... required>
> http://www.whatwg.org/specs/web-forms/current-work/#the-required
>
> I don't understand what benefit the XPath expression would provide.

WF2 essentially limits to boolean literals, and you cannot describe 
the conditions under which a field is required. For example, your 
parent's name might be required if your age is under 15.

>>   hint, help and alert: corresponding to XForms elements
>>             (use HTML4 label element for the label text)
>
> The title attribute can be used to provide a hint.  A help element may
> be a useful addition, though it can be provided already using <a
> href="#help" rel="help">.  I'm don't about the alert element.

I covered HTML work arounds for label, hint and help in an earlier
email. I still think that there might be benefits in providing
a declarative way to identify hint and help text as such. HTML
currently has no good way to represent the text for when a field
is invalid. This is something most people deal with via scripts.

>> Output fields have the following attribute
>>
>>   value: an XPath expression evaluating to a string
>
> The WF2 output element uses a JavaScript expression to evaluate
> to a string.  What benefit does an XPath expression provide

It is more declarative than calling out to a JavaScript function.
It is easy to learn and these days more and more developers are 
becoming familiar with XPath, e.g. for use with XSLT in server
side processing. It further provides a smooth stepping stone to
more complex forms written with the full power of XForms.

  Dave Raggett <dsr@w3.org>  W3C lead for multimodal interaction
  http://www.w3.org/People/Raggett +44 1225 866240 (or 867351)

Received on Tuesday, 5 September 2006 16:34:49 UTC