Revised proposal that fully specifies evaluation order for setVariable and newVariableInstance.
---------------------------------------------
Errata 3.20, 3.21, and Errata 3.25 must be modified (and the corresponding
sections of the spec)
For errata 3.20, and errata 3.21 the sentence:
"However, the order of execution among them is not specified.
Schema authors can insert sequences to control the timing of evaluation
of statements more precisely."
is replaced by:
"The order of execution is specified in errata 3.25."
Errata 3.25 is modified.
Numbered item 3 of both the first list and second list
is replaced by:
3. dfdl:setVariable(s) - in lexical order, innermost schema component first
Numbered item 2 of the second list is replaced by:
2. dfdl:newVariableInstance(s) - in lexical order, innermost schema component first
These two paragraphs are added below the numbered lists to clarify what
'lexical order, innermost schema component first' means.
The dfdl:setVariable annotations at any one annotation point of the schema
are always executed in lexical order. However, dfdl:setVariable annotations
can also be found in different annotation points that are combined into
the resolved set of annotations for one schema component. In this case,
the order of execution of the dfdl:setVariable statements from any one
annotation point remains lexical. The order of execution of the dfdl:setVariable annotations different
annotation points follows the principle of innermost first, meaning that a schema component that references another schema component has its dfdl:setVariable statements executed after those of the referenced schema component. For example, if an element reference and an element declaration both have dfdl:setVariable statements, then those on the element declaration will execute before those on the element reference. Similarly dfdl:setVariable statements on a base simple type execute before those of a simple type derived from it. The dfdl:setVariable statements on a simple type execute before those on an element having that simple type (whether by reference, or when the simple type is lexically nested within the element declaration). The dfdl:setVariable statements on the sequence or choice within a global group definition execute before those on a group reference.
The dfdl:newVariableInstance annotations at any one annotation point of
the schema are always executed in lexical order. However, dfdl:newVariableInstance
annotations can also be found in different annotation points that are combined
into the resolved set of annotations for one schema component. In this
case, the order of execution of the dfdl:newVariableInstance statements
from any one annotation point remains lexical. The order of execution of the dfdl:newVariableInstance
annotations different
annotation points follows the principle of innermost first, meaning that
a schema component that contains or references another schema component
has its dfdl:newVariableInstance statements executed after those of the
contained or referenced schema component. For example, if a group
reference and the sequence or choice group of a group definition both have dfdl:newVariableInstance
statements, then those on the global group definition will execute before
those on the group reference.