- From: Jérôme Nègre <jerome.negre@e-xmlmedia.fr>
- Date: Tue, 8 Jan 2002 17:34:14 +0100
- 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 UTC