Error events xforms-*-error and their error-types

Introduction

The purpose of this document is to identify all error events, and the context that is supplied with the event, and in particular, whether there is an error-type included with the event (in my opinion there should be: xforms-binding-error is a big misser here).

Each entry is for one error event (so the first is for xforms-binding-error), and begins with the available context items; If an event has an error-type then all values that are mentioned in the spec are listed for it. Then there are subsections that cover each place it is used.

Our work is to decided if and where to add error-types, and what their values should be. I have marked mistakes or discussion points with "***"

Contents

binding

{*** error-type not listed! but has error-types of}

overwrite-children, overwrite-root

error-message

@model

If a model attribute refers to something other than a model element, an xforms-binding-error is dispatched

@bind

If there is no matching bind element, an xforms-binding-error is dispatched

Properties

If a property is attached to an atomic value or node that doesn't belong to an instance, an xforms-binding-error is dispatched to the element with the binding.

Some properties only apply to simpleContent; if the bound-to node does not contain simpleContent, an xforms-binding-error is dispatched to the element with the binding.

An xforms-binding-error is dispatched to any element that has a binding that applies disallowed properties twice to the same node.

Bind element

If the model attribute is used, and doesn't reference the parent model, an xforms-binding-error is dispatched to the bind element.

Shared element

If the element has a binding: It is evaluated, and must evaluate to a single element, and the control element that caused the current form to be embedded must also have a binding that similarly evaluates to a single element, otherwise an xforms-binding-error is dispatched to the shared element.

Expressions

At the time of evaluation, an expression must be syntactically correct, the namespaces it uses must be in scope, and the functions and variables it uses must be defined; otherwise one of the following events is dispatched:

If an expression uses an extension function for which the processor does not have an implementation, on evaluation an appropriate event (xforms-expression-error, xforms-binding-error, or xforms-action-error) must be dispatched to the containing element.

Var

Variable shadowing is not allowed: if a variable is declared with a name that is already in scope at the point of the new variable declaration, an xforms-binding-error is dispatched to the var element.

Applying Datatypes

If a type name is used that does not identify an in-scope type, an xforms-binding-error is dispatched to the relevant bind or instance element.

Control Data binding

When a control violates its data binding restriction, an xforms-binding-error is dispatched to the control.

Controls for simpleContent

If the element has child nodes then an xforms-binding-error event with an error-type of overwrite-children is dispatched to the control;

The root node: an xforms-binding-error with an error-type of overwrite-root is dispatched to the control.

Select

If one item or itemset element has a copy child or attribute, then all of them must have, and the bound target of the containing selection control must be an element node, otherwise an xforms-binding-error event is dispatched to the containing selection control.

Item element

If the Single Item Binding attributes are used and indicate a node in a model other than the bound node of the containing selection control, then an xforms-binding-error must occur.

itemset

if the bound target of the containing select or select1 element is not an element node, an xforms-binding-error event is dispatched to the containing selection element.

submission/header/name

If the model attribute is present and does not identify the containing model, an xforms-binding-error is dispatched to the name element.

submission/header/value

If the model attribute is present and does not identify the containing model, an xforms-binding-error is dispatched to the value element.

expression

has no error-type

error-message

AVT

An xforms-expression-error is dispatched to the element containing the expression in the following cases:

Expressions

At the time of evaluation, an expression must be syntactically correct, the namespaces it uses must be in scope, and the functions and variables it uses must be defined; otherwise one of the following events is dispatched:

If an expression uses an extension function for which the processor does not have an implementation, on evaluation an appropriate event (xforms-expression-error, xforms-binding-error, or xforms-action-error) must be dispatched to the containing element.

Control element

If the control element has a binding it must evaluate to a single element, and the embedded resource must have a shared element with a binding that also evaluates to a single element, otherwise an xforms-binding-error is dispatched to the control element.

If the control element has no binding, the embedded resource must either contain no shared element, or contain one without a binding, otherwise an xforms-binding-error is dispatched to the control element.

action

error-type

expression-error, binding-error, script-error, script-language,
setvalue-children, setvalue-root, setindex-repeat,
toggle-case, setfocus-control, dispatch-targetid/dispatch-target {*** which should it be?}
reset-instance, retain-instance, send-submission
+replace-with {*** not listed, but used}
+signal-control {*** not listed, but used}

error-message

Expressions

At the time of evaluation, an expression must be syntactically correct, the namespaces it uses must be in scope, and the functions and variables it uses must be defined; otherwise one of the following events is dispatched:

If an expression uses an extension function for which the processor does not have an implementation, on evaluation an appropriate event (xforms-expression-error, xforms-binding-error, or xforms-action-error) must be dispatched to the containing element.

Submit element

A submission element is identified from the submission attribute or its default: if no such element is identified then an xforms-action-error with an error-type of send-submission is dispatched;

Actions

If an action has a model attribute which does not identify a model element, then an xforms-action-error with an error-type of binding-error is dispatched.

If an error occurs during the evaluation of a non-binding expression on an action, then an xforms-action-error with an error-type of expression-error is dispatched.

If any value of type IDREF, except for model, on an action is required to identify a certain type of element, and doesn't, then an xforms-action-error with an error-type of element-attribute is dispatched,

action-warning

error-type: (only) load-error

error-message

load

If the result is an empty sequence, an xforms-action-warning is dispatched, with an error-type of load-error, and the load action has no further effect.

If traversal is not possible or fails, then an xforms-action-warning should be dispatched, with an error-type of load-error; however, it is recognized that there are circumstances where this is not possible, such as when the error is discovered after XForms processing has ended.

compute

has no error-type

error-message

Recalculate

If a compute is computationally dependent on an element in L and part of a circular dependency, then an xforms-compute-error must be dispatched to the model element.

Extension functions

When the document is loaded the processor must check that those functions are available. If any are not, an xforms-compute-error must be dispatched to the model element.

Recalc

Any expression violating any Binding Expression Constraint causes the recalculate flag to be cleared and an xforms-compute-error event to be dispatched.

version

has no error-type

error-message

@version

Processor must support at least one of the listed language versions of XForms; otherwise, the Processor dispatches the event xforms-version-error to the model.

If any non-default model has a version setting that is incompatible with the language version selected by the Processor, then the Processor dispatches the event xforms-version-error to the default model.

link

has no error-type

resource-uri

Linking

If the link traversal fails, the host language may dispatch xforms-link-error to the model associated with the element that bears the Linking Attributes Collection for the failed link.

instance

If creation of the XPath data model from inline content fails (for example because the instance element has more than one child element or none): An xforms-link-error is dispatched to the relevant model element with a resource-uri indicating a fragment identifier URI reference (including the leading # mark) for an identified internal instance, or empty string for an unidentified internal instance.

Schema initialisation

The XML Schemas, if any, are loaded. If an error occurs while attempting to access or process a remote document, an xforms-link-error is dispatched to the model:

Control element

If no resource is found, or the implementation cannot process it, an xforms-link-error is dispatched to the control element

output

(has no context at all)

UI-Common

The information is rendered in the same way as by the output element, and then displayed as described below; as a consequence they may also generate an xforms-output-error.

Output

Failure to render the content should result in a (non-fatal) xforms-output-error.

submit

error-type

submission-in-progress,
no-data, no-relevant-data,
validation-error, parse-error,
resource-error,
result-mediatype, result-text-mediatype, result-error-response,
target-model-error, target-empty, target-readonly, target-non-element.

error-message

(others)

instance

{*** Not sure if this one is OK; comments?}

If the link to the external data cannot be traversed, or it can be traversed, but an XPath data model cannot be created from the resource:

submission

many uses, all with error-types