<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="xhtml2.css" ?>
<!-- no doctype yet, but the id attribute needs to be of type ID, 
so the id (#) syntax works in CSS -->
<!DOCTYPE html [
	<!ATTLIST section id ID #IMPLIED>
	<!ATTLIST h       id ID #IMPLIED>
	<!ATTLIST div     id ID #IMPLIED>
	<!ATTLIST nl      id ID #IMPLIED>
]>
<html xmlns="http://www.w3.org/2002/06/xhtml2" lang="en">
<head>
<title>Chapter 8: Form controls</title></head>
<body>
<h>9 XForms User Interface</h>http://www.w3.org/MarkUp/Forms/Group/Drafts/Sources/ slice9.html  
<section>
<h>9.1 XForms Group Module</h>
<section>
<h>9.1.1 group</h>
<p>(must)[[needs to be stronger]] The binding expression is solely for the purpose of authoring convenience; it allows controls appearing within element group to use relative XPath expressions.</p>
<p>(must) Model item properties such as relevant on the bound instance node have no special effect on the group.</p>
<p>(must? vague) The label element has special significance when it appears as the first element child of group, representing a label for the entire group.</p>
<p>(must) The hierarchy defined by nested group elements is used to determine the traversal order specified by attribute navindex on form controls. Setting the input focus on a group results in the focus being set to the first form control in the navigation order within that group.</p></section></section>  
<section>
<h>9.2 XForms Switch Module</h>
<section>
<h>9.2.1 switch</h>
<p>(must) This element contains one or more case elements, any one of which is rendered at a given time.</p>
<p>(no other assertions here)(Missing?: that selected=false means do not display and vv)</p></section>
<section>
<h>9.2.2 case</h>
<p>(must?) This element encloses markup to be conditionally rendered. The attribute selected determines the selected state and can be manipulated programmatically via the DOM, or declaratively via XForms action toggle.</p>
<p>(must) selected Optional selection status for the case. The default value is &quot;false&quot;.</p>
<p>(must) If multiple cases within a switch are marked as selected=&quot;true&quot;, the first selected case remains and all others are deselected.</p>
<p>(must) If none are selected, the first becomes selected.</p></section>
<section>
<h>9.2.3 toggle</h>
<p>(must) This action adjusts all selected attributes on the affected cases to reflect the new state, and then performs the following:</p>
<p>(must) Dispatching an xforms-deselect event to the currently selected case.</p>
<p>(must) Dispatching an xform-select event to the case to be selected.</p></section></section>  
<section>
<h>9.3 XForms Repeat Module</h>
<p>[[this section defines user interface construct: add 'a']]</p>
<section>
<h>9.3.1 repeat</h>
<p>(is there an assertion here?) This element defines a UI mapping over a homogeneous collection selected by Node Set Binding Attributes. This node-set must consist of contiguous child element nodes, with the same local name and namespace name of a common parent node. The behavior of element repeat with respect to non-homogeneous node-sets is undefined.</p>
<p>(may) startindex Optional 1-based hint to the XForms Processor as to which starting element from the collection to display. The default value is 1.</p>
<p>(may) number Optional hint to the XForms Processor as to how many elements from the collection to display.</p>
<p>(must)[[shouldn't be a must]] In the absence of this attribute, all elements of the collection are displayed.</p>
<p>(must) This element operates over a homogeneous collection by binding the encapsulated user interface controls to each element of the collection.</p>
<p>(may) Attributes on this element specify how many members of the collection are presented to the user at any given time.</p>
<p>(elsewhere) XForms actions insert, delete, and setindex can be used to operate on the collection - see 10 XForms Actions.</p></section>
<section>
<h>9.3.2 Creating Repeating Structures Via Attributes</h>
<p>(must) The above attributes are equivalent to the repeat attributes of the same name, but without the prefix repeat-.</p>
<p>(must) Additionally, when using XForms Action setindex, attribute repeat of type idref can point to any element carrying the repeat attributes. </p>
<p>(must) Similarly, when using function index against a repeating structure created via the repeat-attributes, the id of that element can be used as the argument to function index.</p></section>
<section>
<h>9.3.3 itemset</h>
<p>(must) This element allows the creation of dynamic selections within controls select and select1, where the available choices are determined at run-time. The node-set that holds the available choices is specified via attribute nodeset. As with repeat, this nodeset should refer to a homogeneous collection. </p>
<p>(must) Child elements label and value indirectly specify the label and storage values.</p>
<p>(must) Notice that the run-time effect of itemset is the same as using element choices to statically author the available choices.</p>
<p>(must) Whenever a refresh event is dispatched the nodeset is re- evaluated to update the list of available choices.</p></section>
<section>
<h>9.3.4 copy</h>
<p>When an item becomes selected, the following rules apply:</p>
<p>(must) The target node, selected by the binding attributes on the list form control, must be an element node otherwise an exception results (4.5.1 The xforms-binding-exception Event).</p>
<p>(must) The element node associated with the item, selected by the binding attributes on copy, is deep copied as a child of the target node.</p>
<p>(must) A full computational dependency rebuild.[[is done]]</p>
<p>When an item becomes unselected, the following rules apply:</p>
<p>(must) The target node, selected by the binding attributes on the list form control, must be an element node, otherwise an exception results (4.5.1 The xforms-binding-exception Event).</p>
<p>(must) The child element node associated with the item, selected by the binding attributes on copy, is deleted.</p>
<p>(must) A full computational dependency rebuild.[[is done]]</p></section>
<section>
<h>9.3.5 insert</h>
<p>(must) This action is used to insert new entries into a homogeneous collection, e.g., a set of items in a shopping cart. Attributes of action insert specify the insertion in terms of the collection in which a new entry is to be inserted, and the location within that collection where the new node will appear. The new node is created by cloning the final member of the homogeneous collection specified by the initialization instance data.</p>
<p>(must) In this process, nodes of type xsd:ID are not copied.</p>
<p>The rules for insert processing are as follows:</p>
<p>(must) The homogeneous collection to be updated is determined by evaluating binding attribute nodeset.</p>
<p>(must) The corresponding node-set of the initial instance data is located to determine the prototypical member of the collection. The final member of this collection is cloned to produce the node that will be inserted. Finally, this newly created node is inserted into the instance data at the location specified by attributes position and at.</p>
<p>(must) Attribute at is evaluated to determine the insertion index - a numerical value that is the index into the node-set.</p>
<p>(must) Attribute position specifies whether the new node is inserted before or after this index.</p>
<p>The rules for selecting the index are as follows:</p>
<p>(must) The return value of the XPath expression in attribute at is processed according to the rules of the XPath function round(). For example, the literal 1.5 becomes 2, and the literal 'string' becomes NaN.</p>
<p>(must) If the result is NaN, the insert appends to the end of the node- set.</p>
<p>(must) If the resulting index is outside the valid range of the node-set, it is replaced with either 1 or the size of the node-set, whichever is closer.</p>
<p>(must) Finally, the index for any repeating sequence that is bound to the homogeneous collection where the node was added is updated to point to the newly added node.</p>
<p>(must) The indexes for inner nested repeat collections are re-initialized to 1.</p>
<p>(must) This action results in the insertion of newly created data nodes into the XForms instance data. Such nodes are constructed as defined in the initialization section of the processing model - see 4.2 Initialization Events.</p>
<p>(must) If this action is contained within an action element, it has special deferred update behavior (10.1.1 The action Element).</p></section>
<section>
<h>9.3.6 delete</h>
<p>The rules for delete processing are as follows:</p>
<p>(must) The homogeneous collection to be updated is determined by evaluating binding attribute nodeset. If the collection is empty, the delete action has no effect.</p>
<p>(must) The n-th element node is deleted from the instance data, where n represents the number returned from node-set index evaluation, defined in 9.3.5 The insert Element.</p>
<p>(must) If no nth node exists, the operation has no effect.</p>
<p>(must) If the last remaining item in the collection is removed, the index position becomes 0.</p>
<p>(must) Otherwise, the index will point to the new n-th item.</p>
<p>(must) If this action is contained within an action element, it has special deferred update behavior (10.1.1 The action Element).</p></section>
<section>
<h>9.3.7 setindex</h>
<p>(must) The implementation data structures for tracking computational dependencies are rebuilt or updated as a result of this action. </p>
<p>(must) The indexes for inner nested repeat collections are re-initialized to 1.</p></section>
<section>
<h>9.3.8 Repeat Processing</h>
<p>During user interface initialization (see 4.2.4 The xforms-ui-initialize Event), the following steps are performed for repeat:</p>
<p>(must) Attribute nodeset is evaluated to locate the homogeneous collection to be operated on by this repeat.</p>
<p>(must) The corresponding nodes in element instance in the source document are located - these nodes provide initial values and also serve as a prototypical instance for constructing members of the repeating collection.</p>
<p>(must) The index for this repeating structure is initialized to point at the head of the collection.</p>
<p>(must) The user interface template specified within element repeat is bound to this prototypical instance. </p>
<p>(must) If there is a type mismatch between the prototypical instance and the binding restrictions for the user interface controls, an error is signaled and processing stops.</p>
<p>(must) User interface as specified by the repeat is generated for the requisite number of members of the collection as specified by attributes on element repeat, and model item constraints minOccurs and maxOccurs.</p>
<p>(must) The binding expression attached to the repeating sequence returns a node-set of the collection being populated, not an individual node. Within the body of element repeat, binding expressions are evaluated with a context node of the node determined by the index.</p>
<p>(must) Repeat processing uses XPath expressions to address the collection over which element repeat operates. The initial instance data supplies the prototypical member of the homogeneous collection, and this is used during UI initialization - 4.2.4 The xforms-ui-initialize Event - to construct the members of the homogeneous collection.</p>
<p>(author must) To create homogeneous collections, the initial instance data must specify at least one member of the collection; this requirement is similar to requiring instance data in addition to a schema, and the same justification applies.</p>
<p>(author must) The form controls appearing inside repeat need to be suitable for populating individual items of the collection.</p></section>
<section>
<h>9.3.9 Nested Repeats</h>
<p>(must) It is possible to nest repeat elements to create more powerful user interface for editing structured data.</p>
<p>(must) Notice that an inner repeat's index always starts from 1.</p></section>
<section>
<h>9.3.10 User Interface Interaction</h>
<p>(may) The number of displayed items might be less than the total number available in the collection. In this case, the presentation would render only a portion of the repeating items at a given time.</p>
<p>(must) The current item indicated by the repeat index should be presented at all times, for example, not allowed to scroll out of view.[[presented=&gt;visible]]</p>
<p>(author may) The XForms Actions enumerated at 10 XForms Actions may be used within event listeners to manipulate the homogeneous collection being populated by scrolling, inserting, and deleting entries. [[at 10 =&gt; in 10]]</p></section></section>   
<hr></hr>  
<address>
<a href="mailto:steven.pemberton@cwi.nl">U-SRX41P\steven</a></address> 
<!-- Created: Thu Oct 31 19:07:48 WEST 2002 --> 
<!-- hhmts start --> 
<!-- hhmts end --></body></html>