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

Re: evaluation context contradiction

From: Roland Merrick <roland_merrick@uk.ibm.com>
Date: Wed, 11 Dec 2002 15:19:42 +0000
To: Paul Butcher <Paul.Butcher@x-port.net>
Cc: "'www-forms@w3.org'" <www-forms@w3.org>, w3c-forms@w3.org, <www-forms-editor@w3.org>
Message-ID: <OF4CCABF77.558B7186-ON80256C8C.0053B015@portsmouth.uk.ibm.com>
Greetings Paul, your are correct in your observation that there is a 
contradiction regarding evaluation context. You are also correct to assume 
that (a) is the correct definition. We'll change the spec to correct this. 

Regards, Roland

Paul Butcher <Paul.Butcher@x-port.net>
Sent by: www-forms-request@w3.org
03/12/2002 16:00

        To:     "'www-forms@w3.org'" <www-forms@w3.org>
        Subject:        evaluation context contradiction


There seems to be a contradiction in the current XForms spec regarding the
evaluation context for XPath expressions in model item properties. 
the following two excerpts:

(a) http://www.w3.org/TR/2002/CR-xforms-20021112/slice4.html#evt-recalculate

When it is time to recalculate a compute, the XPath expression is 
in the context of the instance node whose value or model item property is
associated with the compute.

(b) http://www.w3.org/TR/2002/CR-xforms-20021112/slice7.html#expr-eval
Point 4 states:
The context node for computed expressions (occurring on element bind) is
the first node of the node-set returned from the binding expression in the
nodeset attribute on the same element.

Both of the rules define different context nodes for the evaluation of 
in model item property attributes.

The problem:

Given the following model definition:
<xf:model id="m1">
<y>a very, very long string indeed</y>
<y>short string</y>
<xf:bind nodeset="y" constraint="string-length(.) &lt; 15" />

And the following two elements:

<xf:output model="m1" ref="y[1]" id="o1" />
<xf:output model="m1" ref="y[2]" id="o2" />

If the rule at (a) above is applied, both outputs would be marked as 
at the start, until the content of the first <y> element is sufficiently

If the rule at (b) above is applied, then output "o1" would be marked as
invalid, and the output "o2" valid.

If they are both correct, then both outputs would be marked as invalid 
a recalculate is forced, at which point the output "o2" would become 
However, since "xforms-recalculate" occurs during 
processing, the rule at (b) is redundant, because there is no situation in
which a computed expression is evaluated outside the processing of

For the next version of Formsplayer, we have assumed that (a) is the 
behaviour, that the context node for model item properties is the node 
which the property is associated.

Paul Butcher
FormsPlayer Lead Programmer
x-port.net Ltd.
4 Pear Tree Court

Try our XForms plug-in for IE
at http://www.FormsPlayer.com/
Received on Wednesday, 11 December 2002 10:20:17 UTC

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