XML events: One event handler, multiple events

Mark, Shane:

Following a discussion in this thread [1], I have an action item [2]
from the XForms Working Group to contact you to suggest an enhancement
to the ev:event attribute in order to allow registering an event
handler for multiple events without resorting to using an additional
<ev:listener> element.

As far as we could tell, the only way to do this purely with the XML
syntax today is to write (here in the context of XForms):

    <xf:action ev:event="some-event" id="handler">
      ...
    </xf:action>
    <ev:listener event="some-other-event" handler="#handler"/>

The suggestion is to enhance the ev:event attribute to support a list
of events rather than a single event. You would then write instead:

    <xf:action ev:event="some-event some-other-event">
      ...
    </xf:action>

This would be a much more concise syntax which would not require form
authors to learn ev:listener. The result is also quite easy to read.

There are obviously precedents for using lists of space-separated
names, in particular the following two come to mind immediately:

* List of CSS classes in HTML @class attributes
* List of XML schemas on xforms:model/@schema

Note that [1] discusses a slightly more complex case where the event
handler is attached to two different observers. The solution above
would probably not work in this case, although a similar suggestion
could be made for the ev:observer attribute:

    <xf:action ev:event="some-event" ev:observer="observer1 observer2">
      ...
    </xf:action>

What is the best way to have this suggestion duly taken into account
by the people in charge of XML Events? Is this email sufficient?

Thanks,

-Erik

[1] http://lists.w3.org/Archives/Public/www-forms/2007Apr/0042.html
[2] 
http://lists.w3.org/Archives/Public/public-forms/2007May/att-0058/20070516-2.html#ACTION5

-- 
Orbeon Forms - Web Forms for the Enterprise Done the Right Way
http://www.orbeon.com/

Received on Tuesday, 17 July 2007 10:52:55 UTC