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: 
http://www.w3.org/MarkUp/Forms/specs/XForms1.1/index-all.html#submit-resource-elem

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.

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:
"Jabba Laci" <jabba.laci@gmail.com>
To:
xforms <www-forms@w3.org>
Date:
11/25/2008 03:48 PM
Subject:
saving the data of an xform




Hi,

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?

Thanks,

Laszlo
Received on Tuesday, 25 November 2008 23:55:13 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Saturday, 10 March 2012 06:22:14 GMT