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

Evaluation Context of <bind> Computed Expression

From: Tomayko, Ryan <Ryan_Tomayko@stercomm.com>
Date: Wed, 12 Sep 2001 19:23:27 -0400
Message-ID: <5FD6397E455FD4118BAE000629383540014833B9@scidubmsg02.isg.stercomm.com>
To: "'www-forms@w3.org'" <www-forms@w3.org>
When evaluating computed expressions (such as relevant) for a ui control
associated with a bind element, which context should the expression be
evaluated in? The <bind> element's or the control's?

To illustrate the problem, suppose I have the following xform which is a
piece of a purchase order. I want to display repeating line items, but only
if the line item's total (qty * price) is greater than $1000.00.


    <xform:bind id="qty" 
       relevant="po/lineItems/lineItem[total > 1000]"/>

    <xform:bind id="qty2" 
       ref="qty" relevant=".[total > 1000]"/>


<xform:repeat node-set="po/lineItems/lineItem">
  <!-- This one is bound to the first bind element above -->
  <xform:input bind="qty">

  <xform:input bind="qty2">
    <xform:caption>Quantity 2</xform:caption>

Assuming that the repeats node-set returned 10 lineItem elements, what do
you expect would happen with each of the two input elements? The first bind
and input assume that the bind's ref and relevant expressions are evaluated
in the context of the bind element. The second assumes that the these
attributes are evaluated in the context of the control. 

If the bind's ref/relevant is evaluated in the context of the bind (first
example), it becomes impossible to use this syntax when the XPath context
node is not "/". If the bind's ref is evaluated in the context of the
control (second example) then you need a control to evaluate the bind.

Also, if an input and it's associated bind both have a ref attribute, which
takes precedence?

This same question can be applied to the context of namespace declarations.
Do the bind expressions get evaluated with the namespace prefixes defined at
the bind level or the control level?

I apologize if any of these questions are covered in the draft.

- Ryan

Ryan Tomayko <rtomayko@stercomm.com>
Sterling Commerce
ext.  5183
Received on Wednesday, 12 September 2001 19:26:27 UTC

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