Copyright © 2006 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C liability, trademark and document use rules apply.
This document records resolutions of known errors in the XForms 1.0 Second Edition Recommendation: http://www.w3.org/TR/2006/REC-xforms-20060314/
1 Initializing repeat with startindex
1.1 Repeat re-initialization during delete action
(Section 9.3.6)
2 Submission error on empty nodeset
2.1 Default action of xforms-submit event (Section
11.1)
3 Evaluation Context for setindex Action
3.1 Specify evaluation context for index attribute of
setindex (Section 9.3.7)
4 Behavior of setvalue Action
4.1 The setvalue Action Behavior on Empty Single-Node
Binding (Section 10.1.9)
5 Deferred Update of XForms Action Sequences
5.1 Main Description of Deferred Update
5.2 Clarify Deferred Update Behavior within Specific
Action Subsections
5.3 Further Clarify that rebuild, recalculate,
revalidate and refresh Actions Occur Directly
5.4 Clarify that the Instance Replacement of a
Submission Clears Deferred Update Flags
6 Clarify that calculate assigns a string
6.1 Specify that calculate assigns a string value
(Section 6.1.5)
7 The load Element
7.1 Clarify that linking attributes is a reference to
the resource attribute (Section 10.1.8)
7.2 The load Action Behavior on Empty Single-Node
Binding (Section 10.1.8)
8 Align Schema with Recommendation for instance
Attribute
9 Express an ID attribute in Common Attributes
10 Clarify XForms Type Validation
10.1 Type Validation (Section 4.3.5)
10.2 The type Model Item Property Description
(Section 6.1.1)
11 Recalculation Clarification
12 Clarification of Precedence Rule for value Element
13 Clarification of User Interface Creation for message
Action
14 References
14.1 Normative References from XForms
1.0
When the index of a repeat
is initialized or re-initialized,
the index should be set equal to the value of the startindex
attribute when possible.
The repeat
index re-initialization that occurs during a
delete
action uses 1, not startindex
. Although the
re-initialization is technically part of the repeat
processing
associated with instance node deletion, the current specification wording
appears in the section on the delete
action, specifically at the
end of the third numbered point in the description of the at
attribute.
To re-initialize a repeat means to change the index to 0 if it is empty, otherwise 1.
To re-initialize a repeat index means to change
its value to be equal to startindex
, or to 0
if the homogeneous collection contains less than
startindex
items.
The case of not having a node of data to submit is not handled by submission processing.
The first step of submission event default action processing states that a
node of instance data is selected by the attributes of the
submission
element. This erratum handles the case of those
attributes selecting an empty nodeset.
A node from the instance data is selected, based on attributes on
the submission
element. The indicated node and all nodes
for which it is an ancestor are considered for the remainder of the
submit process. Any node which is considered not relevant as defined in
6.1.4
The relevant Property is removed.
A node from the instance data is selected, based on attributes on
the submission
element. If the attributes of
submission
select an empty nodeset, then submission
processing is stopped after dispatching event
xforms-submit-error
. Otherwise, the indicated node
and all nodes for which it is an ancestor are considered for the
remainder of the submit process. Any node which is considered not
relevant as defined in 6.1.4
The relevant Property is removed.
The evaluation context node for the setindex
action is not
specified.
The evaluation context for the index
attribute of the
setindex
action is specified.
Required XPath expression that evaluates to a 1-based offset into the sequence.
Required XPath expression that evaluates to a 1-based offset into the sequence. The evaluation context is determined in the same manner as the evaluation context for a Single-Node Binding (see 7.4 Evaluation Context).
The recommendation does not directly indicate the behavior of the
setvalue
action when the Single-Node Binding does not select a
node.
The recommendation states that the result of the value
attribute replaces the content of the instance node selected by the
Single-Node Binding. This erratum directly states that the
setvalue
action should perform no operation. This is in accord
with the implications of the current specification since, if no instance node
is selected, then there is nowhere to put the value
result, nor
is there even a context node for evaluating the value
attribute.
This action explicitly sets the value of the specified instance data node.
This action explicitly sets the value of the specified instance data node. This action has no effect if the Single-Node Binding does not select an instance data node.
The automatic rebuild, recalculate, revalidate, refresh behaviors of XForms actions are deferred to the end of execution of an outermost action handler. This erratum recognizes that an action can be outermost relative not only to actions it contains but also actions that it executes by way of dispatching events. This erratum also clarifies the processing of deferred update flags across multiple models and in response to reset actions and instance replacement submissions. It also clarifies that deferred update behaviors are performed by dispatching events to models and that the XForms processor exits the deferred behavior state before these events are dispatched on behalf of an outermost action handler.
Modified Description of Deferred Update and moved it out of Section 10.1.1.
Deferred Updates: Many XForms Actions have a deferred
effect on the instance data when specified as a descendant of an
action
element.
Implementations are free to use any strategy to accomplish deferred
updates, but the end result must be as follows: Instance data changes
performed by a set of actions do not result in immediate computation
dependency rebuilding, recalculation, revalidate and form control
refreshing until the termination of the outermost action handler, as
described here. Each outermost action handler can be thought of as
having a set of Boolean flags, initially false
, to
indicate whether each of the actions rebuild
,
recalculate
, revalidate
, and
refresh
are required upon termination of the outer action
handler.
Actions that directly invoke rebuild, recalculate, revalidate, or refresh always have an immediate effect, and clear the corresponding flag. The XForms Actions in this category are:
rebuild
recalculate
revalidate
refresh
XForms Actions that change the tree structure of instance data
result in setting all four flags to true
. The XForms
Actions in this category are:
insert
delete
XForms Actions that change only the value of an instance node
results in setting the flags for recalculate
,
revalidate
, and refresh
to true
and making no change to the flag for rebuild
. The XForms
Actions in this category are:
setvalue
Finally, the reset
action takes effect immediately and
clears all of the flags.
An outermost action handler is an action that is activated when the XForms processor is not executing any other action handlers.
An inner action handler is an action that is activated when the XForms processor is executing the declared actions of an outermost action handler. An inner action handler may be within the content of the outermost action handler, or it may be executed as the response to an event dispatched while performing all of the actions initiated by the outermost action handler.
Deferred Updates: Sequences
of one or moreXForms Actions have a deferred effect on
XForms model and user interface processing .
Implementations are free to use any strategy to accomplish deferred
updates, but the end result must be as follows: Instance data changes
performed by a set of actions do not result in immediate computation
dependency rebuilding, recalculation, revalidate and form control
refreshing until the termination of the outermost action handler, as
described here. Each XForms model can be thought of as
having a set of deferred update Boolean flags, initially
false
at the start of an outermost action handler, to
indicate whether each of the actions rebuild
,
recalculate
, revalidate
, and
refresh
are required for that model upon
termination of the outermost action handler.
Execution of an outermost action handler begins by
setting the XForms processor into the state of executing an outermost action handler. The outermost action handler
is then performed, which may include the execution of inner action handlers. Finally, the
XForms processor is set into the state of not executing an outermost action handler and then
the deferred update is performed for each model. The deferred update
behavior for a model consists of examining each deferred update Boolean
flag in the order of rebuild
, recalculate
,
revalidate
, and refresh
, and for each
true
flag, set the flag to false
and then
dispatch the proper event to the model for that deferred update flag
(i.e. dispatch xforms-rebuild
for a true
rebuild
flag, xforms-recalculate
for a true
recalculate
flag, xforms-revalidate
for a
true revalidate
flag, and xforms-refresh
for
a true refresh
flag).
Note:
The XForms processor is not considered to be executing an outermost action handler at the time that it performs deferred update behavior for XForms models. Therefore, event handlers for events dispatched to the user interface during the deferred refresh behavior are considered to be new outermost action handler.
Actions that directly invoke rebuild, recalculate, revalidate, or refresh always have an immediate effect, and clear the corresponding deferred updateflag. The XForms Actions in this category are:
rebuild
recalculate
revalidate
refresh
XForms Actions that change the tree structure of instance data
result in setting all four deferred updateflags to
true
for the model over which they operate.
The XForms Actions in this category are:
insert
delete
XForms Actions that change only the value of an instance node
results in setting the deferred updateflags for
recalculate
, revalidate
, and
refresh
to true
and making no change to the
deferred updateflag for rebuild
for the
model over which they operate. The XForms Actions in this
category are:
setvalue
Finally, the reset
action clears all of the
deferred update flags for a model.
Similarly, if the default processing of
xforms-submit
replaces instance data in a model, then the
deferred update flags for that model are cleared immediately before the
behaviors are peformed for xforms-rebuild
,
xforms-recalculate
, xforms-revalidate
, and
xforms-refresh
.
The links to deferred update behavior in several subsections describing actions appeared within text that did not reflect the updated definition of outermost action.
If this action is contained within an action
element,
it has special deferred update behavior (10.1.1 The action
Element).
This action has special deferred update behavior .
Due to the prior wording of the deferred update behavior, the meaning of the phrase "bypassing the normal event flow" was not clear.
bypassing the normal event flow.
bypassing the normal event flow (i.e. the behavior occurs
without dispatching the xforms-rebuild
event).
bypassing the normal event flow.
bypassing the normal event flow (i.e. the behavior occurs
without dispatching the xforms-recalculate
event).
bypassing the normal event flow.
bypassing the normal event flow (i.e. the behavior occurs
without dispatching the xforms-revalidate
event).
bypassing the normal event flow.
bypassing the normal event flow (i.e. the behavior occurs
without dispatching the xforms-refresh
event).
Successful instance replacement by the default processing of
xforms-submit
is followed by performing the behaviors of
rebuild, recalculate, revalidate and refresh. This correction clarifies the
fact that the deferred update flags for the affected model are cleared
immediately before performing the behaviors.
Once the XML instance data has been replaced, the rebuild,
recalculate, revalidate and refresh operations are performed on the
model, without dispatching events to invoke those four operations.
Submit processing then concludes after dispatching
xforms-submit-done
.
Once the XML instance data has been replaced, the rebuild,
recalculate, revalidate and refresh operations are performed on the
model, without dispatching events to invoke those four operations.
This operation is associated with special deferred update behavior.
Submit processing then concludes after dispatching
xforms-submit-done
.
The calculate
model item property cannot be used to assign an
XML subtree as new content for the associated instance data node.
Clarify that string() is applied to the result of a calculate
expression.
Description: supplies an expression used to calculate the value of the associated instance data node.
Description: supplies an expression used to calculate a string value for the associated instance data node.
An XForms Model may include model items that are computed from other values.
An XForms Model may include model items whose string values are computed from other values.
Such computed values can be expressed with
calculate
properties, whose XPath expressions are
evaluated and converted to strings with the XPath string()
function.
The load
action does not describe what to do if the
single-node binding does not resolve to a node. It also does uses the term
linking attributes to refer to the resource
attribute.
Modify description of load
action behavior to refer
specifically to the resource
attribute rather than linking
attributes.
Either the Single-Node Binding attributes, pointing to a URI in the instance data, or the linking attributes are required.
Either the Single-Node Binding attributes, pointing to a URI in
the instance data, or the resource
attribute
is required.
The load
action performs no operation when the Single-Node
Binding produces an empty nodeset result.
If both are present, the action has no effect.
If both the Single-Node Binding and the
resource
attribute are present, the action has no
effect. This action has no effect if the Single-Node Binding is
present and does not select an instance data node.
The instance
attribute of the submission
element
must appear in the schema for the element.
submission
:<xsd:attribute name="instance" type="xsd:IDREF" use="optional"/>
This erratum alters the means by which XForms imposes the requirement to have ID mechanism to support processing of the many XForms elements containing attributes of type IDREF. This is achieved by placing an optional local attribute of type ID in the Common Attributes bundle so that all XForms elements may be identified. Host languages may still also provide a global attribute of type ID or support xml:id (or both).
A host language must permit an attribute of type
xsd:ID
on each XForms element.
The optional id
attribute of type
xsd:ID
assigns an identity to the containing
element.
<xsd:attribute name="id" type="xsd:ID" use="optional"/>
The descriptions of node validation and of the type
model
item property are clarified.
The intent of the wording is to say that the node must satisfy any Schema definitions applied to or associated with the the node. The current wording could be read as saying the node is valid if the node satisfies any one of the schema definitions.
the node satisfies any applicable XML schema definitions (including those associated by the type model item property)
the node satisfies all applicable XML schema
definitions (including those associated by the type
model
item property , by an external or an inline schema, or by
xsi:type
)
This erratum clarifies that the type
model item property
associates type information by a node by providing information related to the
validation of its content. It also clarifies that the type
model
item property is not used for complex content validation.
An element with simple content but an attribute is technically a complex
type. The type
model item property can be used to associate with
the node a simple type or a complex type with simple content. The first
assignment is legal since only the node content is validated according to the
simple type. The second assignment is legal since only the underlying simple
type of the simple content is used to validate the node content. In both
cases, the attribute is not validated by the association. A separate
type
model item property could be used to associate a type with
the attribute node directly.
Description: associates a Schema datatype.
Computed Expression: No.
Legal Values: Any xsd:QName
representing a datatype
definition in an XML Schema.
Default Value: xsd:string
.
Inheritance Rules: does not inherit.
The effect of this model item property is the same as placing
attribute xsi:type
on the instance data. However, in
contrast to xsi:type
, type
can be added to
both elements and attributes.
<instance> <my:person-name> <my:first-name /> <my:last-name xsi:type="my:nonEmptyString" /> </my:person-name> </instance> <bind type="my:nonEmptyString" nodeset="/my:person-name/my:first-name" />
Here, we have illustrated two ways in which an XML Schema type can be associated with an element.
Description: The type model item property can be applied to
both elements and attributes. The type model item property is not
applied to instance nodes that contain child elements. The type model
item property associates a datatype (as defined in [XML Schema part 2]) with the string-value
(as defined in [XPath 1.0]) of an instance
node. The datatype being associated can be obtained from a simpleType
definition or a simpleContent definition from a complexType. If the
datatype cannot be obtained as just described, then the Default Value
of xsd:string
is used.
Computed Expression: No.
Legal Values: Any xsd:QName
representing a datatype
definition in an XML Schema.
Default Value: xsd:string
.
Inheritance Rules: does not inherit.
<model xmlns:my="http://example.org"> <xsd:schema targetNamespace="http://example.org" xmlns:my="http://example.org"> <xsd:simpleType name="Currency"> <xsd:restriction base="xsd:string"> <xsd:enumeration value="USD"/> <xsd:enumeration value="EUR"/> </xsd:restriction> </xsd:simpleType> <xsd:complexType name="Price"> <xsd:simpleContent> <xsd:extension base="xsd:double"> <xsd:attribute name="currency" type="my:Currency" use="optional" default="USD"/> </xsd:extension> </xsd:simpleContent> </xsd:complexType> </xsd:schema> <instance> <data xmlns="http://example.org"> <aString>Hello, world!</aString> <simpleType> <price>100.00</price> <price>abc</price> <price currency="EUR">100.00</price> <price currency="EUR">abc</price> </simpleType> <complexType> <price>100.00</price> <price>abc</price> <price currency="abc">100.00</price> <price currency="EUR">abc</price> </complexType> </data> </instance> <bind nodeset="my:aString" type="xsd:string"/> <bind nodeset="my:simpleType/my:price" type="xsd:double"/> <bind nodeset="my:complexType/my:price" type="my:Price"/> <bind nodeset="my:complexType/my:price[3]/@currency" type="my:Currency"/> <bind nodeset="/my:data" type="xsd:string"/> </model>
The first bind expresses the default datatype of xsd:string.
The second and third binds place type model item properties on each
of the four price
element children of the elements
simpleType
and complexType
. Both binds
associate the datatype xsd:double
with the nodes. In both
cases, the first and third nodes are considered valid according to the
type model item property because their content matches the
xsd:double
datatype constraint. For both binds, the second
and fourth price
nodes are not valid due to their
content.
The fourth bind places a type model item property on the
currency
attribute of the third price
element. According to this association, the currency
attribute node is not valid because its content does not match the
enumeration given for my:Currency
. Note that the
containing element price
is valid according to its type
model item property.
The fifth bind attempts to associate a datatype with the
data
element. The association is ignored since the
data
element contains child elements.
The recalculation after a rebuild is intended to re-evaluate the
calculate
expressions of all calculated instance values, not
just those expressions that depend on some node of instance data. The current
wording of the algorithm in Appendix D makes this clear, but one aspect of
the wording in the xforms-recalculate event processing does not.
When a recalculation event begins, there will be a list L of one or more instance nodes whose values have been changed, e.g., by user input being propagated to the instance.
An XForms Processor should not recalculate computes that are not computationally dependent on one or more of the elements in L.
An XForms Processor should perform only a single recalculation of each compute that is computationally dependent on one or more of the elements in L.
An XForms Processor must recalculate a compute C after recalculating all computes of instance nodes on which C is computationally dependent. (Equivalently, an XForms Processor must recalculate a compute C before recalculating any compute that is computationally dependent on the instance node associated with C.)
When a recalculation event begins, there will be a list L of one or more instance nodes whose values may have been changed, e.g., by user input being propagated to the instance.
An XForms Processor must recalculate computes for nodes in L and nodes that are computationally dependent on nodes in L.
An XForms Processor must perform only a single recalculation of each compute that is computationally dependent on one or more of the elements in L.
An XForms Processor must recalculate a compute C after recalculating all computes of instance nodes on which C is computationally dependent. (Equivalently, an XForms Processor must recalculate a compute C before recalculating any compute that is computationally dependent on the instance node associated with C.)
The specification refers to the ref
attribute rather than to
the term Single Node Binding.
If inline content and a ref
attribute are both
specified, the ref
attribute is used.
If inline content and a Single Node Binding are both specified, the Single Node Binding is used.
The message
action must be able to show the current instance
data, even if the message content is constructed with output
controls.
A graphical browser might render a modal message as follows:
<model> <message level="modal" ev:event="xforms-ready">This is not a drill!</message> ... </model>
...
The user interface for the message
action is
considered to be created at the time the action occurs. If the message
is obtained from the inline content of the message
action,
then the output of any output
controls in the
message
content is determined based on the instance data
available when the message
action occurs. For example, the
following example displays the message Hello, world!
:
<model> <instance xmlns=""> <data> <name>John</name> </data> </instance> <action ev:event="xforms-ready"> <setvalue ref="name">world</setvalue> <message level="modal">Hello, <output ref="name"/>!</message> ...</action> </model>
In this example, the message includes the latest user input even
though other form controls not in the message
action are
not guaranteed to be updated until the end of the
xforms-refresh
event processing:
<input ref="birthday"> <label>Enter birthday:</label> <message ev:event="xforms-invalid"><output ref="."/> isn't a valid birthday</message> </input>
Note:
Due to deferred update behavior, if a message
action is
preceded in an action sequence by other actions that change instance
nodes, and the message references nodes that are computationally
dependent on the changed nodes, then the form author should invoke the
recalculate
action before the message
action.
A graphical browser might render a modal message as follows:
<model> <message level="modal" ev:event="xforms-ready">This is not a drill!</message> ... </model>
...