W3C home > Mailing lists > Public > www-forms@w3.org > December 2006

Re: Styling based on instance data

From: Mark Birbeck <mark.birbeck@x-port.net>
Date: Sun, 17 Dec 2006 12:02:17 +0000
Message-ID: <640dd5060612170402u4e8db1ebo5eef72a8d9265bfc@mail.gmail.com>
To: www-forms <www-forms@w3.org>, www-forms-request@w3.org

Hi Leigh,

> Mark,
> The validation and schema description issues of the mip: namespace seem
> troublesome.
> What do you think about using child elements of bind instead of
> overloading the attribute namespace?
> Using the existing pattern where the IDREF attribute has the same name
> as the element holding the ID, we might get something like this:
>
> <xf:state id="overdue" />
>
> <xf:bind nodeset="books/toread/book">
>   <xf:xyz state="overdue" constraint="..." />
> </xf:bind>

I quite like that. :)


> Unfortunately this leaves the unnamed element xyz, and nothing springs
> to mind.

Indeed. No inspiration this end.


> Or, perhaps with a nod to Mozilla's custom data types [1], we might
> consider a way to declare pseudo-attributes to be added to the InfoSet
> of controls bound to nodes:
>
> [...]

Yes, I agree. It's something I wrote about a while ago, calling it
"dynamic infosets":

  <http://internet-apps.blogspot.com/2005/04/css-xforms-dependency-engine-and.html>


One thing on this whole discussion; the other side of this is just as
important, which is the generation of events. An interesting example
came up the other day.

Say you had some XML data that told you the time of the next trains
from your local train station, and you just read the data every ten
minutes or so. Also, say that you have a 10 minute walk to the
station, and that you want to get home from work by 7pm. Now that's an
easy calculation, with the advantage that if your train is delayed you
don't need to leave the office too early. But the question is _when_
do we perform that calculation?

In current XForms (and to be fair, just about any other programming
language you can think of) we'd have to run the calculation on the 10
minute data load. But that doesn't seem correct architecturally, since
really you want the loading of the data and actions performed when the
data is set to a certain value to be independent of each other.

The declarative answer would be to declare one of our super-duper
dynamic MIPs, with the calculation for what time we have to leave as a
condition, and then we'll receive an event when we should get moving.
The user interface listening for this event can then do something with
that event like show a message, speak to you, sound an alarm, etc.

Essentially what we're doing is saying that the data is a black box;
it has a dependency graph and so on, and it knows when to perform
calculations to keep the data up to date. All we need is for this
black box to 'externalise' the knowledge it has about the data, as
CSS, as events and as states.

(The latter we don't currently have, but we have talked before about
being able to determine if some data is relvant or read-only by using
an XPath function.)

Regards,

Mark


-- 
Mark Birbeck
CEO
x-port.net Ltd.

e: Mark.Birbeck@x-port.net
t: +44 (0) 20 7689 9232
w: http://www.formsPlayer.com/
b: http://internet-apps.blogspot.com/

Download our XForms processor from
http://www.formsPlayer.com/
Received on Sunday, 17 December 2006 12:02:27 GMT

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