Note 2 on XForms 1.1 computational dependency definition. Short-circuting

Dear WG,

I mentioned in the postscript to the previous posting that the definition 
of the computational reference in XForms 1.1 has another problem. Namely, 
it says : 

7.3 ...
An XPath expression references a node of instance data if the node is 
selected during the evaluation of the expression...

At the same time, XPath 1.0 section 3.4, in fact, mandates:
...
An or expression is evaluated by evaluating each operand and converting 
its value to a boolean as if by a call to the boolean function. The result 
is true if either value is true and false otherwise. The right operand is 
not evaluated if the left operand evaluates to true.
An and expression is evaluated by evaluating each operand and converting 
its value to a boolean as if by a call to the boolean function. The result 
is true if both values are true and false otherwise. The right operand is 
not evaluated if the left operand evaluates to false.
This behaviour (that is often called short-circuiting) throws a wrench in 
the reference definition above because the nodes referred to by the 'right 
operand' of the expressions being evaluated would not contribute the 
references to the XForms 1.1 model bindings!
Also note that in our implementation experience XPath engines (such as 
Xalan-C, for example) will also forgo the full evaluation (as if by a 
string() function) of some parameters of the built-in XPath functions. For 
instance, if the first parameter of the substring() function will evaluate 
to an empty string the second and the third parameter will not be fully 
evaluated (to a string).
The IBM Forms 4.0 implementation deals with the problem by extending the 
XPath engine with a special 'reference collection' evaluation option which 
suppresses short-circuiting in all of such cases in order to collect the 
complete reference set during the processing of model binds.
I would like to propose that XForms 1.1 definition of reference be amended 
to avoid this particular confusion and possibly acknowledge the 
'short-circuiting during evaluation problem' for the implementers benefit.
Regards,
Vlad Trakhtenberg.

Received on Monday, 24 January 2011 04:58:08 UTC