Steven to suggest text on reading/writing child nodes of data

Suggestion below. Please check values of error-types. Also: is reading the 
root node so terrible?

A control that reads simpleContent does so according to the kind of node it 
is bound to:
* Element node: all text-node descendants of the element are concatenated, 
and the result is used.
* Attribute node: the string-value of the node is used.
* Text node: the string-value of the node is used.
* The root node: an xforms-binding-error with an error-type of ... is 
dispatched to the control.
* Namespace, processing instruction, and comment node: behavior is 
undefined and implementation-dependent.

Note: binding controls directly to text nodes is permitted, but not 
recommended, since a control may become disabled if a user enters empty 
data. While implementers may allow binding directly to comment or 
processing instruction nodes, it may similarly yield undesirable results.

A control that writes simpleContent does so according to the kind of node 
it is bound to:
* Element node: If the element has child nodes then an xforms-binding-error 
event with an error-type of overwrite-children is dispatched to the 
control; otherwise the string becomes the new content of the element.
* Attribute nodes: The string-value of the attribute is replaced with the 
new value.
* Text node: If the new value is the empty string the text node is 
eliminated; otherwise the text node is replaced with the new value.
* The root node: an xforms-binding-error with an error-type of 
overwrite-root is dispatched to the control.
* Namespace, processing instruction, and comment nodes: behavior is 
undefined and implementation-dependent.

Received on Thursday, 22 May 2025 13:19:06 UTC