We recommend using the instance to store this kind of information. And if you want to use the Web application controller <action when="...">, this is also the only way, as the XPath expression is executed on the XForms instance.
But I understand your concern: initially the instance only contains business data. Say you are creating a wizard for an application form. Then your instance contains elements to hold the first name, last name, address, etc. Now when you add an element just to know which button the user selected (/wbconfig/message), you are mixing in the same document application-data with business-data.
To keep everything in the instance (benefit: simplicity and coherence) but still differentiate the application-data from the business-data, you can use a namespace for the application-data. For example with an instance like:
<loan-application xmlns:app="http://www.wrappedapps.com/oxf "> <app:message/> <first-name/> <last-name/> <address/> </loan-application>
This way, the difference between the application-data and business-data in the instance is clear. At the end of the process, it is also easy to remove the application-data with a simple stylesheet before you send it to a Web service or store it in a database.
Alex
Greg Hess wrote:
Hi All,
I am processing an XML instance via xforms. The XML instance does not know of the forms/admin process in which it is being edited.
The examples of processing a form that I have studied use an <action when=”/form/element = ‘some value’”> to test the current action being performed and then supply the appropriate result pages. In this case the XML instance contains an element to signal processing instructions. My example below:
<page id="self-serve/app-admin" path-info="/self-serve/app-admin"
xforms="oxf:/self-serve/app-admin/xform-model.xpl"
view="oxf:/self-serve/app-admin/xform-view.xsl">
<action id="next" when="/wbconfig/message = 'preview'">
<result id="valid" page="self-serve/preview">
<xu:update select="/" xmlns:xu="http://www.xmldb.org/xupdate">
<xu:copy-of select="document('#instance')/*"/>
</xu:update>
</result>
</action>
</page>
In this example I test the value of “/wbconfig/message” in the action to determine the result. Is their any other way to determine if I am processing the initial load of a form or the form submit without altering the XML instance?
Thanks,
Greg Hess
*Software Engineer*
*Wrapped Apps Corporation*
275 Michael Cowpland Dr.
Suite 201
Ottawa, Ontario
K2M 2G2
Tel: (613) 591 -7552
Fax: (613) 591-0523
1 (877) 388-6742
* <http://www.wrappedapps.com/>*
------------------------------------------------------------------------
_______________________________________________ oxf-users mailing list [EMAIL PROTECTED] http://mail.orbeon.com/mailman/listinfo/oxf-users
_______________________________________________ oxf-users mailing list [EMAIL PROTECTED] http://mail.orbeon.com/mailman/listinfo/oxf-users
