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

Re: Invitation to contribute examples

From: Jérôme Nègre <jerome.negre@e-xmlmedia.fr>
Date: Tue, 8 Jan 2002 17:34:14 +0100
Message-ID: <01d401c19862$54b85cb0$630aa8c0@fischer>
To: "Steven Pemberton" <steven.pemberton@cwi.nl>, <www-forms@w3.org>
Here's a little example showing that XForms can handle dependencies between
several instances:

<html>
 <head>

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

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

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

Function instance() being used to retrieve the instance node of a given
model.

Jérôme Nègre

PS : As you might have seen, this document doesn't work with the last draft,
but I'm sure it will with the following one ;o)
Received on Tuesday, 8 January 2002 11:34:53 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Saturday, 10 March 2012 06:21:50 GMT