- From: Steven Pemberton <steven.pemberton@cwi.nl>
- Date: Wed, 22 Aug 2018 14:55:36 +0200
- To: public-xformsusers@w3.org, "Steven Pemberton" <steven.pemberton@cwi.nl>
Here's my current proposed text. (There are still unresoved questions for me about the bind element section). Steven ===<span id="idref-resolve">Resolving ID References</span>=== Due to the run-time expansion of repeated content in XForms, it is possible that there is more than one run-time occurrence, or zero occurrences, of an element with a given ID. The following distinctions are made: * the element for which an IDREF must be resolved is called the '''source element''', * the element bearing the matching ID, if there is one, is called the '''target element''', * each run-time occurrence of the source element is called a '''source object''', * each run-time occurrence of the target element is called a '''target object'''. The source object performs the IDREF resolution, and the result of the resolution is either null or a target object. If there is no target element (no element with the required ID), resolution immediately fails. If the target element is not repeated that element is identified. If the target element is repeated additional information is used. <div class="div3"> ====<span id="idref-resolve-repeat">References to Elements within a repeat Element</span>==== Within the set of runtime objects containing the source object, if the target element is further nested in repeats the target object is identified by the current values of the repeat indexes of those repeats; if any index is zero, no object is identified. If the target element is not further nested in repeats, the single target object is identified. <div class="example" title=""> In these three cases, there is only one possible target object: <repeat> <repeat> target source </repeat> </repeat> <repeat> target <repeat> source </repeat> </repeat> target <repeat> <repeat> source </repeat> </repeat> In these two cases, the repeat indexes of repeats r2 and r3 determine the target object: <repeat r1> source <repeat r2> <repeat r3> target </repeat> </repeat> </repeat> <repeat r1> source </repeat> <repeat r2> <repeat r3> target </repeat> </repeat> </div> </div><div class="div3"> ====<span id="idref-resolve-bind">References to Elements within a bind Element</span>==== When a source object expresses a binding with a <code>bind</code> attribute, if the target <code>bind</code> element has one or more <code>bind</code> element ancestors, then the identified <code>bind</code> may be a target element that is associated with more than one target bind object. If a target <code>bind</code> element is outermost, or if all of its ancestor <code>bind</code> elements have <code>ref</code> attributes that select only one node, then the target <code>bind</code> only has one associated bind object, so this is the desired target bind object whose sequence is used in the source binding. Otherwise, the [[#in-scope-evaluation-context|in-scope evaluation context]] item of the source object containing the <code>bind</code> attribute is used to help select the appropriate target bind object from among those associated with the target <code>bind</code> element. From among the bind objects associated with the target <code>bind</code> element, if there exists a bind object created with the same in-scope evaluation context item as the source object, then that bind object is the desired target bind object. Otherwise, the IDREF resolution produced a null search result. ==== Failure to Resolve an ID ==== A null resolution for an IDREF is handled differently depending on the source object: * an XForms action such as <code>dispatch</code>, <code>send</code>, <code>setfocus</code>, <code>setindex</code> or <code>toggle</code>, is terminated with no effect * a <code>submit</code> control does not dispatch <code>xforms-submit</code> if its <code>submission</code> attribute does not indicate an existing <code>submission</code> element. * a function that performs an IDREF search returns an empty result such as <code>NaN</code> for the <code>index()</code> function or the empty sequence for the <code>instance()</code> function. * However, an <code>xforms-binding-error</code> occurs if there is a null search result for the target object indicated by attributes <code>bind</code>, <code>model</code> and <code>instance</code>. </div></div><div class="div2"> On Thu, 28 Jun 2018 14:04:08 +0200, Steven Pemberton <steven.pemberton@cwi.nl> wrote: > > https://www.w3.org/community/xformsusers/wiki/XForms_2.0#References_to_Elements_within_a_repeat_Element > > I was trying to simplify the language in this section to try and make it > easier to read, and I can't find any case that isn't covered by the text: > > "The target object is identified by the current values of the repeat > indexes of the enclosing repeats. If any index is zero, no object is > identified." > > Am I missing anything? > > Steven
Received on Wednesday, 22 August 2018 12:56:00 UTC