W3C home > Mailing lists > Public > www-forms@w3.org > November 2008

Re: saving the data of an xform

From: John Boyer <boyerj@ca.ibm.com>
Date: Tue, 25 Nov 2008 15:54:13 -0800
To: "Jabba Laci" <jabba.laci@gmail.com>
Cc: xforms <www-forms@w3.org>
Message-ID: <OF2F6C21C2.239C24F8-ON8825750C.0082E39B-8825750C.0083511A@ca.ibm.com>
Hi Jabba,

You can dynamically change the URL that the xforms submission connects to.

In XForms 1.0, the "action" attribute only allowed static URLs.
In XForms 1.1, the "action" attribute is still supported but deprecated in 
favor of using a "resource" attribute.  The reason we renamed the 
attribute is because it made it possible for us to overload the attribute 
with a child element of the same name.

You need the "resource" child element, which allows you to overload the 
URL with a value that is dynamically computed on the client side.  This 
was so urgently needed, that pretty much all XForms implementations have 
supported this feature for years now, regardless of the current W3C 
process phase of XForms 1.1.

An example of the markup is here: 

Note, though, that you can do *any* XPath expression in the value 
attribute to compute *any* part of the URI using any number of instance 
data nodes.

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: 

"Jabba Laci" <jabba.laci@gmail.com>
xforms <www-forms@w3.org>
11/25/2008 03:48 PM
saving the data of an xform


I'd have another question: how to save the collected data of an xform?

Currently, I'm making experiments with the XML DB eXist, because such
a database seems to be the easiest way to store XML data. One problem
is that if I specify the name of the output file in the xform (e.g.
http://localhost:8080/exist/rest/db/data.xml), this file will be
overwritten each time the form is sent. That is, the output file
should change each time. One idea is to add a timestamp suffix to the
file name, making it unique. Can it be done on the client side? Or
should it be done through a servlet?

Another thing that troubles me is that if I save the data from an
xform directly to eXist, there is no feedback whether the storage was
successful or not. Because of this reason I'd prefer to control the
saving procedure from a servlet. In that case generating a unique
filename is not a problem.

Or what is the preferred way for this?


Received on Tuesday, 25 November 2008 23:55:13 UTC

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