W3C home > Mailing lists > Public > www-forms@w3.org > February 2007

Multiple xforms:instance elements vs. relevant="false()"

From: Fennell, Philip <philip.fennell@hp.com>
Date: Wed, 7 Feb 2007 12:51:07 -0000
Message-ID: <C4B3FB61F7970A4391A5C10BAA1C3F0D685233@sdcexc04.emea.cpqcorp.net>
To: <www-forms@w3.org>


I have a scenario where there is a source document (model) and a
rendering (view). I generate an XForm that allows me to both edit the
values of attributes in the source document and see values of attributes
generated in the view. For example, I may define an object in the source
but it has properties that are computed by the viewer.


a) Source and view properties are mutually exclusive.
b) View properties are regarded as read-only.

In these types of situation I see two possible options:

1) Multiple instances.

Create a 'model' xforms:instance and a 'view' xforms:instance in the
same xforms:model. The xforms:bind elements reference the two instances
using the instance(xs:IDREF) function. I believe I'm right in assuming
that I would use the instance() function on the xforms:submission
element's ref attribute to indicate which instance to use (unless the
'model' instance is the first within the xforms:model and therefore the
default instance for submission).

2) relevant = "false()"

Merge the view properties with those of the source element (see note 'a'
above) in a single xforms:instance and then upon their respective
bindings set the 'view' properties to relevant="false()". In this case,
when the form is submitted, I believe the irrelevant nodes will be
removed from the instance that is submitted. All bindings will point to
the same xforms:instance.

Please could I have some 'best practice' guidance as to which option
would be considered more practical/preferable?


Philip Fennell
Received on Wednesday, 7 February 2007 22:39:20 UTC

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