Re: ACTION-2312: Devise text for submission using @value

Relevant text follows below.


One question. 


the xforms-submit-serialize event is dispatched to allow some action to 
mess with the to-be serialised data (I never use it, and I forget the use 
case).


I'm assuming we don't want to use in the case of submission with @value, 
but I may be wrong.


Steven


=================


11.1 The submission Element
The attributes of submission can be divided into three groups, describing 
what is to be submitted, how it is to be submitted, and what to do with the 
result.


Common Attributes: Common


Special Attributes:


What to submit:


Single Item Binding
Optional binding that selects the data to be submitted: the node and all 
its descendants are selected. The default is "/".


value
Optional expression, overriding the single item binding, that calculates a 
value representing the data to be submitted. If this attribute is present, 
the relevant, nonrelevant, validate and serialization attributes are 
ignored.


=================


11.2 Submission Processing


In brief, data is selected, checked for validity as necessary, serialized 
in the required form, and sent to the server. The server sends a response, 
possibly accompanied by some data which is then dealt with appropriately.


[...]


11.2.1 Selecting and Validating the Submission Data
If the serialization attribute value is "none", no data is selected.


Otherwise, an update is done if necessary.


* If the value attribute is present, it is evaluated and converted to a 
string.
* If the value attribute is not present, the binding attributes of 
submission are  
evaluated; if the result is the empty sequence or an item other than an 
element or an instance document root node, submission fails with no-data.


A copy of the evaluated node and its descendent nodes are selected. 
Non-relevant nodes are either deselected, or made empty, according to the 
value of the nonrelevant attribute, or the deprecated relevant attribute. 
If no nodes remain, submission fails with no-relevant-data.


If the attribute validate is true, whether by default or declaration, and 
any selected instance data node is invalid, submission fails with 
validation-error.


==============


11.2.2 Serializing the Data
The submission method is obtained from the method attribute if present, 
otherwise from the first method child element if any, and otherwise is 
"get".


The submission resource is obtained from the resource attribute if present, 
otherwise from the deprecated action attribute if present, and otherwise 
from the first resource child element, if any; otherwise submission fails 
with resource-error.


If the value of the submission resource is an absolute URI it is used as 
the submission URI; otherwise (it is a relative URI) the submission URI is 
constructed by combining the relevant parts of the value of location-uri() 
and the submission resource.


The protocol to be used is determined from the submission URI.


The serialized data is obtained:


If the serialization attribute value is "none", then the empty string is 
used.
Otherwise, if the value attribute was present, then the string obtained 
from evaluating that is used.
Otherwise, the xforms-submit-serialize event is dispatched to the 
submission element; if the submission-body property of the event is changed 
from the initial value of empty string, then its content is used.
Otherwise, the default serialization format is determined according to the 
rules stated in Submission Protocols, based on the method and the protocol; 
if the default is application/xml and the serialization attribute contains 
a value, that value is used; otherwise the default format is used; the 
selected data is then serialized in that format according to the rules 
stated in Serialization Formats.


==============

Received on Friday, 4 February 2022 13:21:49 UTC