- From: John Boyer <boyerj@ca.ibm.com>
- Date: Mon, 16 Feb 2009 22:41:37 -0800
- To: Erik Bruchez <ebruchez@orbeon.com>
- Cc: Forms WG <public-forms@w3.org>
- Message-ID: <OF416E892A.76775026-ON88257560.0021DEE1-88257560.0024B5ED@ca.ibm.com>
Hi Erik, I think you mentioned the Feb. 3 version only to ensure it was clear you were reading the latest editor draft as opposed to the CR, and not that you read actual diff marked text to suggest something has changed recently regarding src/inline content/resource processing of instance. Nothing has changed recently. So, yes if you put an src attribute on an instance, then it overrides both inline content and a resource attribute, which in turn means that if you use an src attribute, and it fails to resolve, then you get an xforms-link-exception and it's game over. The resource attribute is used on an instance, but if the instance is non-empty, then the resource attribute is ignored, so again you are right that an author would not put a resource attribute on an instance that contained inline content. The resource attribute supports a processing model for documents that admits the save/reload pattern to alter the instance relative to the initially authored instance. The initial form would include this: <instance resource="emptyTemplate.xml"/> If you load the document containing this declaration, the emptyTemplate.xml content will be obtailed as the live instance. Suppose it contains this: <name></name> OK, now suppose the document also contains a UI control like this: <input ref="name"><label>Name:</label></input> And finally suppose you type your name into the input so that the empty template data is changed to this: <name>Erik</name> If this markup is part of a document, e.g. an ODF document, that you want to save to the local disk, then the instance is written with the latest data stored as inline content: <instance resource="emptyTemplate.xml"> <name xmlns="">Erik</name> </instance> And now when you reload the document, the inline content takes precedence over the resource attribute, so the latest data entered by the user before the save operation is preserved. As a final point, note that we could instead have simply said that we use the src attribute but when we have to serialize a document, we would put the inline content into the instance and then remove the src attribute. The is another solution but it is not the better one. There are two problems with it. 1) The resource attribute above (and/or the src attribute) is part of the form template, not part of the content we expect to be mutable by the end-user, so it would break layer encapsulation to modify the logic of the form (e.g. where to get the data template) destroyed by virtue of adding end-user content. An example where this can have a negative effect is a form template digital signature (i.e. XForms application signing). I like to be able to say "sign the whole document except the internal content of the xforms instance elements. This protects the presentation layer, the model layer, the controller layer and not the data layer, which achieves XForms applications signing. It is irritating to have to say sign everything except the content of instance elements... and their src attributes. 2) When the source URI points to a query of some kind that gets the latest data for the form, then I actually do want to use the src attribute and not the resource attribute. However, when serializing the document, it may still be beneficial to write the instance data inline *even though* there is a src attribute. For example, this allows me to create a digital signature over the whole document, including the latest data provided by the end-user. Then, next time the document is loaded, if anybody changed the data pointed to by the src, then that new data written to the inline instance as part of the serialization for signature validation, which makes for a different document than the one that was signed. Hope this helps. Cheers, John M. Boyer, Ph.D. STSM, Interactive Documents and Web 2.0 Applications Chair, W3C Forms Working Group Workplace, Portal and Collaboration Software IBM Victoria Software Lab E-Mail: boyerj@ca.ibm.com Blog: http://www.ibm.com/developerworks/blogs/page/JohnBoyer Blog RSS feed: http://www.ibm.com/developerworks/blogs/rss/JohnBoyer?flavor=rssdw From: Erik Bruchez <ebruchez@orbeon.com> To: Forms WG <public-forms@w3.org> Date: 02/16/2009 07:25 PM Subject: Question about xforms:instance @src/@resource and inline instance All, I seem to be missing something. Checkin the 03 February 2009 version, it seems that XForms 1.1, allows both @src and an inline instance, or an inline instance and @resource, or possibly all three, at the same time. Now I am puzzled as to the reason we need @resource at all, or both an inline instance and @src/@resource. The spec says in "1.5.1 Model and Instance" [1]: "The instance element now has a resource attribute that allows instance data to be obtained from a URI only if the instance does not already contain data. By contrast, the src attribute overrides the inline content in an instance. The resource attribute is more useful in systems that must support save and reload of XForms-based documents." Since an error while handling @src causes form processing to halt, why would anyone put an inline instance then? Similarly, if an inline instance is present, why would anyone put the @resource attribute in, since the inline instance will be used and therefore @resource ignored? -Erik -- Orbeon Forms - Web Forms for the Enterprise Done the Right Way http://www.orbeon.com
Received on Tuesday, 17 February 2009 06:41:51 UTC