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

scope of id() (was: recalculating several models)

From: Micah Dubinko <MDubinko@cardiff.com>
Date: Mon, 7 Jan 2002 11:27:46 -0800
Message-ID: <E840F0B7E6189547BDB91DA8BF2228AB28C0D8@csmail.cardiff.com>
To: 'Jérôme Nègre' <jerome.negre@e-xmlmedia.fr>, www-forms@w3.org
Hi Jérôme,

Good to see such in-depth analysis of XForms!

   <xform:instance id="i1">
   <xform:bind ... calculate="id('i1')/i:dad/i:son1"/>

In this example the function id() would return an empty node-set.


The XPath expressions apply to instance data, not the containing document.
Since the instance data, which is a copy of everything between
<xforms:instance>...</xforms:instance>, doesn't contain an id of "i1",
there's no match on the function id().


P.S. On your broader point about recalculation dependencies, let's ask our
calculation expert, John Boyer.

P.P.S. If the recalculate event applied to all models, to which element
would the event be targeted?

Thanks! -m

-----Original Message-----
From: Jérôme Nègre [mailto:jerome.negre@e-xmlmedia.fr]
Sent: Monday, January 07, 2002 2:48 AM
To: www-forms@w3.org
Subject: recalculating several models


In the current working draft, events xforms:recalculate and xform:revalidate
are dispatched to element model. This implies that recalculation and
revalidation are done a model after another (as described in chapter

But, for some kind of dependencies, such as in the following example, this
is not possible:

<html xml:...="...">

  <xform:model id="m1">
   <xform:instance id="i1">
   <xform:bind ref="i:dad/i:son2" calculate="id('i2')/i:mom/i:daughter"/>

  <xform:model id="m2">
   <xform:instance id="i2">
   <xform:bind ref="i:mom/i:daughter" calculate="id('i1')/i:dad/i:son1"/>

  <xform:input model="m1" ref="i:dad/i:son1">
   <xform:caption>Change me</xform:caption>

The recalculation must happen in the following order :
1/ The user changes the value of id('i1')/i:dad/i:soon1 via the input
2/ id('i2')/i:mom/i:daughter is recalculated.
3/ id('i1')/i:dad/i:son2 is recalculated.

In order to have this behaviour, I think recalculation/revalidation should
be made global, and their corresponding events should be dispatched to
either the root element of the document, or to a new element containing all
the models.

Am I missing something ?

Jérôme Nègre
Received on Monday, 7 January 2002 14:30:03 UTC

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