Test for using submission to validate data

Step 4 of xforms-submit processing performs validation, producing a 
validation-error if any data to be submitted is invalid.

Step 5 obtains the resource URI of the submission, and produces a 
resource-error if the resource is not specified.

This sequence of behaviors allows an author to use a resource-less 
submission to perform data validation without the risk of a server 
submission, which we make note of in the spec [1].

[1] http://www.w3.org/MarkUp/Forms/specs/XForms1.1/index-diff.html

The attached should be added as a test to ensure the submission processing 
happens in the specified order.

The data contains a required but empty node that is also non-relevant.
The first submission turns off relevance pruning, so the required but 
empty node should flag a validation-error.
The second submission uses the default of relevance pruning, so the data 
is valid, but the submission has no resource, which should produce a 
resource-error.
By testing the error-type, the author can find out if data is invalid. 
Further, by using @ref on the submission, one can ask the question of any 
part of the data.



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

Received on Wednesday, 25 February 2009 02:43:07 UTC