W3C home > Mailing lists > Public > www-forms@w3.org > October 2001

RE: recalculation sequence algorithm

From: John Boyer <JBoyer@PureEdge.com>
Date: Wed, 10 Oct 2001 10:39:26 -0700
Message-ID: <7874BFCCD289A645B5CE3935769F0B520C348D@tigger.PureEdge.com>
To: (wrong string) érôme Nègre" <jerome.negre@ecl2000.ec-lyon.fr>, <www-forms@w3.org>

Hi Jérôme,

It is important to note that there is a difference between 'vertex' and
'XML node in instance data'.  A vertex is created for each model item
and model item property, so you will have vertices to represent the
content (text value), readOnly, relevant, required and isValid state of
a given XML node of instance data.

In your example, isvalid="number(.) &lt; sum(../price)", the
subexpression number(.) does not cause the vertex for the 'isValid'
property of the instance node to refer to itself but rather to the
vertex representing the content of the instance node.

One of the tweaks we will be making soon to clear this up is to add a
'type' member to the data structure for a vertex because one needs a
pointer not only to the instance node but also an indication of what
aspect of the instance node the vertex was representing.

Back when I didn't know that the group wanted to bind to attributes in
instance data, I thought that model item properties would be represented
as attributes in the markup of the instance data such that the
instanceNode pointer would've been enough without an extra type
indicator.  I've since learned more about it (at the last FtF), but the
spec hasn't been updated yet.

Also, I would point out that even though your example does not contain a
self-reference, it does appear that the explicit allowance for
self-reference in the first version of the recalculation algorithm that
I submitted to the group was inadvertently edited out in the version
that made it to the spec.  I would like to be able to do things like

	calculate="if(string(.)="", some calculation, string(.))"

which means roughly "if my value is empty, then perform some calculation
to give me a value, otherwise retain my current value".  Another handy
calculation is

	calculate="if(some condition happens, number(.)+1, number(.))"

which increments the value of some node every time some condition
happens.  In order to do these things, the depList should exclude
references to the vertex containing the depList.  I'll speak to the
editors about making sure the right tweaks are made, and thanks for
looking in detail at the calculation algorithm.

John Boyer
Senior Product Architect
PureEdge Solutions Inc.


If I understand correctly chapter 11.4.5, the following model item
is invalid :

isvalid="number(.) &lt; sum(../price)"

According to §, inDegree must be 0 for a vertex to be
but since the xapth expression uses ".", it's inDegree  will never go

So, is this model item property really invalid, should the algorithm be
changed, or am I missing something ?

Jérôme Nègre

PS : I think the algorithm is correct only for "calculate"
Received on Wednesday, 10 October 2001 13:40:04 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:36:05 UTC