Re: Invitation to contribute examples

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 UTC